Module: sip-router Branch: master Commit: b2426b0c2008809f984073e37a270dcab9a7d8c5 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b2426b0c...
Author: Timo Reimann timo.reimann@1und1.de Committer: Timo Reimann timo.reimann@1und1.de Date: Fri Mar 11 14:55:03 2011 +0100
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.
---
modules_k/dialog/dialog.c | 4 ++-- modules_k/dialog/dlg_handlers.c | 7 ++----- modules_k/dialog/dlg_handlers.h | 3 +-- 3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/modules_k/dialog/dialog.c b/modules_k/dialog/dialog.c index 9d875b7..3d536a1 100644 --- a/modules_k/dialog/dialog.c +++ b/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:controller@kamailio.org", 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) { diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c index 193f16a..d5c4cb9 100644 --- a/modules_k/dialog/dlg_handlers.c +++ b/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; }
diff --git a/modules_k/dialog/dlg_handlers.h b/modules_k/dialog/dlg_handlers.h index 277db0b..bbb9a2a 100644 --- a/modules_k/dialog/dlg_handlers.h +++ b/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);
/*!