When endpoints register through a proxy in front of Asterisk running PJSIP, the edge proxy adds a PATH header so that Asterisk knows how to route out-of-dialog requests back to the proxy.
When calling that endpoint, it appears though that INVITEs are sent to the Contact URI directly instead of being sent to the proxy with a preset Route header. Strangely, this happens only to INVITEs. Other requests such as the OPTIONS qualify initiated by Asterisk are sent correctly to the proxy with the proper Route header.
I looked into it further. PJSIP has a outbound_proxy parameter for endpoints. When I add it such as: outbound_proxy=sip:proxy.somedomain.net;lr
my phone starts ringing, routing of INVITEs works!
However, Asterisk’s quality OPTIONS and other request methods now have two Route headers, one from the set outbound_proxy and the other from the PATH header.
Why is it that with PJSIP an outbound_proxy needs to be set at all, considering that a Path header has been added during Registration and according to RFC3327 should be used for all type of requests when trying to communicate with the registered Contact?
Because it would be a bug most likely. Please file an issue on the issue tracker[1] with ALL available information. SIP traces, configuration, console output, everything.