diff --git a/src/modules/p_usrloc/doc/p_usrloc_admin.xml b/src/modules/p_usrloc/doc/p_usrloc_admin.xml
index 37c84bf20b1..0a8ba7be487 100644
--- a/src/modules/p_usrloc/doc/p_usrloc_admin.xml
+++ b/src/modules/p_usrloc/doc/p_usrloc_admin.xml
@@ -779,6 +779,27 @@ modparam("p_usrloc", "UTC_timestamps", 1)
+
+ use_domain_crc32(str)
+
+ Enables or disables the crc32 of domain part for user@domain.
+ If disabled, will calculate crc32 only for user part.
+
+
+
+ Default value is 1
(enabled).
+
+
+
+ Set use_domain_crc32 parameter
+
+...
+modparam("p_usrloc", "use_domain_crc32", "0")
+...
+
+
+
+
diff --git a/src/modules/p_usrloc/p_usrloc_mod.c b/src/modules/p_usrloc/p_usrloc_mod.c
index ac3c34775a7..20d4b13f7fb 100644
--- a/src/modules/p_usrloc/p_usrloc_mod.c
+++ b/src/modules/p_usrloc/p_usrloc_mod.c
@@ -147,6 +147,7 @@ str last_mod_col = str_init(LAST_MOD_COL); /*!< Name of column containing t
str uniq_col = str_init(UNIQ_COL); /*!< Name of column containing the uniq value*/
int db_mode = 3; /*!< Database sync scheme: 1-write through, 2-write back, 3-only db */
int use_domain = 0; /*!< Whether usrloc should use domain part of aor */
+int use_domain_crc32 = 1; /*!< Whether usrloc should use domain part of aor when calculating crc32 */
int desc_time_order = 0; /*!< By default do not enable timestamp ordering */
int ul_fetch_rows = 2000; /*!< number of rows to fetch from result */
@@ -212,6 +213,7 @@ static param_export_t params[] = {
{"cflags_column", PARAM_STR, &cflags_col },
{"db_mode", INT_PARAM, &db_mode },
{"use_domain", INT_PARAM, &use_domain },
+ {"use_domain_crc32", INT_PARAM, &use_domain_crc32 },
{"desc_time_order", INT_PARAM, &desc_time_order },
{"user_agent_column", PARAM_STR, &user_agent_col},
{"received_column", PARAM_STR, &received_col },
diff --git a/src/modules/p_usrloc/p_usrloc_mod.h b/src/modules/p_usrloc/p_usrloc_mod.h
index 800a71851a8..a8b8c74dd98 100644
--- a/src/modules/p_usrloc/p_usrloc_mod.h
+++ b/src/modules/p_usrloc/p_usrloc_mod.h
@@ -88,6 +88,7 @@ extern str uniq_col;
extern int db_mode;
extern int use_domain;
+extern int use_domain_crc32;
extern int desc_time_order;
extern int cseq_delay;
extern int ul_fetch_rows;
diff --git a/src/modules/p_usrloc/ul_db_handle.c b/src/modules/p_usrloc/ul_db_handle.c
index 134dc32e599..4e4eab0848e 100644
--- a/src/modules/p_usrloc/ul_db_handle.c
+++ b/src/modules/p_usrloc/ul_db_handle.c
@@ -461,7 +461,7 @@ static int compute_id(str* first, str* second){
return -1;
}
- if(use_domain){
+ if(use_domain && use_domain_crc32) {
//compute crc32(user@domain)
LM_DBG("XDBGX: compute_id HAS second key : %.*s", first->len, first->s);
if(!second){