Hi all,
I’m looking for some clarity on how trunk failover is supposed to behave in FreePBX when the first trunk in an outbound route is marked Disabled.
Scenario
-
Outbound route “Mobile” has a trunk sequence like:
-
Trunk 14 (disabled)
-
Trunk 15 (enabled)
-
Trunk 16 (enabled)
-
etc.
-
-
Route dialplan (
dialplan show outrt-9) is generated with multipleGosub(macro-dialout-trunk...)calls, one per trunk, e.g.:
12. Gosub(macro-dialout-trunk,s,1(14,${EXTEN},,on))
13. Gosub(macro-dialout-trunk,s,1(15,${EXTEN},,on))
14. Gosub(macro-dialout-trunk,s,1(16,${EXTEN},,on))
...
What I expect
If trunk 14 is disabled, I’d expect FreePBX to skip it and continue to trunk 15, then 16, etc.
What I’m seeing
When trunk 14 is disabled, the call enters macro-dialout-trunk, hits the disabled-trunk branch, and the call ends immediately. It does not return to the outbound route dialplan to try trunk 15.
CLI trace when dialling out:
Gosub(macro-dialout-trunk,s,1(14,021666999,,on))
...
GotoIf(... "1?disabletrunk,1")
NoOp("...","TRUNK: PJSIP DISABLED - falling through to next trunk")
-- Auto fallthrough, channel ... status is 'UNKNOWN'
-- Executing [h@macro-dialout-trunk:1] Gosub(...macro-hangupcall...)
Questions
-
Is it expected behaviour that if a trunk is administratively disabled, FreePBX will not continue to subsequent trunks in the route trunk sequence?
-
What is the recommended way to handle maintenance/outage scenarios if you still want failover?
-
Remove disabled trunks from route sequences?
-
Leave trunks enabled and allow them to fail “normally” (CHANUNAVAIL/etc.)?
-
Is there a supported way to override/patch this behaviour?
-
I’m happy to provide version details if needed, but I’m mainly trying to understand what the intended behaviour is here and what the best practice is for failover.
Thanks in advance!