Skip to content

Commit

Permalink
For topo hiding and fix_route_dialog() usage, do not try do add del l…
Browse files Browse the repository at this point in the history
…umps for already deleted route headers

(cherry picked from commit 5a119db)
  • Loading branch information
vladpaiu committed Mar 12, 2014
1 parent 513abb2 commit 26bdb57
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/dialog/dlg_handlers.c
Expand Up @@ -388,6 +388,7 @@ static inline void push_reply_in_dialog(struct sip_msg *rpl, struct cell* t,
((t->relaied_reply_branch>=0)?
(t->uac[t->relaied_reply_branch].added_rr):0);

LM_DBG("Skipping %d ,%d, %d, %d \n",skip_rrs, dlg->from_rr_nb,t->relaied_reply_branch,t->uac[t->relaied_reply_branch].added_rr);
get_routing_info(rpl, 0, &skip_rrs, &contact, &rr_set);
dlg_update_routing( dlg, leg, &rr_set, &contact );
if( rr_set.s )
Expand Down Expand Up @@ -1525,11 +1526,14 @@ int fix_route_dialog(struct sip_msg *req,struct dlg_cell *dlg)
buf = req->buf;

if (req->route) {
for (it=req->route;it;it=it->sibling)
for (it=req->route;it;it=it->sibling) {
if (it->parsed && ((rr_t*)it->parsed)->deleted)
continue;
if ((lmp = del_lump(req,it->name.s - buf,it->len,HDR_ROUTE_T)) == 0) {
LM_ERR("del_lump failed \n");
return -1;
}
}
}

if ( leg->route_set.len !=0 && leg->route_set.s) {
Expand Down Expand Up @@ -1592,6 +1596,8 @@ int fix_route_dialog(struct sip_msg *req,struct dlg_cell *dlg)

if (req->route) {
for (it=req->route;it;it=it->sibling)
if (it->parsed && ((rr_t*)it->parsed)->deleted)
continue;
if ((lmp = del_lump(req,it->name.s - buf,it->len,HDR_ROUTE_T)) == 0) {
LM_ERR("del_lump failed \n");
return -1;
Expand Down

0 comments on commit 26bdb57

Please sign in to comment.