[asterisk-users] modifying a dialed exension before dialplan processing

Brian J. Murrell brian at interlinx.bc.ca
Sat Nov 17 09:31:35 CST 2007


On Fri, 2007-11-16 at 22:58 -0600, Eric "ManxPower" Wieling wrote:
> exten => _0111NXXNXXXXXX,1,Goto(${EXTEN:4},1)
> 
> exten => _NXXNXXXXXX,1,Dial(....

Of course!  Couldn't be any simpler.  Almost!

User dials 6135551212, phone sends 01116135551212, above rules processes
as:

Goto(6135551212,1)

Fair enough.

User dials 16045551212, phone sends 01116045551212, above rules process
as:

Goto(6045551212,1)

Bzzzt.  "You must dial a 1 before long distance calls".

It's not as easy as just using "613" as a qualifier for LD or not, as
some 613 is local, and some is not.  Certainly, a list of rules such as:

exten => _0111613abcXXXX,1,Goto(${EXTEN:4},1)

Where there is one of those for every "abc" that is a local exchange
followed by:

exten => _0111NXXNXXXXXX,1,Goto(${EXTEN:3},1)

would work, but that seems even more nasty than my original problem.

Indeed, it seems I need to be able to do some sort of lookup into a
database to see if "abc" is a local exchange or not (let's assume that I
can populate a database with local exchanges).

Thots?

b.





More information about the asterisk-users mailing list