Module: kamailio
Branch: master
Commit: 9ccc3f510ce2d97dbe1efb690ef1d4e8f18885d5
URL:
https://github.com/kamailio/kamailio/commit/9ccc3f510ce2d97dbe1efb690ef1d4e…
Author: Andrey Utkin <andrey.krieger.utkin(a)gmail.com>
Committer: Andrey Utkin <andrey.krieger.utkin(a)gmail.com>
Date: 2015-07-15T20:29:23Z
dialog: run event_route[dialog:end] in case of dialog termination by interface commands
---
Modified: modules/dialog/dlg_handlers.c
Modified: modules/dialog/dlg_req_within.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9ccc3f510ce2d97dbe1efb690ef1d4e…
Patch:
https://github.com/kamailio/kamailio/commit/9ccc3f510ce2d97dbe1efb690ef1d4e…
---
diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index aae6efb..591e410 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -1404,8 +1404,6 @@ void dlg_ontimeout(struct dlg_tl *tl)
{
if(dlg_bye_all(dlg, NULL)<0)
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);
diff --git a/modules/dialog/dlg_req_within.c b/modules/dialog/dlg_req_within.c
index f862ab2..c40a08d 100644
--- a/modules/dialog/dlg_req_within.c
+++ b/modules/dialog/dlg_req_within.c
@@ -545,6 +545,9 @@ int dlg_bye(struct dlg_cell *dlg, str *hdrs, int side)
}
ret = send_bye(dlg, side, &all_hdrs);
pkg_free(all_hdrs.s);
+
+ dlg_run_event_route(dlg, NULL, dlg->state, DLG_STATE_DELETED);
+
return ret;
}
@@ -566,6 +569,9 @@ int dlg_bye_all(struct dlg_cell *dlg, str *hdrs)
ret |= send_bye(dlg, DLG_CALLEE_LEG, &all_hdrs);
pkg_free(all_hdrs.s);
+
+ dlg_run_event_route(dlg, NULL, dlg->state, DLG_STATE_DELETED);
+
return ret;
}