[asterisk-commits] res/res pjsip nat: Ignore REGISTER requests when looking for... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 11 16:13:49 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: res/res_pjsip_nat: Ignore REGISTER requests when looking for a Record-Route
......................................................................


res/res_pjsip_nat: Ignore REGISTER requests when looking for a Record-Route

We will only rewrite the Contact header if there is no Record-Route header in
the received request. If a malfunctioning proxy places a Record-Route header
into a REGISTER request, we will decide that we shouldn't update the IP/port
in the Contact header, and we will end up storing a contact with an AoR that
contains the NAT'd IP address.

While it is nice to have the proxy *not* send a Record-Route in a REGISTER
request, it's also a good idea to not process the header in a non-dialog
message. This patch updates the code to explicitly ignore the Record-Route
header in REGISTER requests.

ASTERISK-25387 #close

Change-Id: I4bd3bcccc4003d460cc354d986b0dea2e433ef3f
---
M res/res_pjsip_nat.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/res/res_pjsip_nat.c b/res/res_pjsip_nat.c
index c32b71d..a2eb6ad 100644
--- a/res/res_pjsip_nat.c
+++ b/res/res_pjsip_nat.c
@@ -56,7 +56,7 @@
 				break;
 			}
 		}
-	} else {
+	} else if (pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, &pjsip_register_method)) {
 		rr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_RECORD_ROUTE, NULL);
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/1233
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4bd3bcccc4003d460cc354d986b0dea2e433ef3f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list