Module: sip-router
Branch: master
Commit: 84d38ce708a0c19344ddca8eec9241207494db37
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=84d38ce…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Feb 15 22:52:05 2012 +0100
dialog(k): new parameter send_bye
- will mark all dialogs for sending bye on timeout, alternative to
$dlg_ctx(...) which can still be used on a per-dialog basis
---
modules_k/dialog/dialog.c | 2 ++
modules_k/dialog/dlg_handlers.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules_k/dialog/dialog.c b/modules_k/dialog/dialog.c
index 25afaa5..d48773f 100644
--- a/modules_k/dialog/dialog.c
+++ b/modules_k/dialog/dialog.c
@@ -116,6 +116,7 @@ int dlg_enable_stats = 1;
int active_dlgs_cnt = 0;
int early_dlgs_cnt = 0;
int detect_spirals = 1;
+int dlg_send_bye = 0;
stat_var *active_dlgs = 0;
stat_var *processed_dlgs = 0;
stat_var *expired_dlgs = 0;
@@ -243,6 +244,7 @@ static param_export_t mod_params[]={
{ "bridge_controller", STR_PARAM, &dlg_bridge_controller.s },
{ "ruri_pvar", STR_PARAM, &ruri_pvar_param.s },
{ "initial_cbs_inscript", INT_PARAM, &initial_cbs_inscript },
+ { "send_bye", INT_PARAM, &dlg_send_bye },
{ 0,0,0 }
};
diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c
index 2a06e34..5a3717b 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -83,6 +83,7 @@ static int seq_match_mode; /*!< dlg_match mode */
static int shutdown_done = 0; /*!< 1 when destroy_dlg_handlers was called */
extern int detect_spirals;
extern int initial_cbs_inscript;
+extern int dlg_send_bye;
int spiral_detected = -1;
extern struct rr_binds d_rrb; /*!< binding to record-routing module */
@@ -819,7 +820,7 @@ int dlg_new_dialog(struct sip_msg *req, struct cell *t, const int
run_initial_cb
dlg_set_toroute(dlg, &s);
dlg->sflags |= _dlg_ctx.flags;
- if (_dlg_ctx.to_bye!=0)
+ if (dlg_send_bye!=0 || _dlg_ctx.to_bye!=0)
dlg->dflags |= DLG_FLAG_TOBYE;
if (run_initial_cbs) run_create_callbacks( dlg, req);