mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
committed by
Joshua Colp
parent
db0521f905
commit
028fa54620
@@ -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">
|
||||
|
Reference in New Issue
Block a user