Asterisk管理界面FreePBX关于中继出局主叫CID的设置分析

最近由于工作需要,需要定制一下呼叫中心的不同分机走不同中继出局的CID,于是系统的分析了一下FreePBX出局CID的变化流程,做一下学习笔记!

熟悉asterisk拨号计划的人都知道,影响主叫的dialplan函数是 CALLERID(all) 或者CALLERID(num) ,下面我们结合一下FreePBX的呼出流程,跟踪一下呼叫出局后cid的变化

1)两台asterisk服务器,A服务器192.168.1.69 ,B服务器192.168.1.82 ,建立一条从B服务器到A服务器的SIP中继,中继名为 to69 ,那么B服务器的分机802 可以通过路由(路由匹配前缀69),最终以Dial(SIP/to69/808)的方式拨号到A服务器的分机808了。B服务器的CLI 输出如下:

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [69808@from-internal:1] Macro("SIP/802-0000000d", "user-callerid,SKIPTTL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/802-0000000d", "AMPUSER=802") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/802-0000000d", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/802-0000000d", "1?Set(REALCALLERIDNUM=802)") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/802-0000000d", "AMPUSER=802") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/802-0000000d", "AMPUSERCIDNAME=802") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/802-0000000d", "0?report") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/802-0000000d", "AMPUSERCID=802") in new stack
    -- Executing [s@macro-user-callerid:8] Set("SIP/802-0000000d", "CALLERID(all)="802" <802>") in new stack
    -- Executing [s@macro-user-callerid:9] ExecIf("SIP/802-0000000d", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:10] GotoIf("SIP/802-0000000d", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,19)
    -- Executing [s@macro-user-callerid:19] Set("SIP/802-0000000d", "CALLERID(number)=802") in new stack
    -- Executing [s@macro-user-callerid:20] Set("SIP/802-0000000d", "CALLERID(name)=802") in new stack
    -- Executing [s@macro-user-callerid:21] NoOp("SIP/802-0000000d", "Using CallerID "802" <802>") in new stack
    -- Executing [69808@from-internal:2] NoOp("SIP/802-0000000d", "Calling Out Route: to69") in new stack
    -- Executing [69808@from-internal:3] Set("SIP/802-0000000d", "MOHCLASS=default") in new stack
    -- Executing [69808@from-internal:4] Set("SIP/802-0000000d", "_NODEST=") in new stack
    -- Executing [69808@from-internal:5] Macro("SIP/802-0000000d", "record-enable,802,OUT,") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/802-0000000d", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] ExecIf("SIP/802-0000000d", "0?MacroExit()") in new stack
    -- Executing [s@macro-record-enable:5] GotoIf("SIP/802-0000000d", "0?Group:OUT") in new stack
    -- Goto (macro-record-enable,s,15)
    -- Executing [s@macro-record-enable:15] GotoIf("SIP/802-0000000d", "0?IN") in new stack
    -- Executing [s@macro-record-enable:16] ExecIf("SIP/802-0000000d", "1?MacroExit()") in new stack
    -- Executing [69808@from-internal:6] Macro("SIP/802-0000000d", "dialout-trunk,4,808,") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/802-0000000d", "DIAL_TRUNK=4") in new stack
    -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/802-0000000d", "0?sub-pincheck,s,1") in new stack
    -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/802-0000000d", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:4] Set("SIP/802-0000000d", "DIAL_NUMBER=808") in new stack
    -- Executing [s@macro-dialout-trunk:5] Set("SIP/802-0000000d", "DIAL_TRUNK_OPTIONS=tr") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/802-0000000d", "OUTBOUND_GROUP=OUT_4") in new stack
    -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/802-0000000d", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,9)
    -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/802-0000000d", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:10] Set("SIP/802-0000000d", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [s@macro-dialout-trunk:11] Macro("SIP/802-0000000d", "outbound-callerid,4") in new stack
    -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/802-0000000d", "0?Set(CALLERPRES()=)") in new stack  ##影响CID的宏
    -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/802-0000000d", "0?Set(REALCALLERIDNUM=802)") in new stack
    -- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/802-0000000d", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,6)
    -- Executing [s@macro-outbound-callerid:6] Set("SIP/802-0000000d", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:7] Set("SIP/802-0000000d", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("SIP/802-0000000d", "TRUNKOUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/802-0000000d", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,12)
    -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/802-0000000d", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/802-0000000d", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/802-0000000d", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/802-0000000d", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
    -- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/802-0000000d", "0?sub-flp-4,s,1") in new stack
    -- Executing [s@macro-dialout-trunk:13] Set("SIP/802-0000000d", "OUTNUM=808") in new stack
    -- Executing [s@macro-dialout-trunk:14] Set("SIP/802-0000000d", "custom=SIP/to69") in new stack
    -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/802-0000000d", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))") in new stack
    -- Executing [s@macro-dialout-trunk:16] Macro("SIP/802-0000000d", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/802-0000000d", "") in new stack
    -- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/802-0000000d", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/802-0000000d", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:20] Dial("SIP/802-0000000d", "SIP/to69/808,300,") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/to69/808
    -- SIP/to69-0000000e is ringing
    -- SIP/to69-0000000e is ringing
elastix82*CLI> 
Disconnected from Asterisk server
[root@elastix82 ~]# 
如下:

Asterisk管理界面FreePBX关于中继出局主叫CID的设置分析_第1张图片

中继处改变cid的设置,体现在freepbx的如下地方

Asterisk管理界面FreePBX关于中继出局主叫CID的设置分析_第2张图片

分机出改变cid的设置如下

Asterisk管理界面FreePBX关于中继出局主叫CID的设置分析_第3张图片

你可能感兴趣的:(cid,asterisk,FreePBX,CALLERID)