Skip to content

Commit

Permalink
b2b_entities: prevent hop-by-hop ACK to change the status of dialog
Browse files Browse the repository at this point in the history
(cherry picked from commit 4fe2fb6)
  • Loading branch information
razvancrainea committed Sep 15, 2023
1 parent cafc043 commit fbac7cc
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions modules/b2b_entities/dlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,10 +1240,30 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam)
}
else
{
if (dlg->uas_tran) {
tmb.t_release_trans(dlg->uas_tran);
tmb.unref_cell(dlg->uas_tran);
dlg->uas_tran = NULL;
ret = tmb.t_check_trans(msg);
switch (ret) {
case 1: /* hop-by-hop ACK */
tm_tran = tmb.t_gett();
/* just grab the transaction and release it */
tmb.t_sett(T_UNDEFINED);
break;
case -2: /* end-to-end ACK */
tm_tran = tmb.t_get_e2eackt();
break;
default:
tm_tran = NULL;
break;
}
/* if we managed to find a coresponding hop-by-hop INVITE transaction
* or it is a valid end-to-end ACK, unlink from the dialog */
if (tm_tran && tm_tran != T_UNDEFINED) {
if (dlg->uas_tran == tm_tran) {
tmb.t_release_trans(dlg->uas_tran);
tmb.unref_cell(dlg->uas_tran);
dlg->uas_tran = NULL;
}
if (ret == 1)
tmb.unref_cell(tm_tran);
}

ret = tmb.t_newtran(msg);
Expand Down

0 comments on commit fbac7cc

Please sign in to comment.