Module: kamailio
Branch: master
Commit: 265dc95aac8eb4b5cee7992dde55ff08c92a7ac5
URL:
https://github.com/kamailio/kamailio/commit/265dc95aac8eb4b5cee7992dde55ff0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-04-15T18:04:10+02:00
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
---
Modified: modules/dialog/dlg_handlers.c
Modified: modules/dialog/dlg_req_within.c
---
Diff:
https://github.com/kamailio/kamailio/commit/265dc95aac8eb4b5cee7992dde55ff0…
Patch:
https://github.com/kamailio/kamailio/commit/265dc95aac8eb4b5cee7992dde55ff0…
---
diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index fdfc3c3..ae101e0 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 ae620b4..9473938 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");