CID 问题

http://wanchengbuyi.blog.163.com/blog/static/1664618312010717802059/

在Asterisk PBX 经常会遇到模拟卡Caller ID 无法显示的问题。这里做个总结:

(1) 确保线路是标准的PSTN 线

(2) 确保线路具有caller ID 显示功能

(3) 确定caller ID 的格式,是dtmf 还是fsk 这一步分析录音文件来确定 dahdi_monitor 通道号 -v -r rx.raw 然后用Adobe Audition来

     分析是哪一种类型

(4)确保asterisk配置都正确

[root@server2 ~]# vi /etc/dahdi/system.conf

    loadzone = (正确的时区)

    defaultzone = (正确的时区)

[root@server2 ~]# vi /etc/asterisk/indications.conf [general]

    country=(正确 )

[root@server2 ~]# vi /etc/asterisk/chan_dahdi.conf

     callerid=asreceived usecallerid=yes cidsignalling=v23 hideallerid=no cidstart=polarity

     这几项根据自己的具体情况设置 , 加载驱动时加参数opermode=(正确的时区)(大写)

[root@server2 ~]# dmesg

    Module 0: Installed -- AUTO FXO (正确的时区 mode)

    Module 1: Installed -- AUTO FXO (正确的时区mode)

(5)用以下dialplan 

    [from-pstn]

        exten => s,1,Wait(3)

        exten => s,n,Answer()

        exten => s,n,NoOp(${CALLERID(ALL)})

        exten => s,n,Hangup()

(6) 打开所有debug信息 [root@server2 ~]# vi /etc/asterisk/logger.conf 

     error => error

    debug => debug

    console => notice,warning,error

    console => notice,warning,error,debug

    messages => notice,warning,error

    full => notice,warning,error,debug,verbose

(7)打电话测试 如果有以下显示信息

     [Aug 17 19:42:25] NOTICE[3555]: chan_dahdi.c:6668 ss_thread: CallerID number: 0098675582535362, name: (null), flags=4

     [Aug 17 19:42:25] NOTICE[3555]: chan_dahdi.c:6668 ss_thread: CallerID number: 0098675582535362, name: (null), flags=4

     [Aug 17 19:42:27] WARNING[3555]: chan_dahdi.c:6685 ss_thread: CID timed out waiting for ring. Exiting simple switch

     [Aug 17 19:42:27] WARNING[3555]: chan_dahdi.c:6685 ss_thread: CID timed out waiting for ring. Exiting simple switch

就要修改chan_dahdi.c ,然后重新编译。

    6564 cs = NULL;

    6565 ast_log(LOG_DEBUG, "Receiving DTMF cid on "

    6566 "channel %s/n", chan->name);

    6567 dahdi_setlinear(p->subs[index].dfd, 0);

    6568 res = 6000; /* org = 2000*/

    6569 for (;;) {

    6570 struct ast_frame *f;

    6571 res = ast_waitfor(chan, res);

    6572 if (res <= 0) {

    6573 ast_log(LOG_WARNING, "DTMFCID timed out waiting for ring. "

    6574 "Exiting simple switch/n");

    6575 ast_hangup(chan);

    6576 goto quit;

    6577 }

    6578 f = ast_read(chan);

    6579 if (!f)

    6580 break;

    6581 if (f->frametype == AST_FRAME_DTMF) {

    6582 dtmfbuf[i++] = f->subclass;

    6583 ast_log(LOG_DEBUG, "CID got digit '%c'/n", f->subclass);

    6584 res = 5000; /* org=2000*/

    6585 }

    6586 ast_frfree(f);

    6676

    6677 /* Finished with Caller*ID, now wait for a ring to make sure there really is a call coming */

    6678 res = 6000; /* org = 2000*/

    6679 }

    6680

    6681 for (;;) {

    6682 struct ast_frame *f;

    6683 res = ast_waitfor(chan, res);

    6684 if (res <= 0) {

    6685 ast_log(LOG_WARNING, "CID timed out waiting for ring. "

    6686 "Exiting simple switch/n");

    6687 ast_hangup(chan);

    6688 goto quit;

    6689 }

    6690 if (!(f = ast_read(chan))) {

    6691 ast_log(LOG_WARNING, "Hangup received waiting for ring. Exiting simple switch/n");

    6692 ast_hangup(chan);

    6693 goto quit;

    6694 }

修改这三个参数的值,然后重新编译,一般都可以解决问题。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值