Skip to content

Commit

Permalink
dialog: increment last_gen_cseq only if initialized
Browse files Browse the repository at this point in the history
Many thanks to Denys Pozniak (@denyspozniak on GitHub) for reporting and
providing troubleshooting information.

Close #3206

(cherry picked from commit 7bafee1)
  • Loading branch information
razvancrainea committed Sep 26, 2023
1 parent 7d8f1a4 commit 79bbdb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/dialog/dlg_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ static void dlg_update_caller_rpl_contact(struct cell* t, int type,

LM_DBG("Status Code received = [%d]\n", statuscode);

if (statuscode == 401 || statuscode ==407) {
if ((statuscode == 401 || statuscode == 407) && dlg->legs[DLG_CALLER_LEG].last_gen_cseq) {
dlg->legs[DLG_CALLER_LEG].last_gen_cseq++;
LM_DBG("incrementing last_gen_cseq to [%d] for leg[%d]\n", dlg->legs[DLG_CALLER_LEG].last_gen_cseq, DLG_CALLER_LEG);
}
Expand Down Expand Up @@ -1096,6 +1096,11 @@ static void dlg_update_callee_rpl_contact(struct cell* t, int type,

LM_DBG("Status Code received = [%d]\n", statuscode);

if ((statuscode == 401 || statuscode == 407) && dlg->legs[callee_idx(dlg)].last_gen_cseq) {
dlg->legs[callee_idx(dlg)].last_gen_cseq++;
LM_DBG("incrementing last_gen_cseq to [%d] for leg[%d]\n", dlg->legs[callee_idx(dlg)].last_gen_cseq, callee_idx(dlg));
}

if (statuscode >= 200 && statuscode < 300)
dlg_update_contact(dlg, rpl, callee_idx(dlg));
}
Expand Down

0 comments on commit 79bbdb7

Please sign in to comment.