Set each different IP up as a separate carrier with a separate dialplan/account entry. After all, your system knows only that they are sip connections, not that they are related in any way. So it is simplest to treat them as each its own carrier.
When you set them up, be sure NOT to use 1NXXNXXXXXX (use 91NXXNXXXXXX and 81NXXNXXXXXX and 71NXXNXXXXXX, but NOT 1NXXNXXXXXX) as the dialplan entry.
Note that you must have a global string variable for each carrier such as DIAL8TRUNK and DIAL7TRUNK (they will be used in the failover!!)
Then create the failover carrier with ONLY this in the Dialplan Entry:
- Code: Select all
exten => a,1,AGI(agi://127.0.0.1:4577/call_log)
exten => a,n,Dial(${DIAL8TRUNK}/${DIALNUMBER},,tTor)
exten => a,n,Dial(${DIAL9TRUNK}/${DIALNUMBER},,tTor)
exten => a,n,Hangup
exten => _011.,1,Set(DIALNUMBER=${EXTEN})
exten => _011.,n,GoTo(a,1)
exten => _011.,n,Hangup
exten => _1NXXNXXXXXX,1,Set(DIALNUMBER=${EXTEN})
exten => _1NXXNXXXXXX,n,GoTo(a,1)
exten => _1NXXNXXXXXX,n,Hangup
exten => _XXXX.,1,Set(DIALNUMBER=${EXTEN})
exten => _XXXX.,n,GoTo(a,1)
exten => _XXXX.,n,Hangup
Then set the campaign to "X" for the dial prefix. Note that you can now send different types of calls to something other than "a" if you use a different carrier for international ...