Three inbound routes – each number correctly routes incoming calls to the intended extension
Four extensions configured and working as expected
Issue:
When making outgoing calls, Asterisk always uses the same trunk – specifically, the one listed first in the trunk sequence in the FreePBX GUI.
However, the desired behavior is that each extension should use a specific trunk for outgoing calls. Right now, FreePBX seems to ignore any such mapping.
Goal:
I want to configure FreePBX so that specific extensions use specific trunks for outbound calls. In older versions of FreePBX, this could be done using outbound routes with extension-based caller ID matching.
Expected Behavior:
Extension 1001 → Trunk A
Extension 1002 → Trunk B
Extension 1003 → Trunk C
In FreePBX 17, I can’t find a clear way to set this up.
Question:
Where and how can I configure in FreePBX 17 which trunk should be used by each extension when making outbound calls?
Upgrading FreePBX version should not have broken this functionality.
Confirm that you have three Outbound Routes. One route has 1001 in the CallerID field of all pattern entries, and sends calls to Trunk A. The next route has 1002 in the CallerID field and sends calls to trunk B. The last route can have the CallerID field blank and send calls to Trunk C; then calls from any extension other than 1001 or 1002 will use trunk C.
Thanks for the information. I’ve since found it here, too.
But it doesn’t work as expected. I assign “1001” as the CallerID for the outbound route for Trunk A on all configured dial patterns. I do the same for Trunk B with 1002 and test each outbound call; the top-level outbound route is still used. If I do this for Trunk C and 1003, I always get a “busy” message from Asterisk when making outbound calls.
It’s not quite working yet.
Paste the Asterisk log for a call that chooses the wrong trunk at pastebin.com and post the link here. Call a number that your don’t have to redact such as a local McDonalds.
Also, at the Asterisk command prompt, type dialplan show outbound-allroutes
and post the output. For each outrt-x that appears in the list, type (for example) dialplan show outrt-5
and post the output.
dialplan show outbound-allroutes
[ Context 'outbound-allroutes' created by 'pbx_config' ]
'foo' => 1. Noop(bar) [extensions_additional.conf:2970]
Include => 'outbound-allroutes-custom' [pbx_config]
Include => 'outrt-3' [pbx_config]
Include => 'outrt-1' [pbx_config]
Include => 'outrt-2' [pbx_config]
I proceeded as follows:
I assigned all three outbound routes only the dial patterns “+XXX.” and “XXX.” as well as the respective caller IDs. This is how I worked my way up. Then I discovered that trunk C was causing this strange busy message. Deactivating trunk C and performing a “core restart gracefully” made it work again. I then deleted trunk C and copied trunk A to trunk C with the corresponding number adjustments. That worked. After that, I reinstated my original dial patterns in all outbound routes, plus “+XXX.” and “XXX.” as well as the respective caller IDs. Now it suddenly works.
I still don’t fully understand it, though. Maybe there was just one character wrong in trunk C?
At least it works from the Asterisk client with channel originate Local/89517@from-internal extension 07116929510@from-internal application Playback demo-congrats
or channel originate Local/63112@from-internal extension 07116929510@from-internal application Playback demo-congrats
or channel originate Local/63112@from-internal extension 07116929510@from-internal application Playback demo-congrats
The same applies to the web GUI of my SNOM D365; only the connections selected on the phone itself do not yet reliably transmit the CallerID.