Jan-Aage Frydenbø-Bruvoll
2009-Feb-06 11:02 UTC
[asterisk-users] Rewriting numbers while processing dial plan?
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
Laurent
2009-Feb-07 00:48 UTC
[asterisk-users] Rewriting numbers while processing dial plan?
Le 06.02.2009 22:02, Jan-Aage Frydenb?-Bruvoll a ?crit :> 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,HangupThis seems to work for me - what makes you say it doesn't ? It does strip the + and add the international prefix. I didn't try to Dial, the translation of the digits being the issue.> What am I doing wrong here?Well... contexts perhaps ? Cheers -- Laurent Steffan Consultant VOIP t?l: +(687) 767 868 mail: laurent at VOIP.nc Web: http://VOIP.nc
Martin Lima
2009-Feb-10 21:59 UTC
[asterisk-users] Rewriting numbers while processing dial plan?
> 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.You dont have to keep two sets. Just rewrite + by 00 and jump to appropriate context/extension. I use this for almost the same, just replacing 00xxxxxx, 011xxxx and 1xxxx by + or +1. [long-distance] exten => _00.,1,Goto(+${EXTEN:2},1) exten => _1NXXNXXXXXX,1,Goto(+${EXTEN},1) exten => _011.,1,Goto(+${EXTEN:3},1) ;USA exten => _+1NXXNXXXXXX,1,Answer() exten => _+1NXXNXXXXXX,n,Macro(enumdial,${EXTEN}) exten => _+1NXXNXXXXXX,n,Set(CALLERID(num)=+18579284409) exten => _+1NXXNXXXXXX,n,Playback(pls-hold-while-try) and so on... Martin> 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