FreePBX – Trunks and Outbound Route tips

I see quite a few people confused about Trunks and Outbound Routes when first starting out with FreePBX as there are similar settings on both. Here’s a quick guide for getting started.

The two things to remember about Trunks and Outbound Routes are –

Trunks РConnection settings for outbound call provider plus settings to MODIFY the dialled number

Outbound Routes – these MATCH and MODIFY a dialled number and send it to the correct trunk

and to explain things a little more –


A trunk is where you put the connection settings for your external call provider. Usually the actual trunk details will include IP address, username and password for the connection.

There are also a few more settings though and this is where the confusion arises.

Dial Rules – These are used to modify the dialled number. Say you want to dial a UK number from your phone in the national UK format – 01604283000, but your call provider expects the number in international format – 441604283000. You can use a dial rule to remove the leading 0 and replace it with 44.

Outbound Dial Prefix – This again is used to modify the dialled number (and you could achieve the same with a Dial Rule). Lets say your call provider has standard and premium routes. For the premium route you need to dial an access number of 444. You could set ‘444’ as the Dial Prefix and this will get added to the front of all dialled numbers, sending the call to the premium route.

Outbound Routes

An Outbound Route is used to tell FreePBX that if an extension dials a particular number, send the call to a specific trunk. It is also possible add and remove digits to the dialled number at this point.

The matching is done using a ‘Dial Pattern’. You can use wildcards such as ‘X’, ‘Z’ and ‘N’ to match ranges of numbers. You can also just match every number dialled using ‘_X.’ so if you just have one trunk all numbers dialled will get sent to that trunk. You do not have to worry about extension numbers or system numbers (such as voicemail access) as FreePBX recognises these and sends the call to the correct place. They will not get matched by the Outbound Route.

12 thoughts on “FreePBX – Trunks and Outbound Route tips

  1. Mike

    How old of a version of FreePBX are you running? All recent versions have the ability to modify numbers at the route level as well as the trunk level. It sounds like someone found that ancient article on routes and trunks in How-To section of the FreePBX site, and decided to use it as the basis of this article. Check the date on your source material next time.

  2. matt Post author

    Ok, good point, Mike is correct and I’ll go up and change the article.

    I should have made it clear that this is how I recommend users that are new to FreePBX get started. I wrote the post as I had 3 customers in one week struggling to get any calls going out of their system, becuase of confusion between matching a number for routing, and modifying a number for dialling.

    I have been been using FreePBX for a long time, so maybe the approach is outdated, but I think easier to understand for new users.

  3. Sherry


    Can you help me on getting a Voip service provider who sells Uk premim routes termination.

    If you can help me ll be great help.




  4. Sherry

    Thanks Matt,

    In todays world – nobody has time to do soemthing for others and you did a searching for me.

    Thanks for teh help.



  5. matt Post author

    No problem. I’ve spoken to the guys there quite a bit and they seem to offer good service, I haven’t used them for termination myself though.

  6. Sherry

    Pls check if possible – we can do lot of traffic whatver codes they offering – we can do Long calls as well.

  7. elmohem


    I installed new Elastix and installed it on vps
    I tried to configure outbound route but not working

    prepend prefix match pattern
    blank 00ZXXXXXXXXX

    in case above will remove 00 and send the calling number to sip trunk

    My sip trunk configured as below
    prepend prefix match pattern
    00001 00 ZXXXXXXXXX

    why not working ???

  8. elmohem


    I installed new Elastix and installed it on vps
    I tried to configure outbound route but not working

    prepend………..prefix………..match pattern

    in case above will remove 00 and send the calling number to sip trunk

    My sip trunk configured as below
    prepend………prefix…………match pattern

    Attention please
    My trunk international call is 00001 not 00 and work correctly when used it with sip client and dial 00001 for international calling.

    why not working ???

Comments are closed.