[asterisk-users] Normalizing called numbers

Richard Kenner kenner at gnat.com
Fri May 28 16:19:30 CDT 2010


> I'm working on my dial plan and I'd like to parse all dialed numbers
> to convert them to the format I want.
> For example if someone dials 0112345678 or 0033112345678 I would like
> to convert it to +33112345678 and then match the number to my exten =>
> +33XXXXXXXX statements.

If I understand what transformations you want, it's:

exten => _00X.,1,Goto(+${EXTEN:2},1)
exten => _0[1-9]X.,1,Goto(+33${EXTEN:1},1)

(You really don't need the '[1-9]' since Asterisk will match the most
specific, but it's cleaner to have it.)



More information about the asterisk-users mailing list