소스 검색

Merge pull request #630 from tdimitrov/reregister

ims_registar_scscf: Fix subscr data handling in SAA when no data received from HSS
jaybeepee 9 년 전
부모
커밋
6756e95fb8
1개의 변경된 파일14개의 추가작업 그리고 9개의 파일을 삭제
  1. 14 9
      modules/ims_registrar_scscf/cxdx_sar.c

+ 14 - 9
modules/ims_registrar_scscf/cxdx_sar.c

@@ -238,18 +238,23 @@ 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 (build_p_associated_uri(s) != 0) {
-                LM_ERR("Unable to build p_associated_uri\n");
-                rerrno = R_SAR_FAILED;
-                goto error;
+            if (s) {
+                if (build_p_associated_uri(s) != 0) {
+                    LM_ERR("Unable to build p_associated_uri\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(t->uas.request, 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 (s) {
+            //here we update the contacts and also build the new contact header for the 200 OK reply
+            if (update_contacts_new(t->uas.request, 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) {