Bladeren bron

modules:/ims_registrar_scscf: when processing subscriptions to reg events allow the ruri to be the contact of the S-CSCF and get the presentity from the to-header

Richard Good 11 jaren geleden
bovenliggende
commit
ef66bf4ce9
1 gewijzigde bestanden met toevoegingen van 4 en 8 verwijderingen
  1. 4 8
      modules/ims_registrar_scscf/registrar_notify.c

+ 4 - 8
modules/ims_registrar_scscf/registrar_notify.c

@@ -137,8 +137,8 @@ int can_subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
         goto done;
     }
 
-    //get the target/presentity URI from the request uri
-    presentity_uri = cscf_get_public_identity_from_requri(msg);
+    //get the target/presentity URI from To header
+    cscf_get_to_uri(msg, &presentity_uri);
 
 
     asserted_id = cscf_get_asserted_identity(msg);
@@ -215,10 +215,8 @@ int can_subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
     ul.unlock_udomain((udomain_t*) _t, &presentity_uri);
 
 done:
-    if (presentity_uri.s) shm_free(presentity_uri.s);
     return ret;
 error:
-    if (presentity_uri.s) shm_free(presentity_uri.s);
     ret = CSCF_RETURN_ERROR;
     return ret;
 }
@@ -410,8 +408,8 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
         }
     }
 
-    //get the presentity uri from the request uri
-    presentity_uri = cscf_get_public_identity_from_requri(msg);
+    //get the presentity uri from To Header
+    cscf_get_to_uri(msg, &presentity_uri);
 
     //get the watcher uri from the to header
     cscf_get_from_uri(msg, &watcher_impu);
@@ -551,12 +549,10 @@ int subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
 
     //free memory
     if (record_route.s) pkg_free(record_route.s);
-    if (presentity_uri.s) shm_free(presentity_uri.s);
     return ret;
 error:
     //free memory
     if (record_route.s) pkg_free(record_route.s);
-    if (presentity_uri.s) shm_free(presentity_uri.s);
 
     return ret;
 }