Page 1 of 1

Dial plan for prefix's in local area code considered LD

PostPosted: Thu Feb 04, 2016 10:51 am
by Arative
We switched providers and a lot of prefix's in a local area code are considered long distance calls for us now. Am I correcting in assuming that if I put the following in my dialplan that this should work.

exten => _81636486XXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _81636486XXXX,n,Dial(${SIPTRUNK}/${EXTEN:1},,To)
exten => _81636NXXXXXX,n,Hangup()


exten => _81636NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _81636NXXXXXX,n,Dial(${SIPTRUNK}/${EXTEN:2},,To)
exten => _81636NXXXXXX,n,Hangup()

So any number dialed that is 636-486 will only drop the 8 but then any number that doesn't match that particular area code and prefix will drop both the 8 and the 1 before dialing?

Is there a better way to accomplish this or is what I have the best way? I think there are about 35 or so prefixes in the 636 that are considered long distance to us

ViciBox 6.0.4 | | 2.12-538a
BUILD: 160122-1401 |1.8.32.3-vici | Single Server | | No Extra Software After Installation

Re: Dial plan for prefix's in local area code considered LD

PostPosted: Fri Feb 19, 2016 8:40 pm
by MJCoate
You are correct; "EXTEN:N" tells Asterisk to drop N digits, starting from the left, off whatever matched that pattern before sending it through the Dial() application.

To my knowledge, this would be the only way to do what you want. An exception being if some of the prefix's are in sequence (i.e. 486, 487, 488,...). Then you could do something like:
exten => _8163648[6-9]XXXX...