On Tuesday 03 April 2007 9:48 am, Julian Sulatycki wrote:
>  The idea is to have asterisk use the PSTN for local calls and voip
> lines for long distance. The trouble being that a 905 call will either
> be local to Mississauga or long distance to Hamilton (for example). So
> is there any way to tell if a call will be long distance before making
> the call?

519's got the same problem.

The solution is to make your dialplan smarter.  I use localcallingguide.com 
for this.

For example, I put in 519 for the NPA and 291 for the NXX and get back that 
519-291 is handled by the LTWLON01RS0 switch which is the Listowel, ON rate 
centre.  Clicking on that gives me this:

Outbound calling from Listowel, ON
NPA;NXX;Rate Centre;Region;Plan Type;Call Type;Monthly Limit;Note;Effective
226;622;Listowel;ON;;;;;
519;291;Listowel;ON;;;;;
519;292;Listowel;ON;;;;;
519;418;Listowel;ON;;;;;
519;444;Listowel;ON;;;;;
519;492;Listowel;ON;;;;;
519;815;Listowel;ON;;;;;
226;338;Kitchener-Waterloo;ON;;;;;
226;747;Kitchener-Waterloo;ON;;;;;
519;206;St Jacobs;ON;;;;;
519;208;Kitchener-Waterloo;ON;;;;;
519;279;Kitchener-Waterloo;ON;;;;;
519;335;Gorrie;ON;;;;;
519;340;Kitchener-Waterloo;ON;;;;;
519;342;Kitchener-Waterloo;ON;;;;;
519;343;Palmerston;ON;;;;;
519;356;Atwood;ON;;;;;

... snipped ...


Which is every 519-NXX that I can call locally from Listowel, Ontario.  With 
some text processing magic, I turned that into this:

; Local seven-digit dialing accessed through trunk interface
[trunklocal7]
exten => _291XXXX,1,Macro(pri-dial,519${EXTEN})                 ; Listowel
exten => _292XXXX,1,Macro(pri-dial,519${EXTEN})                 ; Listowel
exten => _492XXXX,1,Macro(pri-dial,519${EXTEN})                 ; Listowel
exten => _356XXXX,1,Macro(pri-dial,519${EXTEN})                 ; Atwood
exten => _335XXXX,1,Macro(pri-dial,519${EXTEN})                 ; Gorrie
exten => _340XXXX,1,Macro(pri-dial,519${EXTEN})                 ; 
Kitchener-Waterloo
exten => _342XXXX,1,Macro(pri-dial,519${EXTEN})                 ; 
Kitchener-Waterloo
exten => _404XXXX,1,Macro(pri-dial,519${EXTEN})                 ; 
Kitchener-Waterloo
exten => _465XXXX,1,Macro(pri-dial,519${EXTEN})                 ; 
Kitchener-Waterloo

... snipped...

And then added a [trunklocal10] which was pretty much identical, but did not 
insert the 519 for me.

Now in my dialplan I have [local] which is

[local]
include => trunklocal7
include => trunklocal10

Instead of a generic
exten => _519NXXXXXX,1,...

Any 519 number that does NOT match in [trunklocal7] or [trunklocal10] ends up 
matching my generic long distance _NXXNXXXXXX and goes out through my VOIP 
provider.

So, to recap:
1) look up your rate center
2) convert it into a specific dialing context
3) use that for your local calling instead of a generic _905NXXXXXX
4) anything that doesn't match your specific context will match your generic 
LD extensions.

The magic is all in the dialplan.  Make them modular, use contexts to break 
things up logically, and then use "grouping" contexts to make it all make 
sense.

(I did this for Unlimitel back when I wasn't using them for off-net LD, 416 
winds up being a HUGE context.  :-))

-A.

Reply via email to