[asterisk-users] Simplifying dial-plan

Jeroen Eeuwes jeroeneeuwes at gmail.com
Wed Dec 22 16:50:50 UTC 2010


Hi Stephen,

> Jeroen, I'm trying to avoid rewriting the outgoing block for the
> patterns mentioned above. I've placed a pseudo dial-plan below. The
> plan needs to dial the 1 and/or also the area code depending on the
> pattern they enter. Any tips, thanks.

I find a diaplan much easier to read if all the lines of the same
"exten => pattern,x,etc" are grouped. The way you showed it now is
very difficult to read.

What you could do is something like this

exten => _NXXNXXXXXX,1,Goto(1${EXTEN},1)
exten => _NXXXXXX,1,Goto(1555${EXTEN},1)

Assuming that you want to dial an 1 if not dialed first and you've got
10 digits or if you only receive 7 digits you want to add both an 1
and "areacode" 555.

Because you've added the extra digits yourself it will match to the
_1NXXNXXXXXX extension and start there at 1.

Best regards,
Jeroen Eeuwes



More information about the asterisk-users mailing list