Skip to content

Commit

Permalink
dialog: never update ACK cseq with 0 value
Browse files Browse the repository at this point in the history
In case there is no mapping for an ACK, do not update the message with 0

Many thanks to Nick Altmann for reporting this!
  • Loading branch information
razvancrainea committed Sep 13, 2024
1 parent 0b87f1e commit a47c16f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/dialog/dlg_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2333,16 +2333,18 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param)
LM_DBG("dlg_leg_get_cseq(dlg, [%d], req)\n", src_leg);
update_val = dlg_leg_get_cseq(dlg, src_leg, req);
if (update_val == 0) {
LM_DBG("dlg->legs[%d].last_gen_cseq=[%d]\n",
dst_leg, dlg->legs[dst_leg].last_gen_cseq);
update_val = dlg->legs[dst_leg].last_gen_cseq;
if (dlg->legs[dst_leg].last_gen_cseq) {
LM_DBG("dlg->legs[%d].last_gen_cseq=[%d]\n",
dst_leg, dlg->legs[dst_leg].last_gen_cseq);
update_val = dlg->legs[dst_leg].last_gen_cseq;
}
}
else {
LM_DBG("update_val=[%d]\n", update_val);
}
dlg_unlock( d_table, d_entry );

if (update_msg_cseq(req,0,update_val) != 0) {
if (update_val && update_msg_cseq(req,0,update_val) != 0) {
LM_ERR("failed to update ACK msg cseq\n");
}
} else
Expand Down

0 comments on commit a47c16f

Please sign in to comment.