-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: No Feedback
-
Affects Version/s: 14.0.28.16
-
Fix Version/s: None
-
Component/s: Core - Trunks/Routing
-
Labels:None
-
Asterisk Version:16
-
Distro:Other
For background please see https://community.freepbx.org/t/pjsip-fails-when-extension-and-trunk-s-are-both-at-same-local-ip-address-as-from-obihai-device/62676
This was observed in FreePBX 14. The problem is that when you create a trunk (but NOT when you create an extension), it always creates an entry in pjsip_identify.conf that looks like this:
[trunk_name]
type=identify
endpoint=trunk_name
match=sip_server_from_pjsip_settings
The problem is that it appears this is causing incoming traffic from the "sip server" address (particularly an address on the same local network) to match to a trunk even if you also have an extension coming from that same IP address. Thus if you are using a VoIP adapter to service an extension but also to act as a gateway to other services, the above generated context appears to keep the extension from working because you can't specify that the trunk should match on Auth Username or Username rather than IP address. It seems to me that there should either be a way to prevent generation of this context altogether, or to specify what it is supposed to match on, or to follow the settings in the Endpoint Identifier Order specified in the Chan PJSIP Settings and/or trunk-specific "Match Inbound Authentication" setting. But it should not default to matching on the server address because in some corner cases this will result in incorrect detection of an extension vs. a trunk, when both are on the same IP address.
Note that Chan_SIP handles this same situation just fine; it is only PJSIP that appears to have this issue.
As a side note, would it be possible to have better documentation for the pjsip_identify.conf settings (showing how to match on something other than an address) and also the use of the pjsip_identify_custom.conf and pjsip_identify_custom_override.conf files?