[sr-dev] git:master: modules/ims_registrar_scscf: new parameter user_data_always - if set S-CSCF always requests user data from HSS

Richard Good richard.good at smilecoms.com
Wed Oct 29 12:17:32 CET 2014


Module: sip-router
Branch: master
Commit: 9cfe0e32f8bcf2a0e480972b7ae91d3a52f473ce
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9cfe0e32f8bcf2a0e480972b7ae91d3a52f473ce

Author: Richard Good <richard.good at smilecoms.com>
Committer: Richard Good <richard.good at smilecoms.com>
Date:   Wed Oct 29 13:16:23 2014 +0200

modules/ims_registrar_scscf: new parameter user_data_always - if set S-CSCF always requests user data from HSS

---

 .../doc/ims_registrar_scscf_admin.xml              |   19 +++++++++++++++++++
 modules/ims_registrar_scscf/reg_mod.c              |    3 +++
 modules/ims_registrar_scscf/save.c                 |   16 +++++++++++-----
 3 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml b/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
index d54561e..0964b5e 100644
--- a/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
+++ b/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
@@ -305,6 +305,25 @@
 ...</programlisting>
       </example>
     </section>
+    
+    <section>
+      <title>user_data_always (integer)</title>
+
+      <para>If specified this will make the S-CSCF always request user
+	  data from HSS.</para>
+
+      <para><emphasis> Default value is 0 (disabled)</emphasis></para>
+
+      <example>
+        <title>Set <varname>user_data_always</varname>parameter</title>
+
+        <programlisting format="linespecific">...
+        modparam("ims_registrar_scscf", "user_data_always", 1)
+...
+	</programlisting>
+      </example>
+    </section>
+    
   </section>
 
   <section>
diff --git a/modules/ims_registrar_scscf/reg_mod.c b/modules/ims_registrar_scscf/reg_mod.c
index 6ce9705..3a39ec1 100644
--- a/modules/ims_registrar_scscf/reg_mod.c
+++ b/modules/ims_registrar_scscf/reg_mod.c
@@ -94,6 +94,8 @@ int store_data_on_dereg = 0; /**< should we store SAR data on de-registration  *
 int ue_unsubscribe_on_dereg = 0;  /*many UEs do not unsubscribe on de reg - therefore we should remove their subscription and not send a notify
 				   Some UEs do unsubscribe then everything is fine*/
 
+int user_data_always = 0; /* Always Reports that user data is missing to HSS */
+
 /* parameters storage */
 str cxdx_dest_realm = str_init("ims.smilecoms.com");
 
@@ -244,6 +246,7 @@ static param_export_t params[] = {
     {"subscription_min_expires", INT_PARAM, &subscription_min_expires},
     {"subscription_max_expires", INT_PARAM, &subscription_max_expires},
     {"ue_unsubscribe_on_dereg", INT_PARAM, &ue_unsubscribe_on_dereg},
+    {"user_data_always", INT_PARAM, &user_data_always},
 
     {0, 0, 0}
 };
diff --git a/modules/ims_registrar_scscf/save.c b/modules/ims_registrar_scscf/save.c
index 4903e12..3066019 100644
--- a/modules/ims_registrar_scscf/save.c
+++ b/modules/ims_registrar_scscf/save.c
@@ -84,6 +84,7 @@ extern struct tm_binds tmb;
 extern int store_data_on_dereg; /**< should we store SAR user data on de-registration  */
 
 extern int ue_unsubscribe_on_dereg;
+extern int user_data_always;
 
 /*! \brief
  * Calculate absolute expires value per contact as follows:
@@ -1224,11 +1225,16 @@ int save(struct sip_msg* msg, char* str1, char *route) {
             }
         }
     }
-    if (require_user_data)
-        data_available = AVP_IMS_SAR_USER_DATA_NOT_AVAILABLE;
-    else
-        data_available = AVP_IMS_SAR_USER_DATA_ALREADY_AVAILABLE;
-
+    
+    if (!user_data_always) {
+	if (require_user_data)
+	    data_available = AVP_IMS_SAR_USER_DATA_NOT_AVAILABLE;
+	else
+	    data_available = AVP_IMS_SAR_USER_DATA_ALREADY_AVAILABLE;
+    } else {
+	data_available = AVP_IMS_SAR_USER_DATA_NOT_AVAILABLE;
+    }
+    
     //before we send lets suspend the transaction
     t = tmb.t_gett();
     if (t == NULL || t == T_UNDEFINED) {




More information about the sr-dev mailing list