[asterisk-users] Rewriting numbers while processing dial plan?

Jan-Aage Frydenbø-Bruvoll jbruvoll at hotmail.com
Fri Feb 6 05:02:30 CST 2009


Hi list,

I am still a newbie and struggling with tweaking the dial plan to my requirements. I have tried googling for this specific problem, and apologies if I have overlooked the obvious answer already. If you could please be so kind as to point me in the right direction, that would be most appreciated.

What I am trying to do, is get rid of the initial "+" in phone numbers coming in from VoIP clients on mobile phones. I have outgoing extensions that choose which of two providers to choose (based on cost for different destinations), and I was hoping not having to have two sets of extension rules - one for the 00 and one for the + variety.

An example of how I'm having to do this now:

[outgoing]

exten => _00.,1,Verbose(International call 00 - Vyke)
exten => _00.,n,Dial(SIP/vyke/$EXTEN,30,tr)                                                                            
exten => _00.,n,Hangup

exten => _+.,1,Verbose(International call + - Vyke)                                                                    
exten => _+.,n,Dial(SIP/vyke/00${EXTEN:1},30,tr)                                                                       
exten => _+.,n,Hangup

I was however hoping that it'd be possible to have a general rule that would match the initial +, rewrite it to 00 and continue with the first of the two patterns shown above.

A banale example (which does not work):

[outgoing]

exten => _+.,1,Goto(outgoing,00${EXTEN:1},1)

exten => _00.,1,Verbose(International call 00 - Vyke)

exten => _00.,n,Dial(SIP/vyke/$EXTEN,30,tr)                                                                            

exten => _00.,n,Hangup


What am I doing wrong here?

Thanks in advance for your kind assistance!

Best regards
Jan

_________________________________________________________________
Twice the fun—Share photos while you chat with Windows Live Messenger. Learn more.
http://www.microsoft.com/uk/windows/windowslive/products/messenger.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090206/1f8e16a9/attachment.htm 


More information about the asterisk-users mailing list