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 }

修改這三個參數的值,然後重新編譯,一般都可以解決問題。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章