[sr-dev] git:master: 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 richard.good at smilecoms.com
Fri Dec 20 09:10:30 CET 2013


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

Author: Richard Good <richard.good at smilecoms.com>
Committer: Richard Good <richard.good at smilecoms.com>
Date:   Fri Dec 20 10:09:35 2013 +0200

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

---

 modules/ims_registrar_scscf/registrar_notify.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/ims_registrar_scscf/registrar_notify.c b/modules/ims_registrar_scscf/registrar_notify.c
index 70fcc95..06c2987 100644
--- a/modules/ims_registrar_scscf/registrar_notify.c
+++ b/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;
 }




More information about the sr-dev mailing list