Skip to content

NethVoice: GNR Trunks not recognized and calls arrive as "anonymous #7138

@Amygos

Description

@Amygos

Steps to reproduce

  1. Configure a static, unauthenticated PJSIP/GNR trunk in NethVoice.
  2. Configure the trunk to send traffic through NethVoice Proxy as outbound proxy.
  3. Receive an inbound call from the provider through the proxy.
  4. Check the trunk identification in Asterisk/PBX reports.

Expected behavior

Inbound calls from proxied static GNR trunks are associated with the configured trunk.

When Kamailio forwards an initial inbound INVITE to Asterisk, it must preserve the real provider source IP in the SIP X-Forwarded-For header. NethVoice must then identify eligible proxied PJSIP trunks with a PJSIP match_header rule against that header, so Asterisk matches the provider IP instead of the proxy IP.

Actual behavior

Asterisk receives the inbound INVITE from the proxy address, not directly from the provider address. Without an additional identity hint, IP-based trunk matching sees the proxy/local address and the call is classified as anonymous; PBX reports consequently show the call as anonymous instead of linked to the GNR trunk.

Implemented fix

  • NethVoice Proxy adds X-Forwarded-For: <provider source IP> to initial inbound INVITE requests before forwarding them to Asterisk. The header is added in both the normal inbound routing path and the HANDLE_ALIAS shortcut path, and existing X-Forwarded-For values are removed before inserting the new one.
  • NethVoice creates a PJSIP match_header identify entry for static proxied PJSIP trunks when:
    • registration is disabled (registration = none),
    • authentication is none or outbound,
    • trunk name and SIP server are configured,
    • outbound proxy points to the configured NethVoice Proxy address.
  • If the trunk SIP server is a hostname, NethVoice resolves it to an IP address before creating the X-Forwarded-For match rule.
  • PJSIP identifier order is changed to prefer header matching before IP/username matching, and to evaluate auth_username before anonymous.

Relevant links

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoiceBug or features releted to the NethVoice project

    Type

    No fields configured for Bug.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions