Translate outgoing "+" to "00"

Status
Not open for further replies.

CPav

Member
Dec 13, 2017
75
3
8
46
Hi, I know this is possible but I'm not sure how to get it to do what I want.
I've had a look here www.pbxforums.com/threads/number-translation.143
but not sure how to just do "+" to "00"

My current outgoing dialplan -condition destination_number = (^\d{4,16}$)
Is there a way to incorporate the translation here?
Or add a new line item below my current
action application="translate" data="${+/00} - There is no option for application=translate

Any help much appreciated

Just seen I need to be on v4.3, I'm currently on 4.2.4, so will upgrade first.
 
Last edited:

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
I think you can do something along the lines of:

^\+?(\d{4,16})$
 

CPav

Member
Dec 13, 2017
75
3
8
46
Thanks DD, thats removed the + but hasnt added the 00 in its place..how would I add the 00?
Tx
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Sorry, add that on the bridge before the $1 so for example:

Code:
sofia/gateway/YOURGATEWAY/00$1
 

CPav

Member
Dec 13, 2017
75
3
8
46
Sorry, add that on the bridge before the $1 so for example:

Code:
sofia/gateway/YOURGATEWAY/00$1

Thanks DD, but wont then also add 00 to the front of my locall call too? Or if a customer dials a ligit 0044 wont that then add 000044?
See my attached dialplan. So id add /00$1 to the last line?
 

Attachments

  • 20180531_185215.jpg
    20180531_185215.jpg
    144.6 KB · Views: 45

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Probably but that is a scabby ruleset....

Clients are never going to send +630282 are they??

How do the clients send you the numbers??
 

CPav

Member
Dec 13, 2017
75
3
8
46
I literally just made that the only rule, to basically send any dialled number between 4 and 16 digits to the upstream astpp, customers just dial whatever number they are after, however, on my fusionpbx all incoming international calls show on the history of the yealinks as +44 or whatever country the call came from, problem is that users then hit the call back button and the phone attempts to dial +44..which obviously then doesn't go through. I'm afraid I know very little when it comes to creating or understanding dial rulesets, hence the basic one I have. None the less, is there no easy way for me to achieve an "if" it contains "+" then just remove and replace with "00" or do I have to create differing rulesets?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Just create two rules.I would say make it like for 10+ digits:

^\+(\d{10}*)$
with the 00$1
Make the order so that this comes first then just create subsequent rules as normal.
 

CPav

Member
Dec 13, 2017
75
3
8
46
Thanks DD, I'll give it a go tomorrow, thanks for taking the time!
 

Incubugs

Member
Apr 7, 2018
175
10
18
49
Im pretty sure you coukd just do an outbound route and set the custom digit to + then in the same route tell ot to add 00. This means it will use + as tge dial oht code which it then deletes and adds in the 00. Works on mine i use it for locals as well.
 

CPav

Member
Dec 13, 2017
75
3
8
46
Thank you Incubugs, can you let me know the dial string syntax please? Tx
 
Status
Not open for further replies.