假如我们想拨打大陆电话,我们可以有两个途径。第一个经过HGC的PSTN线路(包月),第二个经ET263打出去,但是一分钟要0.07元人民币。
现在如果包月的HGC PSTN不通,直接转到收费ET263拨打。
拨打HGC PSTN的方式为:0086 + <大陆电话>
拨打ET263的方式为:0 + <大陆电话>
怎样启动这个macro呢?就是用prefix 7。拨到模式是70 + <大陆电话>。- [macro-trunkdial-failover]
- exten = s,1,Dial(${ARG1})
- exten = s,n,Gotoif(${LEN(${ARG2})} > 0 ?1-${DIALSTATUS},1:1-out,1)
- exten = 1-CHANUNAVAIL,1,Goto(failover-dial,1)
- exten = 1-CONGESTION,1,Goto(failover-dial,1)
- exten = 1-BUSY,1,Goto(failover-dial,1)
- exten = 1-out,1,Hangup()
- exten = failover-dial,1,Dial(${ARG2})
- [trunk-failover-dial-china]
- exten => _70.,1,Macro(trunkdial-failover,SIP/tw-gw/0086${EXTEN:2},SIP/et263/${EXTEN:1})
- [internal]
- Include => include => trunk-failover-dial-china
- exten => 3001,1,Dial(SIP/3001,,r)
- exten => 3002,1,Dial(SIP/3002,,r)
複製代碼 角色 |