Wrong D-URI for INVITEs with PJSIP and PATH

Hi there,

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.

When using chan_sip this problem does not occur.

Asterisk certified/13.18-cert3
PJ_VERSION : 2.7.2
AOR/support_path : true
Endpoint/rewrite_contact : false
Endpoint/force_rport : false

Thanks.

Not many constructive ideas so far :roll_eyes:

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.

Route: sip:proxy.somedomain.net;lr
Supported: path
Route: sip:proxy.somedomain.net;lr;received=sip:107.xx.xx.xx:59209

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?

Thanks.

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.

[1] https://issues.asterisk.org/jira