Skip to content

NethVoice: preserve forwarded-call identity without replacing the upstream loop check #8216

Description

@Stell0

Parent: #7570

Preserve this NethVoice behavior while using the unmodified upstream FreePBX Core module. The upgrade checkout installs Core 17.0.18.54. The old nethesis_nv8 fork is based on Core 16.0.68.40; comparing it with the matching upstream 16 release isolates the Nethesis changes from unrelated upstream updates. The obsolete Flexisip transport change is excluded from this migration.

Problem and original purpose

When an extension forwards a call to an external destination, the fork sets inherited REALCALLERIDNUM to the forwarding extension if the destination is not a PBX user. This supplies that extension's identity to subsequent outbound caller-ID processing; it does not directly set the final presented caller ID. NethVoice later excludes voicemail destinations beginning with vm.

Original change: 77ac604b in nethesis/freepbx-core, with a PHP namespace correction in b8902cfd.

Upstream assessment

Core 17.0.18.54 has no equivalent identity instruction in macro-dial-one,cf. The local nethcti3_get_config_late() currently replaces priority 2. In the fork, that priority held the added identity instruction; in upstream, it holds the forwarding-loop check. The current replacement therefore removes upstream's loop check. This replacement was reproduced with FreePBX's PHP dialplan builder; live call validation remains required.

Implementation plan

  • Change the late NethVoice hook to insert the identity instruction after CFAMPUSER is set, rather than replacing upstream priority 2.
  • Preserve upstream's forwarding-loop check and subsequent forwarding instructions.
  • Explicitly resolve the forwarding destination instead of relying on the implicit DB_RESULT value.
  • Retain the NethVoice exclusion for voicemail destinations and preserve existing trunk caller-ID policies.
  • Guard the insertion against unexpected upstream dialplan changes and verify the generated instruction order.
  • Leave Core source files unchanged.

Acceptance criteria

  • Generated cf dialplan contains both the NethVoice identity instruction and upstream's forwarding-loop check in the intended order.
  • Internal and external callers can be forwarded externally with the expected trunk caller-ID policy.
  • Forwarding to PBX users and CTI voicemail destinations retains the intended behavior.
  • Self-forwarding and forwarding loops do not produce repeated outbound dialing.
  • Blind and attended transfers retain the intended caller identity.
  • Behavior survives repeated reloads, restart and backup/restore with unmodified upstream Core.

References

Affected integration: freepbx/var/www/html/freepbx/admin/modules/nethcti3/functions.inc.php, in nethcti3_get_config_late().

Activity

  1. added
    nethvoiceBug or features releted to the NethVoice project
    on Oct 9, 2026
  2. added theissue type on Oct 9, 2026
  3. Stell0 commented on Oct 9, 2026

    @Stell0
    Author

    Test

    Test Case 1

    • Run forward_identity_test.php: preserve the Core loop check, identity exclusions and fallback Answer/Ringing; reject unexpected layouts.

    Test Case 2

    • Forward a call to a local test destination simulating an external forward and verify REALCALLERIDNUM is the forwarding extension; an internal forward keeps the original caller.
    • Set forwarding to self and to the caller: the called extension rings without a forwarding loop.

    Test Case 3

    • Forward an inbound trunk call to an authorized external test number; verify REALCALLERIDNUM identifies the forwarding extension and the callee receives its configured outbound caller ID.
    • Forward to voicemail; verify REALCALLERIDNUM keeps the original caller identity.

    Completed checks passed on nethvoice58 with pr-1034.1097-1.b734d58: simulated external forward REALCALLERIDNUM=8102, internal REALCALLERIDNUM=8101; both loop cases connected normally.

    Draft PR: nethesis/ns8-nethvoice#1034.

  4. added
    testingPackages are available from testing repositories
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

nethvoiceBug or features releted to the NethVoice projecttestingPackages are available from testing repositories

Projects

  • Status
    Testing

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions