瀏覽代碼

dialog: remove dialog from profile as soon as gets to terminated state

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

+ 7 - 0
modules/dialog/dlg_hash.c

@@ -984,6 +984,13 @@ void next_state_dlg(dlg_cell_t *dlg, int event,
 	}
 	}
 	*new_state = dlg->state;
 	*new_state = dlg->state;
 
 
+	/* remove the dialog from profiles when is not no longer active */
+	if(*new_state==DLG_STATE_DELETED && dlg->profile_links!=NULL
+				&& *old_state!=*new_state) {
+		destroy_linkers(dlg->profile_links);
+		dlg->profile_links = NULL;
+	}
+
 	dlg_unlock( d_table, d_entry);
 	dlg_unlock( d_table, d_entry);
 
 
 	LM_DBG("dialog %p changed from state %d to "
 	LM_DBG("dialog %p changed from state %d to "