In fact that is the primary purpose of dial prefix.
If you set one carrier up as dial9 and one as dial8 ... you change the prefix to change the carriers. Just be sure your "EXTEN" variable in the dial line has "EXTEN:1" to remove the dial prefix before sending the call to the carrier (after all, the carrier will not know what to do with a "9" in front of the phone number! LOL).
Samples: (be sure to place each in the appropriate carrier, and be sure to use the appropriate "DIALXTRUNK" variable in each one)
- Code: Select all
exten=>_91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten=>_91NXXNXXXXXX,n,Dial(${DIAL9TRUNK}/${EXTEN:1},,To)
exten=>_91NXXNXXXXXX,n,Hangup
exten=>_81NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten=>_81NXXNXXXXXX,n,Dial(${DIAL8TRUNK}/${EXTEN:1},,To)
exten=>_81NXXNXXXXXX,n,Hangup
exten=>_1NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten=>_1NXXNXXXXXX,n,Dial(${DIAL9TRUNK}/${EXTEN},,To)
exten=>_1NXXNXXXXXX,n,Hangup
exten=>_NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten=>_NXXNXXXXXX,n,Dial(${DIAL8TRUNK}/1${EXTEN},,To)
exten=>_NXXNXXXXXX,n,Hangup
exten=>_0NXXNXXXXXXNXXNXXXXXX,1,Set(CALLERID(num)=${EXTEN:11})
exten=>_0NXXNXXXXXXNXXNXXXXXX,n,AGI(agi://127.0.0.1:4577/call_log)
exten=>_0NXXNXXXXXXNXXNXXXXXX,n,Dial(${DIAL8TRUNK}/1${EXTEN:1:10},,To)
exten=>_0NXXNXXXXXXNXXNXXXXXX,n,Hangup
These do require (obviously) using an appropriate globals string to define the DIALxTRUNK for each carrier.
I'll let you mull over the usage on that last one. It's a personal favorite of mine. LOL Requires X-Lite, though, to get that many digits dialed.