Outbound route


I have a little call center where i am testing FreePBX - and so fare i have figured every thing out.

My setup is that i have 3 sip trunks that have a ingoing route to its own queue.

Now my challenge is that i want to use the different trunks as outgoing depending on who i want to call.

Trunk one is for private client + international calls (Number 12121212)
Trunk two is for staff only national calls (Number 1313131313)
Trunk three is for public clients + international calls (14141414)

In Denmark we only have 8-digits number and the natinoale code is +45/0045, but some times I need to make a call to a clients that are from Norway, Sweden Germany, Iceland even US numbers

Is there a way to trigger trunk one, two or three…? and how do i make the set up så i kan make international calls

Phone numbers are routed by examining the “most significant digit” iteratively , (first the first then the first two etc.)

will show you the basics, be aware that + is a meta character that means in effect ‘how to dial internationally’, so in europe it means 00 and in NANP land it means 011, national dialing in europe often adds an initial 0 perhaps in your case 1 instead of the + but the link above should be enough to get the outbound dial patterns , for example regexes of ^[34]ZX. is all of europe and ^1NXXNXXNNNN os all of NANP after accounting for both the initil + and the possibly need for a country specific ‘prepend’ (usually 0 in Europe) locally within the country.

There is a context in /etc/asterisk/extensions.conf called [from-pstn-e164-us] that works for NANP land, you will need to a localized [from-pstn-e164-dk] for inbound and a similar approach to outbound routes


i got it a bit to work
Prepend/Prefix/Match patter/CallerID

and then 20 interd of 10 for the second trunk, and 30 tor the third trunk.

so what do i due to make international calls
Do set the parameters like that:

I hope you have discovered that FreePBX/Asterisk is designed with “outbound routes” which uniquely define what is dialled on what “trunk” (trunks are usually provider specific and really have no association with your DID’s, oops DDI’s for you for outbound calling) when the user dials a ‘colloquial’ phone number, it is your job to isolate and so individually route each call, from what you posted and given the info I posted all should work except for you would need to separate “public clients” and “private clients” presumbly by ${EXTEN}, if none of this makes sense to you, I would refer you to the link to the WIKI at the top of this page.

I am not sure that i 100% understand what you mean.

but my ingoing number will olso be the outgoing number that i want to be presented to the caller.

I’m not sure what YOU mean, there is no intrinsic association between an inbound call and an outbound call as Asterisk is a “Back to Back User Agent” every call between two endpoints will have two legs, it is up to you to provide any such association, but generally, the FreePBX/Asterisk inbound/outbound routing will do that , you just need to massage them both to get what you want, basically normalize the inbound calls as to ${CALLERID(num)} and correspondingly do the mirror on your outbound routes. then the world sees e164 and your users see locale specific numbering.