Skip to content

NethVoice: Outbound call fails to fall back when first trunk is disabled #8340

Closed
nethesis/ns8-nethvoice
#1268

Description

@Stell0

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

  1. Create an outbound route with two PJSIP trunks. Put trunk A first and a reachable test trunk B second.
  2. Set Disable Trunk on trunk A, then apply the configuration.
  3. 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 reload preserves the correction.

See also
https://mattermost.nethesis.it/nethesis/pl/9yp6s1zcitr65jpgtyxbk3qy7r

Activity

  1. added this to the NethVoice 1.8 milestone on Nov 19, 2026
  2. added
    nethvoice
    on Nov 19, 2026
  3. added theissue type on Nov 19, 2026
  4. added
    testing
    on Nov 20, 2026
  5. edospadoni commented on Nov 20, 2026

    @edospadoni
    Member

    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/full inside the freepbx container during the calls.

    Test Case 1 - First trunk disabled

    • Disable trunk A (Disable Trunk) and apply: an outbound call matching the route goes out through trunk B and connects
    • The log shows TRUNK: PJSIP DISABLED - falling through to next trunk, then Return() and the Dial on trunk B, no Auto fallthrough
    • No SIP INVITE is sent to trunk A

    Test Case 2 - Regression

    • Both trunks enabled: the call goes out through trunk A
    • Trunk A enabled but failing (unreachable/busy): the call falls back to trunk B as before
    • All trunks of the route disabled: the call reaches the route failure destination or the congestion message
    • The module update completes and FreePBX starts normally (core patch applied at build time)

    Testing release: 1.8.5-testing.53 (nethesis/ns8-nethvoice#1267, nethesis/ns8-nethvoice#1268)

    ghcr.io/nethesis/nethvoice:1.8.5-testing.53
    
    api-cli run update-module --data '{"module_url":"ghcr.io/nethesis/nethvoice:1.8.5-testing.53","instances":["nethvoiceX"],"force":true}'
    
  6. moved this from Todo to Testing in NethVoiceon Nov 20, 2026
  7. removed their assignment
    on Nov 23, 2026
  8. added
    verified
    on Nov 23, 2026
  9. removed
    testing
    on Nov 23, 2026
  10. moved this from Testing to Verified in NethVoiceon Nov 23, 2026
  11. edospadoni commented on Nov 23, 2026

    @edospadoni
    Member

    Release nethesis/ns8-nethvoice 1.8.5

  12. removed
    verified
    on Nov 23, 2026
  13. moved this from Verified to Done in NethVoiceon Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoice

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions