[asterisk-users] an easy way to deal with/without leading "1" ?

Benny Amorsen benny+usenet at amorsen.dk
Fri Mar 13 02:44:21 CDT 2009


sean darcy <seandarcy2 at gmail.com> writes:

> The regular long distance is set up so users can but don't have to
> dial one. That's pretty easy, just one more exten statement. But it's
> a pain dealing with all the 8xx area codes that are toll free.

We try to "canonicalize" dialled numbers as soon as they enter the
system.

Something like this:

[fromphones]
 exten => _XXXXXXX,1,Goto(canonical,+1555${EXTEN},1)
 exten => _XXXXXXXXXX,1,Goto(canonical,+1${EXTEN},1)
 exten => _00.,1,Goto(canonical,+${EXTEN:2},1)

[canonical]
 exten => _+1800XXXXXXX,1,...
 exten => _+1877XXXXXXX,1,...

We don't actually have any US locations yet, so the above is made up
from scratch without any testing.

Whether to use the + to indicate a number in e164 format is a topic of
some debate.


/Benny




More information about the asterisk-users mailing list