Howto ENUM Trunk and Dialed Number Manipulation Rules in FreePBX 6.12.65-30

Hi Folks, since it took me some time to get it right, and google didnt come up with some helpfull advice or very outdated tutorials i put some infos here:

howto add a ENUM Trunk for outgoing calls (no incomming)


  1. add a trunk (conectivity/trunk) Add trunk
  2. give it a name
  3. ckeck the box for “continue if busy” (this is importand if you wiht to have your pbx try the next trunk instead of ending the call, if the ENUM returns no information of calling the dailed number)
    4.Dialed Number Manipulation Rules
    example is for Germany (0049 / +49) and area code 0711 for Stuttgart
    this will stripp the leading numbers from daild number, as the ENUM expetcs a number like 49711123456789

in the old code way this locked like:
(thanks to chronoton

in the interface do it like this
(49)+0|Z. #this will strip the 0 from long distance Germany calls and add insted cuntry code 49
(49711)+|N. # this will add country code 49 and area code 711 to local calls
()+00|Z. #this will just strip the double 0 for international calls

now submit it and your done with the trunk

then you have to decide if you just want to have a special prefix to dial if you want to use ENUM or if you want any outgoing call to first try to use ENUM and then fall back to others.

i used the second version. for this the number 3 “ckeckbox” from above is very importand.

for this version go to your outgoing routs and on the very end of the adjustments for every outgoing route youll find the “to be used trunk”

her you have to add your ENUM trunk as the first to be used.

then submit and apply settings

now if you call, your free pbx will try to place the call via ENUM. if there is a positiv answer, freepbx will conect directly to the destination using the ENUM data, no telekom, no O2 no vodafone, no sipgate or whatever service provider digital or VoIP your using, is involved, just your pbx, the destinations pbx and your internet conection.

if there is no positiv answer, then (only if you have spezified the no3 checkbox from above in the ENUM trunk setting AND have set a second trunk in the outgoing route your using) you will have a normal conection like before adding ENUM.

On my system i have no noticable additional time for conection build up. at least i do not feel it takes longer. but well, i got a 100Mbit/40Mbit digital line over here and a very powerfull HP ProLiant Server runing the freepbx with almost nothing else to do as just handling a buch of databases vpn and the freepbx, so i cant judge how a raspery pi or similar would do. i just know, my qnap file backup system i just played with in the first time, was not able to handle the freepbx at all, but well, its an atom based board with lots of other stuff to handle.

on several other pages there are recomendations to add a lot of codecs to be allowed. i did not do this, as i already offer a lot: ilbc, g722, g711-alaw, g729, gsm, g726, g711-ulaw (in this priorisation)

youll find this in “settings/asterist sip settings”

now its time for testing, herer are some ENUM numbers, you could only get with working ENUM

if you could use some info from here, feel free to say thanks :slight_smile:

sugestions and recomendations are also welcome, as i not have figured out jet, how to have incoming ENUM calls in a safe way, as i do not like acepting “anonymus” SIP calls.

so long


anyway, if you want to resort your codecs not just the template for the new trunks and ext., remove all exept the first, then submit and apply config. then add one by one codec in your order for every codec submit and apply config. so you get the new order to all trunks and ext.

also you have to do it manualy in the outgoing sip trunks if you have there spezified like disallow=all and so on.