Outbound calls can have "multiple pathways".
In your dialplan entry, you should have a "dial 9 carrier" (which allows "9" in the Dial Prefix field of the campaign, thus allowing "8", "7", etc for other carriers!). But you're not limited to that. You can set up one of the carriers to also accept 1+10 digits, and 10 digits (and add the one for you, cuz the carrier will need it). Thusly:
- Code: Select all
exten =>_91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten =>_91NXXNXXXXXX,n,Dial(${OUTBOUNDTRUNK9}/${EXTEN:1},,tTor)
exten =>_91NXXNXXXXXX,n,Hangup
exten =>_1NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten =>_1NXXNXXXXXX,n,Dial(${OUTBOUNDTRUNK9}/${EXTEN},,tTor)
exten =>_1NXXNXXXXXX,n,Hangup
exten =>_NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten =>_NXXNXXXXXX,n,Dial(${OUTBOUNDTRUNK9}/1${EXTEN},,tTor)
exten =>_NXXNXXXXXX,n,Hangup
Notes round 1:
* ${OUTBOUNDTRUNK9} is a global variable defined in the "Globals String" field. You can skip that if you want and just put in "SIP/Account" replacing "Account" with your SIP context name. Many do. Resulting in "SIP/Account/${EXTEN:1}"
* EXTEN:1 the ":1" removes the first digit. In this case the "9". The carrier doesn't need the 9, it was only used to select the carrier. It's done it's job and can now be discard.
* EXTEN (Without the :1) in the second entry: Because there's no 9, no need to discard one.
* 1${EXTEN} in the third entry: Adds a 1 before the extension being dialed. So "3522690000" becomes "13522690000" which is required by most carriers denoting domestic long distance.
All three of these will actually result in "13522690000" at the chosen carrier, so the carrier will connect the call. But: 913522690000 and 13522690000 and 3522690000 are all acceptable numbers to this system. And you can still use "813522690000" for a different carrier entirely without changing any of this.
Notes round 2:
* Do not duplicate the _1NXXNXXXXXX extension in any other carrier entries. There can never be two carriers with the same dialplan. Same goes for _NXXNXXXXXX.
* If you decide to change your 1+10 and 10 digit dialing to a different carrier, technically all you need to do is change the "SIP/Account" value to the new sip account. But it's a good idea to also move the dialplan lines to the other carrier's entry to avoid confusion.
You should also have an "s" extension to cover "this is not a real number, kill the call".
- Code: Select all
exten=> s,1,AGI(agi://127.0.0.1:4577/call_log)
exten=> s,n,NoOp(No Dial Pattern Matches This Extension)
exten=> s,n,Hangup
We like to put this in its own carrier entry. It only needs to appear once. This avoids "stuck" calls if you enter impossible phone numbers by accident. Those would otherwise lock up the server. EG: If you accidentally load a bunch of "0000000000" numbers from a fake calling list somewhere, or some broken number seep into a real list that only have 9 digits, this will kill those calls and toss a notice in the asterisk CLI instead of what normally happens ... which is that vicidial loses track of the calls because they never appear in the asterisk CLI.