Repository navigation
Description
Steps to reproduce
- Configure a PJSIP trunk without registration. Set its SIP server to
sip.provider.exampleand use NethVoice Proxy as its outbound proxy. - Publish two IPv4 addresses for that hostname,
192.0.2.10and192.0.2.11, and apply the FreePBX configuration. - Place an inbound call through NethVoice Proxy from each address in a test environment. Compare the
X-Forwarded-Forvalue in each SIPINVITEreceived by Asterisk with the trunk'smatch_headerin/etc/asterisk/pjsip.identify.confand the loaded identify rule. - 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_headerexpression per trunk. For the example above, useX-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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edospadoni commentedon Nov 23, 2026
Testing release:
edospadoni commentedon Nov 23, 2026
Release
nethesis/ns8-nethvoice1.8.5