فهرست منبع

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
Daniel-Constantin Mierla 13 سال پیش
والد
کامیت
84d38ce708
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 2 0
      modules_k/dialog/dialog.c
  2. 2 1
      modules_k/dialog/dlg_handlers.c

+ 2 - 0
modules_k/dialog/dialog.c

@@ -116,6 +116,7 @@ int dlg_enable_stats = 1;
 int active_dlgs_cnt = 0;
 int active_dlgs_cnt = 0;
 int early_dlgs_cnt = 0;
 int early_dlgs_cnt = 0;
 int detect_spirals = 1;
 int detect_spirals = 1;
+int dlg_send_bye = 0;
 stat_var *active_dlgs = 0;
 stat_var *active_dlgs = 0;
 stat_var *processed_dlgs = 0;
 stat_var *processed_dlgs = 0;
 stat_var *expired_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  },
 	{ "bridge_controller",     STR_PARAM, &dlg_bridge_controller.s  },
 	{ "ruri_pvar",             STR_PARAM, &ruri_pvar_param.s        },
 	{ "ruri_pvar",             STR_PARAM, &ruri_pvar_param.s        },
 	{ "initial_cbs_inscript",  INT_PARAM, &initial_cbs_inscript     },
 	{ "initial_cbs_inscript",  INT_PARAM, &initial_cbs_inscript     },
+	{ "send_bye",              INT_PARAM, &dlg_send_bye             },
 	{ 0,0,0 }
 	{ 0,0,0 }
 };
 };
 
 

+ 2 - 1
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 */
 static int       shutdown_done = 0;	/*!< 1 when destroy_dlg_handlers was called */
 extern int       detect_spirals;
 extern int       detect_spirals;
 extern int       initial_cbs_inscript;
 extern int       initial_cbs_inscript;
+extern int       dlg_send_bye;
 int              spiral_detected = -1;
 int              spiral_detected = -1;
 
 
 extern struct rr_binds d_rrb;		/*!< binding to record-routing module */
 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_set_toroute(dlg, &s);
 	dlg->sflags |= _dlg_ctx.flags;
 	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;
 		dlg->dflags |= DLG_FLAG_TOBYE;
 
 
     if (run_initial_cbs)  run_create_callbacks( dlg, req);
     if (run_initial_cbs)  run_create_callbacks( dlg, req);