Browse Source

usrloc: renamed global var matching_mode to ul_matching_mode

- avoid exports conflict with the other usrloc alternative modules
Daniel-Constantin Mierla 7 năm trước cách đây
mục cha
commit
4c9bcb4cce

+ 4 - 4
src/modules/usrloc/ucontact.c

@@ -739,7 +739,7 @@ int db_update_ucontact_addr(ucontact_t* _c)
 	LM_DBG("contact:%.*s\n", vals1[n1].val.str_val.len, vals1[n1].val.str_val.s);
 	n1++;
 
-	switch (matching_mode) {
+	switch (ul_matching_mode) {
 		case CONTACT_ONLY:
 			/* update call-id */
 			keys2[nr_cols2] = &callid_col;
@@ -796,7 +796,7 @@ int db_update_ucontact_addr(ucontact_t* _c)
 			nr_cols2++;
 			break;
 		default:
-			LM_CRIT("unknown matching_mode %d\n", matching_mode);
+			LM_CRIT("unknown matching_mode %d\n", ul_matching_mode);
 			return -1;
 	}
 
@@ -1464,7 +1464,7 @@ int db_delete_ucontact_addr(ucontact_t* _c)
 	vals[n].val.str_val = _c->c;
 	n++;
 
-	switch (matching_mode) {
+	switch (ul_matching_mode) {
 		case CONTACT_ONLY:
 			break;
 		case CONTACT_CALLID:
@@ -1486,7 +1486,7 @@ int db_delete_ucontact_addr(ucontact_t* _c)
 			n++;
 			break;
 		default:
-			LM_CRIT("unknown matching_mode %d\n", matching_mode);
+			LM_CRIT("unknown matching_mode %d\n", ul_matching_mode);
 			return -1;
 	}
 

+ 3 - 3
src/modules/usrloc/urecord.c

@@ -42,7 +42,7 @@
 #include "usrloc.h"
 
 /*! contact matching mode */
-int matching_mode = CONTACT_ONLY;
+int ul_matching_mode = CONTACT_ONLY;
 /*! retransmission detection interval in seconds */
 int cseq_delay = 20;
 
@@ -772,7 +772,7 @@ int get_ucontact(urecord_t* _r, str* _c, str* _callid, str* _path, int _cseq,
 	no_callid = 0;
 	*_co = 0;
 
-	switch (matching_mode) {
+	switch (ul_matching_mode) {
 		case CONTACT_ONLY:
 			ptr = contact_match( _r->contacts, _c);
 			break;
@@ -787,7 +787,7 @@ int get_ucontact(urecord_t* _r, str* _c, str* _callid, str* _path, int _cseq,
 			ptr = contact_match_callidonly( _r->contacts, _callid);
 			break;
 		default:
-			LM_CRIT("unknown matching_mode %d\n", matching_mode);
+			LM_CRIT("unknown matching_mode %d\n", ul_matching_mode);
 			return -1;
 	}
 

+ 3 - 3
src/modules/usrloc/usrloc_mod.c

@@ -220,7 +220,7 @@ static param_export_t params[] = {
 	{"connection_id_column",PARAM_STR, &con_id_col    },
 	{"keepalive_column",    PARAM_STR, &keepalive_col },
 	{"partition_column",    PARAM_STR, &partition_col },
-	{"matching_mode",       INT_PARAM, &matching_mode   },
+	{"matching_mode",       INT_PARAM, &ul_matching_mode },
 	{"cseq_delay",          INT_PARAM, &cseq_delay      },
 	{"fetch_rows",          INT_PARAM, &ul_fetch_rows   },
 	{"hash_size",           INT_PARAM, &ul_hash_size    },
@@ -308,14 +308,14 @@ static int mod_init(void)
 		ul_hash_size = 1<<ul_hash_size;
 
 	/* check matching mode */
-	switch (matching_mode) {
+	switch (ul_matching_mode) {
 		case CONTACT_ONLY:
 		case CONTACT_CALLID:
 		case CONTACT_PATH:
 		case CONTACT_CALLID_ONLY:
 			break;
 		default:
-			LM_ERR("invalid matching mode %d\n", matching_mode);
+			LM_ERR("invalid matching mode %d\n", ul_matching_mode);
 	}
 
 	/* Register cache timer */

+ 1 - 1
src/modules/usrloc/usrloc_mod.h

@@ -111,7 +111,7 @@ extern unsigned int ul_db_srvid;
 #define CONTACT_PATH         (2)
 #define CONTACT_CALLID_ONLY  (3)
 
-extern int matching_mode;
+extern int ul_matching_mode;
 
 extern int ul_db_ops_ruid;