Przeglądaj źródła

modules_k/dialog: Refer to external match mode variable instead of
using local copy.

- Fixes a bug that would render w_dlg_manage()'s
backup-override-and-restore logic of the seq_match_mode variable
for the call to dlg_onroute() useless as the units dialog.c and
dlg_handlers.c maintained individual variables each.

Timo Reimann 14 lat temu
rodzic
commit
b2426b0c20

+ 2 - 2
modules_k/dialog/dialog.c

@@ -85,12 +85,12 @@ static char* rr_param = "did";
 static int dlg_flag = -1;
 static str timeout_spec = {NULL, 0};
 static int default_timeout = 60 * 60 * 12;  /* 12 hours */
-static int seq_match_mode = SEQ_MATCH_STRICT_ID;
 static char* profiles_wv_s = NULL;
 static char* profiles_nv_s = NULL;
 str dlg_extra_hdrs = {NULL,0};
 static int db_fetch_rows = 200;
 
+int seq_match_mode = SEQ_MATCH_STRICT_ID;
 str dlg_bridge_controller = {"sip:[email protected]", 27};
 
 str ruri_pvar_param = {"$ru", 3};
@@ -551,7 +551,7 @@ static int mod_init(void)
 
 	/* init handlers */
 	init_dlg_handlers( rr_param, dlg_flag,
-		timeout_spec.s?&timeout_avp:0, default_timeout, seq_match_mode);
+		timeout_spec.s?&timeout_avp:0, default_timeout);
 
 	/* init timer */
 	if (init_dlg_timer(dlg_ontimeout)!=0) {

+ 2 - 5
modules_k/dialog/dlg_handlers.c

@@ -82,8 +82,8 @@ static str       rr_param;		/*!< record-route parameter for matching */
 static int       dlg_flag;		/*!< flag for dialog tracking */
 static pv_spec_t *timeout_avp;		/*!< AVP for timeout setting */
 static int       default_timeout;	/*!< default dialog timeout */
-static int       seq_match_mode;	/*!< dlg_match mode */ 
 static int       shutdown_done = 0;	/*!< 1 when destroy_dlg_handlers was called */
+extern int       seq_match_mode;	/*!< dlg_match mode */ 
 extern int       detect_spirals;
 
 extern struct rr_binds d_rrb;		/*!< binding to record-routing module */
@@ -113,11 +113,9 @@ static unsigned int CURR_DLG_ID  = 0xffffffff;	/*!< current dialog id */
  * \param dlg_flag_p dialog flag
  * \param timeout_avp_p AVP for timeout setting
  * \param default_timeout_p default timeout
- * \param seq_match_mode_p matching mode
  */
 void init_dlg_handlers(char *rr_param_p, int dlg_flag_p,
-		pv_spec_t *timeout_avp_p ,int default_timeout_p,
-		int seq_match_mode_p)
+		pv_spec_t *timeout_avp_p ,int default_timeout_p)
 {
 	rr_param.s = rr_param_p;
 	rr_param.len = strlen(rr_param.s);
@@ -126,7 +124,6 @@ void init_dlg_handlers(char *rr_param_p, int dlg_flag_p,
 
 	timeout_avp = timeout_avp_p;
 	default_timeout = default_timeout_p;
-	seq_match_mode = seq_match_mode_p;
 }
 
 

+ 1 - 2
modules_k/dialog/dlg_handlers.h

@@ -60,8 +60,7 @@
  * \param seq_match_mode_p matching mode
  */
 void init_dlg_handlers(char *rr_param, int dlg_flag,
-		pv_spec_t *timeout_avp, int default_timeout,
-		int seq_match_mode);
+		pv_spec_t *timeout_avp, int default_timeout);
 
 
 /*!