瀏覽代碼

dialog: proper handling of dlg_set_timeout() for not confirmed dialogs

Daniel-Constantin Mierla 10 年之前
父節點
當前提交
a41eab6bed
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      modules/dialog/dlg_hash.c

+ 8 - 6
modules/dialog/dlg_hash.c

@@ -1076,12 +1076,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;