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.
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.