瀏覽代碼

dialog: run both DLGCB_TERMINATED and DLGCB_TERMINATED_CONFIRMED callbacks for local BYE

- only DLGCB_TERMINATED was run, but that resulted in CDRs not being
  stored by acc for that situation
- on a report by Mickael Marrache
Daniel-Constantin Mierla 10 年之前
父節點
當前提交
265dc95aac
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 1 0
      modules/dialog/dlg_handlers.c
  2. 4 1
      modules/dialog/dlg_req_within.c

+ 1 - 0
modules/dialog/dlg_handlers.c

@@ -1405,6 +1405,7 @@ void dlg_ontimeout(struct dlg_tl *tl)
 				dlg_unref(dlg, 1);
 			/* run event route for end of dlg */
 			dlg_run_event_route(dlg, NULL, dlg->state, DLG_STATE_DELETED);
+
 			dlg_unref(dlg, 1);
 			if_update_stat(dlg_enable_stats, expired_dlgs, 1);
 			return;

+ 4 - 1
modules/dialog/dlg_req_within.c

@@ -216,7 +216,7 @@ void bye_reply_cb(struct cell* t, int type, struct tmcb_params* ps){
 			unref++;
 		}
 		/* dialog terminated (BYE) */
-		run_dlg_callbacks( DLGCB_TERMINATED, dlg, ps->req, ps->rpl, DLG_DIR_NONE, 0);
+		run_dlg_callbacks( DLGCB_TERMINATED_CONFIRMED, dlg, ps->req, ps->rpl, DLG_DIR_NONE, 0);
 
 		LM_DBG("first final reply\n");
 		/* derefering the dialog */
@@ -549,6 +549,9 @@ int dlg_bye_all(struct dlg_cell *dlg, str *hdrs)
 	str all_hdrs = { 0, 0 };
 	int ret;
 
+	/* run dialog terminated callbacks */
+	run_dlg_callbacks( DLGCB_TERMINATED, dlg, NULL, NULL, DLG_DIR_NONE, 0);
+
 	if ((build_extra_hdr(dlg, hdrs, &all_hdrs)) != 0)
 	{
 		LM_ERR("failed to build dlg headers\n");