summaryrefslogtreecommitdiff
path: root/res/res_pjsip_nat.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-09-10 08:39:21 -0500
committerMatt Jordan <mjordan@digium.com>2015-09-10 08:43:54 -0500
commitbd71dcd1dab44c864aa9dd87614d09a623a72219 (patch)
treea52ea4b212e62796666ef0ee8441fc7d1a1e7b4d /res/res_pjsip_nat.c
parentbe3f52a1227bf9cd4dbbb2553661ff6ed1d95c9c (diff)
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
Diffstat (limited to 'res/res_pjsip_nat.c')
-rw-r--r--res/res_pjsip_nat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_nat.c b/res/res_pjsip_nat.c
index 483caa2d2..683ae6110 100644
--- a/res/res_pjsip_nat.c
+++ b/res/res_pjsip_nat.c
@@ -56,7 +56,7 @@ static int rewrite_route_set(pjsip_rx_data *rdata, pjsip_dialog *dlg)
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);
}