[Home]

Summary:ASTERISK-28502: chan_pjsip incorrectly re-writes REGISTER 200 Response Contact
Reporter:Ross Beer (rossbeer)Labels:pjsip
Date Opened:2019-08-12 11:38:29Date Closed:2019-12-16 10:31:20.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:13.28.0 GIT Frequency of
Occurrence
Constant
Related
Issues:
Environment:Centos 7Attachments:
Description:When rewrite_contact is set on an endpoint Asterisk is rewriting the contact on a 200 response to a REGISTER request.

This causes some clients to fail registration locally as the contact header does not match that of the original request.
Comments:By: Asterisk Team (asteriskteam) 2019-08-12 11:38:30.221-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: George Joseph (gjoseph) 2019-08-13 08:35:21.656-0500

We had a chat about this on IRC #asterisk-dev and we _believe_ that the rewritten contact should only be used for outgoing requests, not responses to incoming requests and that responses should preserve the contact header.   We still need to make sure we send response packets to the incoming request source address.


By: George Joseph (gjoseph) 2019-08-13 08:43:42.805-0500

For reference, here's what we were talking about...
https://tools.ietf.org/html/rfc3261#page-61

??The 200 (OK) response from the registrar contains a list of Contact fields enumerating all current bindings.  The UA compares each contact address to see if it created the contact address, using comparison rules in Section 19.1.4.  If so, it updates the expiration time interval according to the expires parameter or, if absent, the Expires field value.  The UA then issues a REGISTER request for each of its bindings before the expiration interval has elapsed.  It MAY combine several updates into one REGISTER request.??

If we've rewritten the contact and send it back in the response the client may not be able to match it.


By: cmaj (cmaj) 2019-10-14 17:57:30.533-0500

I think this is related to ASTERISK-27131.

By: Friendly Automation (friendly-automation) 2019-12-16 10:31:22.023-0600

Change 12826 merged by Friendly Automation:
res_pjsip_nat: Restore original contact for REGISTER responses

[https://gerrit.asterisk.org/c/asterisk/+/12826|https://gerrit.asterisk.org/c/asterisk/+/12826]

By: Friendly Automation (friendly-automation) 2019-12-16 11:05:51.897-0600

Change 12824 merged by George Joseph:
res_pjsip_nat: Restore original contact for REGISTER responses

[https://gerrit.asterisk.org/c/asterisk/+/12824|https://gerrit.asterisk.org/c/asterisk/+/12824]

By: Friendly Automation (friendly-automation) 2019-12-16 11:06:28.165-0600

Change 12825 merged by George Joseph:
res_pjsip_nat: Restore original contact for REGISTER responses

[https://gerrit.asterisk.org/c/asterisk/+/12825|https://gerrit.asterisk.org/c/asterisk/+/12825]

By: Friendly Automation (friendly-automation) 2019-12-16 11:07:05.376-0600

Change 12827 merged by George Joseph:
res_pjsip_nat: Restore original contact for REGISTER responses

[https://gerrit.asterisk.org/c/asterisk/+/12827|https://gerrit.asterisk.org/c/asterisk/+/12827]