Page 1 of 1

Dialplan to Dial Different Carriers Based on Last Digits of

PostPosted: Mon Jun 03, 2013 12:50 am
by Nefariousparity
Dialplan to Dial Different Carriers Based on Last Digits of phone number.

So every number ending with a 78 would dial carrier (A) every number ending in a 24 would dial carrier (b) and so on and so forth. I saw an article in the forum on the GoAutoDial site somewhere and I can't find it.

Thanks in Advance Chris!

Re: Dialplan to Dial Different Carriers Based on Last Digits

PostPosted: Mon Jun 03, 2013 4:14 pm
by Nefariousparity
I read about this twice somewhere while i was waiting for GOAD 3 to download. Like out of the box load balancing. Someone has to have seen other then me. Or did I really dream this up? :D

Re: Dialplan to Dial Different Carriers Based on Last Digits

PostPosted: Tue Jun 04, 2013 2:19 am
by striker
trunk A
exten => _9XXXXXXXXX78,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9XXXXXXXXX78,2,Dial(${TRUNKA}/${EXTEN:1},,tTor)
exten => _9XXXXXXXXX78,3,Hangup

trunkB
exten => _9XXXXXXXXX24,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9XXXXXXXXX24,2,Dial(${TRUNKB}/${EXTEN:1},,tTor)
exten => _9XXXXXXXXX24,3,Hangup

where 9 is prefix and dialing number will be 11 digits in length

Re: Dialplan to Dial Different Carriers Based on Last Digits

PostPosted: Tue Jun 04, 2013 2:27 pm
by Nefariousparity
Hi Striker, thank you for the support. I only have one other question, what happens when the number does not meet either criteria?

***Edit***

So this is my current settings, and I'm getting invalid extension. I have my campaign setup to dial custom prefix of "9"

{Account Entry}
[TrunkA]
type=peer
host=*****
port=5060
dtmfmode=rfc2833
allow=ulaw
qualify=no
canreinvite=no
context=trunkoutbound

[TrunkB]
type=friend
host=38.102.250.50
port=5060
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=gsm
qualify=yes
canreinvite=no
context=trunkoutbound

{Dialplan}
exten => _9XXXXXXXXX78,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9XXXXXXXXX78,2,Dial(${TrunkA}/${EXTEN:1},,tTor)
exten => _9XXXXXXXXX78,3,Hangup

exten => _9XXXXXXXXX24,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9XXXXXXXXX24,2,Dial(${TrunkB}/${EXTEN:1},,tTor)
exten => _9XXXXXXXXX24,3,Hangup

All in one entry on the carrier page in the web based API.