From 265dc95aac8eb4b5cee7992dde55ff08c92a7ac5 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Wed, 15 Apr 2015 18:04:10 +0200 Subject: [PATCH] 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 --- modules/dialog/dlg_handlers.c | 1 + modules/dialog/dlg_req_within.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c index fdfc3c31f54..ae101e047ab 100644 --- a/modules/dialog/dlg_handlers.c +++ b/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; diff --git a/modules/dialog/dlg_req_within.c b/modules/dialog/dlg_req_within.c index ae620b44d3a..9473938f1bd 100644 --- a/modules/dialog/dlg_req_within.c +++ b/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");