Skip to content

Commit

Permalink
dialog: proper handling of dlg_set_timeout() for not confirmed dialogs
Browse files Browse the repository at this point in the history
(cherry picked from commit a41eab6)
  • Loading branch information
miconda committed Jan 9, 2015
1 parent 6f73063 commit a01849a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions modules/dialog/dlg_hash.c
Expand Up @@ -1097,12 +1097,14 @@ int dlg_set_toroute(struct dlg_cell *dlg, str *route)

int update_dlg_timeout(dlg_cell_t *dlg, int timeout)
{
if(update_dlg_timer(&dlg->tl, timeout) < 0) {
LM_ERR("failed to update dialog lifetime\n");
dlg_release(dlg);
return -1;
}

if(dlg->state!=DLG_STATE_UNCONFIRMED
&& dlg->state!=DLG_STATE_EARLY) {
if(update_dlg_timer(&dlg->tl, timeout) < 0) {
LM_ERR("failed to update dialog lifetime\n");
dlg_release(dlg);
return -1;
}
}
dlg->lifetime = timeout;
dlg->dflags |= DLG_FLAG_CHANGED;

Expand Down

0 comments on commit a01849a

Please sign in to comment.