diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-06-23 17:43:31 -0500 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2015-06-26 09:54:02 -0500 |
commit | 028fa546201658ee0c91bc159363e8240ea06067 (patch) | |
tree | 1d9617c8001a36c3e07138f8ddfadb68fbe2d252 /res/res_pjsip.c | |
parent | db0521f905ad6f2624990f8476522c6778c18725 (diff) |
res_pjsip_nat: Rewrite route set when required.
When performing some provider testing, the rewrite_contact option was
interfering with proper construction of a route set when sending an ACK
after receiving a 200 OK response to an INVITE.
The initial INVITE was sent to address sip:foo. The 200 OK had a Contact
header with URI sip:bar. In addition, the 200 OK had Record-Route
headers for sip:baz and sip:foo, in that order. Since the Record-Route
headers had the lr parameter, the result should have been:
* Set R-URI of the ACK to sip:bar.
* Add Route headers for sip:foo and sip:baz, in that order.
However, the rewrite_contact option resulted in our rewriting the
Contact header on the 200 OK to sip:foo. The result was:
* R-URI remained sip:foo.
* We added Route headers for sip:foo and sip:baz, in that order.
The result was that sip:bar was not indicated in the ACK at all, so the
far end never received our ACK. The call eventually dropped.
The intention of rewrite_contact is to rewrite the most immediate
destination of our SIP request to be the same address on which we
received a request or response. In the case of processing a SIP response
with Record-Route headers, this means that instead of rewriting the
Contact header, we should instead rewrite the bottom-most Record-Route
header. In the case of processing a SIP request with Record-Route
headers, this means we rewrite the top-most Record-route header.
Like when we rewrite the Contact header, we also ensure to update
the dialog's route set if it exists.
ASTERISK-25196 #close
Reported by Mark Michelson
Change-Id: I9702157c3603a2d0bd8a8215ac27564d366b666f
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r-- | res/res_pjsip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 27e3f8179..5389087e0 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -302,9 +302,9 @@ <configOption name="rewrite_contact"> <synopsis>Allow Contact header to be rewritten with the source IP address-port</synopsis> <description><para> - On inbound SIP messages from this endpoint, the Contact header will be changed to have the - source IP address and port. This option does not affect outbound messages send to this - endpoint. + On inbound SIP messages from this endpoint, the Contact header or an appropriate Record-Route + header will be changed to have the source IP address and port. This option does not affect + outbound messages sent to this endpoint. </para></description> </configOption> <configOption name="rtp_ipv6" default="no"> |