本帖最後由 角色 於 2013-1-1 13:24 編輯
Steps of supdial for Asterisk-GUI of multi-outbound trunks
Creation of oubound trunk
1. Create the outbound trunk as usual as defined in users.conf. Please note the trunk_n with respect to the physical SIP/IAX trunk in users.conf, for example trunk_1 for HGC1 and trunk_2 for HGC2
Each trunk has to be individually tested and confirmed okay. Please observe the diallping plan including digit manipulation.
Creation of the macro superdial using File Editor command
2. Use a File Editor to edit the file "extensions.conf". (The File Editor could be displayed when we select "Show Advanced Options" at the rightmost menu by [Options]->[Advanced Options]
2.1 Add a new context name=macro-superdial and include the following script in the context- ;exten => s,1,Macro(superdial,IAX2/voipjet/${tfnumber},,,,voip,${MAXVOIPCALLS},yourname,8005551234,voipjet)
- ;exten => s,2,Macro(superdial,IAX2/alpeh-com/${tfnumber},,,,voip,${MAXVOIPCALLS},yourname,8005551234,aleph)
- ;exten => s,1,Wait(2)
- ;exten => s,2,Macro(superdial,${PHONE1},15,Ttm,,pstn,${MAXPSTNCALLS},${CALLERIDNAME},${CALLERIDNUM},pstn,u${GENERALVM})
- ;exten => s,3,Macro(superdial,${PHONE1},15,Ttm,,pstn,${MAXPSTNCALLS},${CALLERIDNAME},${CALLERIDNUM},pstn,u${GENERALVM})
- ;exten => s,4,Voicemail(b${GENERALVM})
- exten => s,1,Set(GROUP()=${ARG5})
- exten => s,2,Set(GROUPCOUNT=${GROUP_COUNT(${ARG5})})
- exten => s,3,GotoIf($[${GROUPCOUNT} > ${ARG6}]?104)
- exten => s,4,GotoIf($["${ARG7}" = ""]?macro-superdial,s,6)
- exten => s,5,Set(CALLERID(name)=${ARG7}) ; skip this if ARG7 is empty
- exten => s,6,GotoIf($["${ARG8}" = ""]?macro-superdial,s,8)
- exten => s,7,Set(CALLERID(number)=${ARG8}) ; skip this if ARG8 is empty
- exten => s,8,GotoIf($["${ARG9}" = ""]?macro-superdial,s,10)
- exten => s,9,SetAccount(${ARG9}) ; skip this if ARG9 is empty
- exten => s,10,Dial(${ARG1},${ARG2},${ARG3},${ARG4})
- exten => s,11,Goto(s-${DIALSTATUS},1)
- exten => s,104,Goto(s-CHANUNAVAIL,1)
- exten => s-BUSY,1,Noop
- exten => s-NOANSWER,1,GotoIf($["${ARG10}" = ""]?macro-superdial,s-NOANSWER,3)
- exten => s-NOANSWER,2,Voicemail(${ARG10})
- exten => s-NOANSWER,3,Noop
- exten => _s-.,1,Noop
複製代碼 Create a single outbound dialling rule using ordinary method
Comment out all the lines by semicolons and add the following lines- [CallingRule_hk_pstn]
- exten = _9.,1,Macro(superdial,SIP/trunk_1/${EXTEN:1})
- exten = _9.,2,Macro(superdial,SIP/trunk_2/${EXTEN:1})
複製代碼 |