Rule for Changing +49241 to 0241 and/or +49 to 0

Hello,

the usual way to store phone numbers in a mobile phone is +nationalprefix-nbr.
How can I change the +49 to 0 (and/or +XX to 00XX) ?
Problem: + is already a parsing special char of FeePBX… I tried several different patterns, but it did not work :frowning:

Regards,
Rupert

unfortunately the dialpattern manipulation code for trunks currently does not handle the ‘+’ numbers as it was not a good decision when originally implemented to use the + character and there is no way to escape it. You could try the following since the outbound routes code does handle the +, as this might get what you need:

In an outbound route

+|1NXXNXXXXXX
+|NX.

Then in the trunk that handles this route:

1NXXNXXXXXX
00+NX.

This would allow any 2 digit country code (all of which are 20 - 99) to be converted. However, this does not address 3 digit country codes. You can extended this concept with the right patterns to handle other country codes.

I believe this will work but have not tried it, assuming that asterisk is happy with the + in its extensions and can handle code that looks like:

exten => _+NX.,n,Macro(dialout-trunk,11,${EXTEN:1},,)

I will try this. The Problem is not so open, cause I only allow some special countries :slight_smile:

Comment later abt success or …

You could always use an AGI script …