Trunk Access

Good morning,

I am having trouble understanding how to implement an outbound route via multiple trunk methods but with the same prefix.

Example i have an FXO Gateway that has two POTS lines and one SIP Trunk registered.

I want to be able to have access to all lines round robin or if the pots POTS are busy for it to jump to the SIP trunk on its own using 0 as a prefix for all of them.

The only way i can achieve access is if i change the prefix for the sip trunk to say 9 it will use it an work ok but on its own while 0 stays for the POTS.

Anyway i can use all of them with 0 prefix?

Thanks in advance

Silly question… are you putting both sets of trunks in your outbound route under Trunk Sequence for Matched Routes?

Yes i am but it always seems to dial from the 1st trunk on the matched sequence never skips to the second. As if it can’t understand the difference between POTS and SIP TRUNK?

The normal behavior is that FreePBX will choose the first trunk in the list that is available. For example, for domestic calls, you might list POTS first, if such calls are free but the SIP provider charges per minute.

If the gateway is working correctly, then if all POTS lines are in use, it will return an error which will cause Asterisk to advance to the next trunk and send the call via SIP. If this isn’t working right, see the Maximum Channels option for the gateway trunk.

You might also use Maximum Channels to leave one or more POTS lines available for incoming, when possible.

If you want round-robin behavior, you will need to write a little custom dialplan.

Hi Stewart, nice to hear from you again,

Yes i believe the Max Channels has remedied the problem from my tests, have to make a few more tests and let you know before i mark it solved.

Any chance you can share the Custom Dial Plan for the r-r behaviour nonetheless?

Thank you very much

Sorry, I have not used such code so would not be comfortable posting something untested.

However, I’m curious why you would want to do that. It seems to me that based on the current state (lines in use, time of day, etc.) there is a ‘best’ trunk for the next call, based on cost, caller ID sent, keeping lines ‘open’ for incoming, etc. Your system should choose the best trunk if available, with failover to other choices.

No this is correct as you say it, just for reference and extra knowledge as an example nothing more for
for this current setup

Thank you for your time

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.