我对 Asterisk 还很陌生,所以这无疑是我的配置错误。
目前,我的测试设置如下:当我向模拟卡上的 FXO 端口拨打来电时,Asterisk 会将呼叫发送到 FXS 端口中的模拟电话,然后电话会响铃。我可以正常接听电话。我还可以从模拟分机拨打电话到软件电话(分机 301),反之亦然。
然而,当我尝试呼叫时,系统会将其作为来电进行路由并响铃模拟分机。
Asterisk 控制台中显示以下日志详细信息:
-- Executing [01026@from-internal:1] Macro("SIP/301-00000005", "user-callerid,LIMIT,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/301-00000005", "AMPUSER=301") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/301-00000005", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/301-00000005", "1?Set(REALCALLERIDNUM=301)") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/301-00000005", "AMPUSER=301") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/301-00000005", "AMPUSERCIDNAME=Douglas Crole") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/301-00000005", "0?report") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/301-00000005", "AMPUSERCID=301") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/301-00000005", "CALLERID(all)="Douglas Crole" <301>") in new stack
-- Executing [s@macro-user-callerid:9] GotoIf("SIP/301-00000005", "0?limit") in new stack
-- Executing [s@macro-user-callerid:10] ExecIf("SIP/301-00000005", "1?Set(GROUP(concurrency_limit)=301)") in new stack
-- Executing [s@macro-user-callerid:11] GotoIf("SIP/301-00000005", "1?continue") in new stack
-- Goto (macro-user-callerid,s,24)
-- Executing [s@macro-user-callerid:24] Set("SIP/301-00000005", "CALLERID(number)=301") in new stack
-- Executing [s@macro-user-callerid:25] Set("SIP/301-00000005", "CALLERID(name)=Douglas Crole") in new stack
-- Executing [s@macro-user-callerid:26] Set("SIP/301-00000005", "CHANNEL(language)=en") in new stack
-- Executing [01026@from-internal:2] Set("SIP/301-00000005", "MOHCLASS=default") in new stack
-- Executing [01026@from-internal:3] Set("SIP/301-00000005", "_NODEST=") in new stack
-- Executing [01026@from-internal:4] Gosub("SIP/301-00000005", "sub-record-check,s,1(out,01026,)") in new stack
-- Executing [s@sub-record-check:1] GotoIf("SIP/301-00000005", "1?check") in new stack
-- Goto (sub-record-check,s,6)
-- Executing [s@sub-record-check:6] Set("SIP/301-00000005", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:7] GotoIf("SIP/301-00000005", "1?next") in new stack
-- Goto (sub-record-check,s,10)
-- Executing [s@sub-record-check:10] ExecIf("SIP/301-00000005", "0?Return()") in new stack
-- Executing [s@sub-record-check:11] GotoIf("SIP/301-00000005", "0?out,1") in new stack
-- Executing [s@sub-record-check:12] Set("SIP/301-00000005", "__REC_STATUS=INITIALIZED") in new stack
-- Executing [s@sub-record-check:13] ExecIf("SIP/301-00000005", "0?Set(__REC_POLICY_MODE=)") in new stack
-- Executing [s@sub-record-check:14] Set("SIP/301-00000005", "NOW=1362573586") in new stack
-- Executing [s@sub-record-check:15] Set("SIP/301-00000005", "__DAY=06") in new stack
-- Executing [s@sub-record-check:16] Set("SIP/301-00000005", "__MONTH=03") in new stack
-- Executing [s@sub-record-check:17] Set("SIP/301-00000005", "__YEAR=2013") in new stack
-- Executing [s@sub-record-check:18] Set("SIP/301-00000005", "__TIMESTR=20130306-143946") in new stack
-- Executing [s@sub-record-check:19] Set("SIP/301-00000005", "__FROMEXTEN=301") in new stack
-- Executing [s@sub-record-check:20] Set("SIP/301-00000005", "__CALLFILENAME=out-01026-301-20130306-143946-1362573586.15") in new stack
-- Executing [s@sub-record-check:21] Goto("SIP/301-00000005", "out,1") in new stack
-- Goto (sub-record-check,out,1)
-- Executing [out@sub-record-check:1] ExecIf("SIP/301-00000005", "1?Set(__REC_POLICY_MODE=dontcare)") in new stack
-- Executing [out@sub-record-check:2] GosubIf("SIP/301-00000005", "0?record,1(exten,01026,301)") in new stack
-- Executing [out@sub-record-check:3] Return("SIP/301-00000005", "") in new stack
-- Executing [01026@from-internal:5] Macro("SIP/301-00000005", "dialout-trunk,1,01026,") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("SIP/301-00000005", "DIAL_TRUNK=1") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/301-00000005", "0?sub-pincheck,s,1()") in new stack
-- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/301-00000005", "0?disabletrunk,1") in new stack
-- Executing [s@macro-dialout-trunk:4] Set("SIP/301-00000005", "DIAL_NUMBER=01026") in new stack
-- Executing [s@macro-dialout-trunk:5] Set("SIP/301-00000005", "DIAL_TRUNK_OPTIONS=tr") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("SIP/301-00000005", "OUTBOUND_GROUP=OUT_1") in new stack
-- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/301-00000005", "0?nomax") in new stack
-- Executing [s@macro-dialout-trunk:8] GotoIf("SIP/301-00000005", "0?chanfull") in new stack
-- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/301-00000005", "0?skipoutcid") in new stack
-- Executing [s@macro-dialout-trunk:10] Set("SIP/301-00000005", "DIAL_TRUNK_OPTIONS=") in new stack
-- Executing [s@macro-dialout-trunk:11] Macro("SIP/301-00000005", "outbound-callerid,1") in new stack
-- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/301-00000005", "0?Set(CALLERPRES()=)") in new stack
-- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/301-00000005", "0?Set(REALCALLERIDNUM=301)") in new stack
-- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/301-00000005", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,6)
-- Executing [s@macro-outbound-callerid:6] Set("SIP/301-00000005", "USEROUTCID=301") in new stack
-- Executing [s@macro-outbound-callerid:7] Set("SIP/301-00000005", "EMERGENCYCID=") in new stack
-- Executing [s@macro-outbound-callerid:8] Set("SIP/301-00000005", "TRUNKOUTCID=<0117047821>") in new stack
-- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/301-00000005", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/301-00000005", "1?Set(CALLERID(all)=<0117047821>)") in new stack
-- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/301-00000005", "1?Set(CALLERID(all)=301)") in new stack
-- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/301-00000005", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/301-00000005", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
-- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/301-00000005", "0?sub-flp-1,s,1()") in new stack
-- Executing [s@macro-dialout-trunk:13] Set("SIP/301-00000005", "OUTNUM=01026") in new stack
-- Executing [s@macro-dialout-trunk:14] Set("SIP/301-00000005", "custom=DAHDI/g1") in new stack
-- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/301-00000005", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))") in new stack
-- Executing [s@macro-dialout-trunk:16] ExecIf("SIP/301-00000005", "0?Set(DIAL_TRUNK_OPTIONS=M(confirm))") in new stack
-- Executing [s@macro-dialout-trunk:17] Macro("SIP/301-00000005", "dialout-trunk-predial-hook,") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/301-00000005", "") in new stack
-- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/301-00000005", "0?bypass,1") in new stack
-- Executing [s@macro-dialout-trunk:19] ExecIf("SIP/301-00000005", "1?Set(CONNECTEDLINE(num,i)=01026)") in new stack
-- Executing [s@macro-dialout-trunk:20] ExecIf("SIP/301-00000005", "1?Set(CONNECTEDLINE(name,i)=CID:301)") in new stack
-- Executing [s@macro-dialout-trunk:21] GotoIf("SIP/301-00000005", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:22] Dial("SIP/301-00000005", "DAHDI/g1/01026,300,") in new stack
-- Called DAHDI/g1/01026
-- DAHDI/1-1 is ringing
-- DAHDI/1-1 is ringing
-- DAHDI/1-1 is ringing
-- Hanging up on 'DAHDI/1-1'
-- Hungup 'DAHDI/1-1'
== Spawn extension (macro-dialout-trunk, s, 22) exited non-zero on 'SIP/301-00000005' in macro 'dialout-trunk'
== Spawn extension (from-internal, 01026, 5) exited non-zero on 'SIP/301-00000005'
-- Executing [h@from-internal:1] Hangup("SIP/301-00000005", "") in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/301-00000005'
我已将所有 FXO 端口分组到单个组 (1),上下文为“from-zaptel”
我已经为端口 5 设置了一个 Zap 通道 DID,DID 为 105(此时通道 5 是唯一一个连接了线路以供测试的通道)
我的 ZAP 中继(名称 = ZAP 通道 g1)使用标识符 g1 并且没有号码操作规则(可能是这样吗?)
我设置了一条呼入路由,其中 DID 和 CallerID 号码为空白(接听所有来电),目的地分机号为 303 - 这是我的模拟电话分机号
我有一个设置为匹配模式 0X 的出站路由。(任何以零为前缀的数字)设置为使用中继 ZAP 通道 g1(组 1 中的所有通道)
我正在使用安装了 FreePBX 的 AsteriskNOW 2.0.2 发行版。
此时我几乎只使用 FreePBX 来进行配置更改(只需按照南非电话设置的建议更改 zapata.conf)。
答案1
好吧,我设法解决了这个问题,但遗憾的是我太着急了,没能确定是哪个特定的设置更改解决了这个问题。我做了以下几件事:
- 更改了拨出拨号规则,使用数字占位符代替通配符
- 删除了 ZAP 通道 DID
- 将 FXO 端口切换至单独的组,而不是将它们全部放在一个组中
- 更改了中继设置,以便为线路使用新的个人组
在此过程中,我让拨出和拨入电话都能正常工作。我希望我能提供更多帮助。