[Asterisk-Users] Regex howto proof and change a dialed number

Guido Hecken guido.hecken at gwsnettech.de
Tue Mar 22 06:00:24 MST 2005


before inventing the wheel once more, I would like to ask the list

Problem:
the dial command does it's job by

exten => _X.,1,Dial(SIP/${EXTEN}@192.168.161.135,60,tTr)
now, if the given number (extension) is one of these
+49(2244)870663 or +49(02244)870663
the dial command fails, since it cannot handle "("  ")" and "+"

My idea was a regex, I use normaly within perl
perl -p -i -e 's/^\+(\d\d)\((\d*)\)(\d*)/00$2$3/g' number
this would change +49(2244)870663 to 002244870663 in every line of the file,
named number.

But how can I achieve this in asterisk dialplan?
I did some googling and reading in the wiki, but still no glue.
Perhaps with the system command and some perl stuff as above?

Any hints are *really* welcome.

Regards,

and have a nice day outhere

Guido Hecken







More information about the asterisk-users mailing list