Skip to content

NethVoice: Identify non-registering SIP trunks across multiple or changing DNS addresses #8355

Closed
nethesis/ns8-nethvoice
#1294

Description

@Stell0

Steps to reproduce

  1. Configure a PJSIP trunk without registration. Set its SIP server to sip.provider.example and use NethVoice Proxy as its outbound proxy.
  2. Publish two IPv4 addresses for that hostname, 192.0.2.10 and 192.0.2.11, and apply the FreePBX configuration.
  3. Place an inbound call through NethVoice Proxy from each address in a test environment. Compare the X-Forwarded-For value in each SIP INVITE received by Asterisk with the trunk's match_header in /etc/asterisk/pjsip.identify.conf and the loaded identify rule.
  4. Replace one of the DNS records and repeat the call after its DNS time to live (TTL) expires. Then run FreePBX Apply Config and repeat the call.

Expected behavior

Calls from either published address are associated with the same trunk. After a provider DNS change, FreePBX Apply Config (or fwconsole reload) updates the addresses used for inbound identification.

Actual behavior

Kamailio forwards the inbound INVITE with the observed provider source IP in X-Forwarded-For. At Asterisk the packet source is the proxy, so the ordinary PJSIP match rule checks the proxy IP. Asterisk compares the forwarded header against a stored string or regular expression. The NethVoice FreePBX hook calls gethostbyname() during configuration generation and writes one IPv4 result into match_header. A call from a different provider address misses that rule and can be classified as anonymous. Restarting Asterisk with the same generated configuration leaves the same header rule in place. NethVoice generator · Asterisk header matching

The support report showed a forwarded source address missing from the active trunk's identify rule. Copied trunk definitions also produced repeated match_header lines, which complicated diagnosis. Asterisk stores one match_header value per identify object, so repeated lines cannot express a list of alternatives. The module versions and the cause of the reported G.723 offer remain unverified. Asterisk identify field registration

Proposed solution

  • Resolve the configured hostname to all published addresses in the families supported by the SIP path. Deduplicate them and generate one whole-value match_header expression per trunk. For the example above, use X-Forwarded-For: /^(192\.0\.2\.10|192\.0\.2\.11)$/. A literal IP can use an exact value.
  • Keep the rule in the existing NethCTI FreePBX configuration hook. Resolve the SIP server each time FreePBX generates the configuration. Operators can use Apply Config after a provider DNS change.
  • Verify that both addresses select the same endpoint and an unrelated address misses the rule. Replace one record, run Apply Config, and verify that the replacement matches and the retired address misses. Also check an IP-literal trunk and a registered trunk.

Components

NethVoice (FreePBX/PJSIP configuration generation) and NethVoice Proxy. The single-address lookup is present on main.

See also

Activity

  1. added this to the NethVoice 1.8 milestone on Nov 20, 2026
  2. added theissue type on Nov 20, 2026
  3. added
    nethvoice
    on Nov 20, 2026
  4. added
    testing
    on Nov 23, 2026
  5. moved this from Todo to Testing in NethVoiceon Nov 23, 2026
  6. edospadoni commented on Nov 23, 2026

    @edospadoni
    Member
  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