Skip to content

Commit

Permalink
Only update the dialog timeout in case we are in established state - …
Browse files Browse the repository at this point in the history
…otherwise it might lead to multiple unrefs related to multiple removal from timer list

(cherry picked from commit e515134)
  • Loading branch information
vladpaiu authored and razvancrainea committed Nov 24, 2014
1 parent 5772e25 commit 1309063
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/dialog/dialog.c
Expand Up @@ -1646,16 +1646,18 @@ int pv_set_dlg_timeout(struct sip_msg *msg, pv_param_t *param,
return -1;
}
if ((dlg = get_current_dialog()) != NULL) {

dlg_lock_dlg(dlg);
dlg->lifetime = timeout;
/* update now only if realtime and the dialog is confirmed */
if (dlg->state >= DLG_STATE_CONFIRMED && dlg_db_mode == DB_MODE_REALTIME)
db_update = 1;
else
dlg->flags |= DLG_FLAG_CHANGED;
if (dlg->state >= DLG_STATE_CONFIRMED_NA)

if (dlg->state == DLG_STATE_CONFIRMED_NA ||
dlg->state == DLG_STATE_CONFIRMED)
timer_update = 1;

dlg_unlock_dlg(dlg);

if (db_update)
Expand Down

0 comments on commit 1309063

Please sign in to comment.