Help changing +45 to 0045 (FreePBX 12.0.10/PIAF)


i hope i can get some help here.

i work in a small company, and a month to month and a half ago my boss want us to change Elastix to PIAF and with this came a new version of FreePBX, i have set up everything from scratch since backup didn’t work, i guess the versions we used before was too old.

Is there a way to change the + infront of the numbers to 00?

i tried using a couple of things in the extensions_custom.conf but either it don’t work or i can’t call in i get the number you have dialed blah blah blah and it just don’t work.

i tried these things today and been battling with this with the companys old phoneserver to bcs our isp here has started to put +45 on to every number they send to their customers in the past two months.

i tried:

exten => _+X!,1,Noop(Stripping + from start of number)
exten => _+X!,n,Goto(from-internal,00${EXTEN:1},1)
exten => _[*0-9]!,1,Goto(from-internal,${EXTEN},1)
exten => h,1,Hangup()

don’t work can’t call in, right now i got this

exten => _X!,1,GotoIf($["${CALLERID(num):0:2}" != “+1”]?noplusatstart)
exten => _X!,n,NoOp(Changing Caller ID number from ${CALLERID(num)} to ${CALLERID(num):1})
exten => _X!,n,Set(CALLERID(num)=${CALLERID(num):1})
exten => _X!,n(noplusatstart),Goto(from-trunk,${EXTEN},1)

it don’t strip off the + it just let calls through, so any one have an idea to how can get this problem solved i would be really really happy…

I want this changed so we can call out from the call logs on the Snom 370’s we are using at the office right now it don’t go through and “IF” it calls out we get something completely different.

There is a context called


in /etc/asterisk/extensions.conf , (appropriately named with -us , so it only works in NANP land) you can use it as a template for your custom context for inbound calls.

Also if i only want this to go for national numbers?

i mean for all numbers showing +45 i want to show 0045?

Numbers from other countrys need to be showed with 00 too not +

i tried this:
exten => +4NXXNXXXXXX/+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _+4NXXNXXXXXX/_NXXNXXXXXX,2,Goto(from-trunk,${EXTEN:2},1)
exten => +4NXXNXXXXXX/+NX.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _+4NXXNXXXXXX/_045NX.,n,Goto(from-trunk,${EXTEN:2},1)
exten => _+4NXXNXXXXXX,1,Goto(from-pstn,${EXTEN:2},1)
exten => [0-9+]./+4NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _[0-9+]./_4NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):1})
exten => _[0-9+]./_NXXNXXXXXX,n,Goto(from-trunk,${EXTEN},1)
exten => [0-9+]./+NX.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _[0-9+]./_045NX.,n,Goto(from-trunk,${EXTEN},1)
exten => [0-9+].,1,Goto(from-trunk,${EXTEN},1)
exten => s/
exten => s/NXXNXXXXXX,n,Goto(from-trunk,${EXTEN},1)
exten => s/
exten => s/_045NX.,n,Goto(from-trunk,${EXTEN},1)
exten => s,1,Goto(from-trunk,${EXTEN},1)

then the master number and direct numbers don’t work.

Sorry, you are just doing it wrong , you just can’t copy and paste blindly, just go and read

for a while, pay attention particularly to the syntax of a context, what X and N (and Z) means, and how to do matches, substring replacement, CallerID(number) and ${EXTEN} and how they all work and the difference between them and then adjust the number and exten manipulation for your particular Danish needs, which I believe is (e164 wise) +45ZXXXXXXX