diff options
author | Matt Jordan <mjordan@digium.com> | 2015-06-29 11:57:00 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-06-29 11:57:00 -0500 |
commit | bfa5d38a1b49670f744cc1dc0bb91a1bca26691e (patch) | |
tree | 91eb7d2f3c70ccae000f3bd39dfc50d73d9973af /res | |
parent | d84247a4815cf03a75bbb27919936c5df58d30ae (diff) | |
parent | 24eec5a10b43c7642ac555b75ed05b054b5e51df (diff) |
Merge "res_pjsip_nat: Adjust when contact should be rewritten." into 13
Diffstat (limited to 'res')
-rw-r--r-- | res/res_pjsip_nat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip_nat.c b/res/res_pjsip_nat.c index e47dd542c..c32b71d76 100644 --- a/res/res_pjsip_nat.c +++ b/res/res_pjsip_nat.c @@ -63,7 +63,7 @@ static int rewrite_route_set(pjsip_rx_data *rdata, pjsip_dialog *dlg) if (rr) { uri = pjsip_uri_get_uri(&rr->name_addr); rewrite_uri(rdata, uri); - if (dlg && dlg->route_set.next && !dlg->route_set_frozen) { + if (dlg && !pj_list_empty(&dlg->route_set) && !dlg->route_set_frozen) { pjsip_routing_hdr *route = dlg->route_set.next; uri = pjsip_uri_get_uri(&route->name_addr); rewrite_uri(rdata, uri); @@ -85,7 +85,7 @@ static int rewrite_contact(pjsip_rx_data *rdata, pjsip_dialog *dlg) rewrite_uri(rdata, uri); - if (dlg && !dlg->route_set_frozen && (!dlg->remote.contact + if (dlg && pj_list_empty(&dlg->route_set) && (!dlg->remote.contact || pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, dlg->remote.contact->uri, contact->uri))) { dlg->remote.contact = (pjsip_contact_hdr*)pjsip_hdr_clone(dlg->pool, contact); dlg->target = dlg->remote.contact->uri; |