FreePBX UK Dial Patterns Route Through Specific Trunk

asteriskfreepbxvoip

I've read a ton of links and tutorials and for some reason cannot get my dial patterns to work correctly.
I've got Freepbx installed and working properly – no issue there.

I want to create a dial pattern that identifies a number and routes it trough a specific outbound trunk without the use of a prefix.

So for example, I have 3 outbound routes and 3 different trunks, one for mobiles, one for landlines and one for international calls.

If a number starts with 07 it should go through route 1/trunk1.
If a number starts with 020 it should go through route 2/trunk2.
If a number starts with 001 it should go through route 3/trunk3.

Is this possible?

Best Answer

Yes. Let's presume your outgoing context is called outgoing and your SIP providers are named trunk1, trunk2 and trunk3 and are already properly configured. Your code would look something like this:

[outgoing]
exten => _07XXX.,1,Verbose(2, Call via Trunk 1 Provider for ${EXTEN})
 same => n, Dial(SIP/trunk1/${EXTEN})

exten => _020XXX.,1,Verbose(2, Call via Trunk 2 Provider for ${EXTEN})
 same => n, Dial(SIP/trunk2/${EXTEN})

exten => _001XXX.,1,Verbose(2, Call via Trunk 3 Provider for ${EXTEN})
 same => n, Dial(SIP/trunk3/${EXTEN})

Further Reading:

Related Topic