Repository navigation
Description
Problem
An outbound route stops on an administratively disabled trunk. This interrupts outbound calling even when a working backup trunk is available, for example when the primary trunk is disabled for maintenance.
Steps to reproduce
- Create an outbound route with two PJSIP trunks. Put trunk A first and a reachable test trunk B second.
- Set Disable Trunk on trunk A, then apply the configuration.
- From a test extension, dial a number that matches the route.
Expected behavior
Asterisk skips trunk A without sending it a SIP INVITE and attempts trunk B. If all trunks are disabled, the route reaches its configured failure destination or plays its default congestion message.
Actual behavior
Asterisk runs the disabled-trunk message and ends the call before attempting trunk B. The following excerpt uses a generic test extension.
Set("PJSIP/201-000000ef", "DIAL_TRUNK=3")
GotoIf("PJSIP/201-000000ef", "1?disabletrunk,1")
NoOp("PJSIP/201-000000ef", "TRUNK: PJSIP DISABLED - falling through to next trunk")
Auto fallthrough, channel 'PJSIP/201-000000ef' status is 'UNKNOWN'
Components and root cause
The NethVoice 1.8.3 FreePBX image contains FreePBX Core 17.0.18.54 and Asterisk 22.10.0. Core generates the trunk attempts as sequential Gosub() calls. Its macro-dialout-trunk subroutine branches to disabletrunk,1 before dialing, but that extension ends at Noop() and never executes Return(). Enabled trunks still go through the dial result and hangup cause handling. FreePBX issue #876
Implementation options
- Add an explicit return in the Core generator and ship it through the existing NethVoice image patch process.
- Add the missing priority through the NethCTI module's late dialplan generation hook. This requires checking that Core generated the extension and that an upstream release still needs the correction.
Acceptance criteria
- Disabled trunks are skipped in route order, including consecutive disabled trunks, with zero outbound SIP INVITEs to them.
- The next enabled trunk is attempted and can complete the call with the expected caller ID.
- An answered call never attempts another trunk. Enabled but unreachable and busy trunks retain their configured failure policy.
- All-disabled routes reach their usual failure handling, and regeneration through Apply Config or
fwconsole reloadpreserves the correction.
See also
https://mattermost.nethesis.it/nethesis/pl/9yp6s1zcitr65jpgtyxbk3qy7r
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edospadoni commentedon Nov 20, 2026
Test
PRs: nethesis/ns8-nethvoice#1268
Setup: an outbound route with two trunks, trunk A first and a working trunk B second. Follow
/var/log/asterisk/fullinside the freepbx container during the calls.Test Case 1 - First trunk disabled
TRUNK: PJSIP DISABLED - falling through to next trunk, thenReturn()and the Dial on trunk B, noAuto fallthroughTest Case 2 - Regression
Testing release: 1.8.5-testing.53 (nethesis/ns8-nethvoice#1267, nethesis/ns8-nethvoice#1268)
edospadoni commentedon Nov 23, 2026
Release
nethesis/ns8-nethvoice1.8.5