Dialplan Expression: Remove + sign and add a prefix

Status
Not open for further replies.

ndakena

New Member
Nov 26, 2021
14
3
3
31
Hello Team
I am using the provider Voxbeam for my outbound calls. They require me to add a prefix 'xxxxx' for all outgoing calls. The problem is that when I dial numbers with a plus + sign, it doesn't go through, but it works fine when I exclude the + sign.

Is there a way to cost fusionpbx to remove the + sign before adding the prefix 'xxxxx'?
1673197088679.png
Thanks and kind regards
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
The Dialplan Expression is a regular expression (Regex). (https://en.wikipedia.org/wiki/Regular_expression). You need to modify your Dialplan Expression so it will accept a plus sign if it is present. The plus sign has special meaning in Regex so it need to be escaped with a backslash. Also you need to make it optional using the ? sign.

You probably need something like this : ^(\+?\d{12,20})

You can test your Regex at https://regex101.com/
 
Status
Not open for further replies.