[sr-dev] git:master:092ee821: ims_registrar_scscf: Properly handle the case, when no user-data-xml was provided during SAR (due to the already existing user-data-xml from previous SAR)

Carsten Bock carsten at ng-voice.com
Tue Nov 15 16:42:43 CET 2016


Module: kamailio
Branch: master
Commit: 092ee821752d39eae5155c9b469e6e6d8e2fe9fe
URL: https://github.com/kamailio/kamailio/commit/092ee821752d39eae5155c9b469e6e6d8e2fe9fe

Author: Carsten Bock <carsten at ng-voice.com>
Committer: Carsten Bock <carsten at ng-voice.com>
Date: 2016-11-15T16:40:56+01:00

ims_registrar_scscf: Properly handle the case, when no user-data-xml was provided during SAR (due to the already existing user-data-xml from previous SAR)

---

Modified: modules/ims_registrar_scscf/cxdx_sar.c
Modified: modules/ims_registrar_scscf/save.c

---

Diff:  https://github.com/kamailio/kamailio/commit/092ee821752d39eae5155c9b469e6e6d8e2fe9fe.diff
Patch: https://github.com/kamailio/kamailio/commit/092ee821752d39eae5155c9b469e6e6d8e2fe9fe.patch

---

diff --git a/modules/ims_registrar_scscf/cxdx_sar.c b/modules/ims_registrar_scscf/cxdx_sar.c
index 876160f..877c657 100644
--- a/modules/ims_registrar_scscf/cxdx_sar.c
+++ b/modules/ims_registrar_scscf/cxdx_sar.c
@@ -250,24 +250,11 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *saa, long elaps
             }
         }
 
-        if (data->sar_assignment_type == AVP_IMS_SAR_REGISTRATION || data->sar_assignment_type == AVP_IMS_SAR_RE_REGISTRATION) {
-            if (s) {
-                if (build_p_associated_uri(s) != 0) {
-                    LM_ERR("Unable to build p_associated_uri\n");
-                    rerrno = R_SAR_FAILED;
-                    goto error;
-                }
-            }
-
-        }
-
-        if (s) {
-            //here we update the contacts and also build the new contact header for the 200 OK reply
-            if (update_contacts(req, data->domain, &data->public_identity, data->sar_assignment_type, &s, &ccf1, &ccf2, &ecf1, &ecf2, &data->contact_header) <= 0) {
-                LM_ERR("Error processing REGISTER\n");
-                rerrno = R_SAR_FAILED;
-                goto error;
-            }
+        //here we update the contacts and also build the new contact header for the 200 OK reply
+        if (update_contacts(req, data->domain, &data->public_identity, data->sar_assignment_type, &s, &ccf1, &ccf2, &ecf1, &ecf2, &data->contact_header) <= 0) {
+            LM_ERR("Error processing REGISTER\n");
+            rerrno = R_SAR_FAILED;
+            goto error;
         }
         
         if (data->contact_header) {
diff --git a/modules/ims_registrar_scscf/save.c b/modules/ims_registrar_scscf/save.c
index 2969ef9..962a65f 100644
--- a/modules/ims_registrar_scscf/save.c
+++ b/modules/ims_registrar_scscf/save.c
@@ -832,6 +832,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
             }
             //now build the contact buffer to be include in the reply message and unlock
             build_contact(impu_rec, contact_header);
+            build_p_associated_uri(*s);
             notify_subscribers(impu_rec, 0, 0);
             ul.unlock_udomain(_d, public_identity);
             break;
@@ -855,6 +856,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
             }
             //build the contact buffer for all registered contacts on explicit IMPU
             build_contact(impu_rec, contact_header);
+            build_p_associated_uri(impu_rec->s);
 
             subscription = impu_rec->s;
             if (!subscription) {
@@ -878,7 +880,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
             //now update the implicit set
             for (i = 0; i < subscription->service_profiles_cnt; i++) {
                 for (j = 0; j < subscription->service_profiles[i].public_identities_cnt; j++) {
-                    pi = &((*s)->service_profiles[i].public_identities[j]);
+                    pi = &(subscription->service_profiles[i].public_identities[j]);
 
                     if (memcmp(public_identity->s, pi->public_identity.s, public_identity->len) == 0) { //we don't need to update the explicit IMPU
                         LM_DBG("Ignoring explicit identity <%.*s>, updating later.....\n", public_identity->len, public_identity->s);




More information about the sr-dev mailing list