diff --git a/src/modules/ims_usrloc_scscf/doc/ims_usrloc_scscf_admin.xml b/src/modules/ims_usrloc_scscf/doc/ims_usrloc_scscf_admin.xml
index 8f9bc6b2a48..7d8ca0b0bf9 100644
--- a/src/modules/ims_usrloc_scscf/doc/ims_usrloc_scscf_admin.xml
+++ b/src/modules/ims_usrloc_scscf/doc/ims_usrloc_scscf_admin.xml
@@ -318,6 +318,30 @@
+
+
+ realm (string)
+
+ Default value is NULL
+
+ Set realm parameter
+
+ modparam("ims_usrloc_scscf", "realm", "kamailio-ims.org")
+
+
+
+
+
+ skip_realm (int)
+ Skipping defined network name in the realm for NOTIFY's Message body reginfo tag.
+ Default value is 0
+
+ Set skip_realm parameter
+
+ modparam("ims_usrloc_scscf", "skip_realm", 1)
+
+
+
diff --git a/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c b/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c
index a320cb5b4cb..0b01fdc4371 100644
--- a/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c
+++ b/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c
@@ -125,6 +125,9 @@ shtable_t sub_dialog_table;
int contact_delete_delay = 30; //If contact is put into delay delete state this is how long we delay before deleting
+char* cscf_realm = 0;
+int skip_cscf_realm = 0;
+
new_shtable_t pres_new_shtable;
insert_shtable_t pres_insert_shtable;
search_shtable_t pres_search_shtable;
@@ -170,6 +173,8 @@ static param_export_t params[] = {
{"db_mode", INT_PARAM, &db_mode},
{"db_url", PARAM_STR, &db_url},
{"timer_procs", INT_PARAM, &ul_timer_procs},
+ {"realm", PARAM_STRING, &cscf_realm},
+ {"skip_realm", INT_PARAM, &skip_cscf_realm},
{0, 0, 0}
};
diff --git a/src/modules/ims_usrloc_scscf/udomain.c b/src/modules/ims_usrloc_scscf/udomain.c
index 3d54fe6d3c3..1f2ffadbbee 100644
--- a/src/modules/ims_usrloc_scscf/udomain.c
+++ b/src/modules/ims_usrloc_scscf/udomain.c
@@ -79,6 +79,9 @@ extern int subs_hash_size;
extern int contact_delete_delay;
+extern char* cscf_realm;
+extern int skip_cscf_realm;
+
/*!
* \brief Create a new domain structure
* \param _n is pointer to str representing name of the domain, the string is
@@ -706,6 +709,7 @@ int get_impus_from_subscription_as_string(udomain_t* _d, impurecord_t* impu_rec,
ims_public_identity* impi;
int bytes_needed = 0;
int len = 0;
+ char* p = NULL;
LM_DBG("getting IMPU subscription set\n");
@@ -723,18 +727,30 @@ int get_impus_from_subscription_as_string(udomain_t* _d, impurecord_t* impu_rec,
for (i = 0; i < impu_rec->s->service_profiles_cnt; i++) {
for (j = 0; j < impu_rec->s->service_profiles[i].public_identities_cnt; j++) {
impi = &(impu_rec->s->service_profiles[i].public_identities[j]);
- LM_DBG("Got Record %.*s (%i)\n", impi->public_identity.len,
- impi->public_identity.s, impi->public_identity.len);
- if (barring < 0) {
- //get all records
- bytes_needed += impi->public_identity.len;
- (*num_impus)++;
+ if (skip_cscf_realm && cscf_realm) {
+ p = strstr(impi->public_identity.s, cscf_realm);
+ } else {
+ p = NULL;
+ }
+
+ if (p) {
+ LM_DBG("Skip Record %.*s (%i)\n", impi->public_identity.len,
+ impi->public_identity.s, impi->public_identity.len);
} else {
- if (impi->barring == barring) {
- //add the record to the list
+ LM_DBG("Got Record %.*s (%i)\n", impi->public_identity.len,
+ impi->public_identity.s, impi->public_identity.len);
+
+ if (barring < 0) {
+ //get all records
bytes_needed += impi->public_identity.len;
(*num_impus)++;
+ } else {
+ if (impi->barring == barring) {
+ //add the record to the list
+ bytes_needed += impi->public_identity.len;
+ (*num_impus)++;
+ }
}
}
}
@@ -761,21 +777,30 @@ int get_impus_from_subscription_as_string(udomain_t* _d, impurecord_t* impu_rec,
for (i = 0; i < impu_rec->s->service_profiles_cnt; i++) {
for (j = 0; j < impu_rec->s->service_profiles[i].public_identities_cnt; j++) {
impi = &(impu_rec->s->service_profiles[i].public_identities[j]);
- if (barring < 0) {
- //get all records
- (*impus)[count].s = ptr;
- memcpy(ptr, impi->public_identity.s, impi->public_identity.len);
- (*impus)[count].len = impi->public_identity.len;
- ptr += impi->public_identity.len;
- count++;
+
+ if (skip_cscf_realm && cscf_realm) {
+ p = strstr(impi->public_identity.s, cscf_realm);
} else {
- if (impi->barring == barring) {
- //add the record to the list
+ p = NULL;
+ }
+
+ if (p == NULL) {
+ if (barring < 0) {
+ //get all records
(*impus)[count].s = ptr;
memcpy(ptr, impi->public_identity.s, impi->public_identity.len);
(*impus)[count].len = impi->public_identity.len;
ptr += impi->public_identity.len;
count++;
+ } else {
+ if (impi->barring == barring) {
+ //add the record to the list
+ (*impus)[count].s = ptr;
+ memcpy(ptr, impi->public_identity.s, impi->public_identity.len);
+ (*impus)[count].len = impi->public_identity.len;
+ ptr += impi->public_identity.len;
+ count++;
+ }
}
}
}