Formatting Dialplan with dial-9 first

Status
Not open for further replies.

hailthemelody

Member
Dec 9, 2017
53
5
8
Hi all,

Any idea how to remove the 9 from from a dial-9-then-x-digits so that it's properly formatted in the E.164 format? Effectively it'd be using $1 but dropping the first character, so 9 in this case. Guessing it's a regex replace command, but want to use the proper solution in the proper place/s.

Should it be used anywhere $1 is referenced in the dialplan, such as callee_id_number and sofia/gateway/GATEWAYNAME? Or is it set within in the dialplan and then referenced?

Thank you.
 

hailthemelody

Member
Dec 9, 2017
53
5
8
Thanks @DigitalDaz !
Took me a minute where to adjust the bracket in the rule. This is what worked for me, in case anybody else is looking

Before
condition destination_number ^(9.*)$

After
condition destination_number ^9(.*)$

In the case of international calls from North America, which I needed to to for termination on Twilio, the change was:

Before
condition destination_number ^(011\d{9,17})$

After
condition destination_number ^011(\d{9,17})$
 
Status
Not open for further replies.