[sr-dev] git:master: modules/ims_registrar_scscf: fixed comparison of P-asserted-id and Path header

Richard Good richard.good at smilecoms.com
Tue Dec 3 17:14:53 CET 2013


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

Author: Richard Good <richard.good at smilecoms.com>
Committer: Richard Good <richard.good at smilecoms.com>
Date:   Tue Dec  3 18:09:30 2013 +0200

modules/ims_registrar_scscf: fixed comparison of P-asserted-id and Path header
	In can_subscribe_to_reg() we check if the P-Asserted-Identity in the Subscribe is in the Register path header (i.e. is this the P-CSCF subscribing to UE reg-event)
	This fix changes the comparison to compare P-asserted-id without "sip:" to cater for all compliant path header formats

---

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

diff --git a/modules/ims_registrar_scscf/registrar_notify.c b/modules/ims_registrar_scscf/registrar_notify.c
index d5c4bf9..70fcc95 100644
--- a/modules/ims_registrar_scscf/registrar_notify.c
+++ b/modules/ims_registrar_scscf/registrar_notify.c
@@ -198,7 +198,10 @@ int can_subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
     while (c) {
 	if (c->path.len) {
             for (i = 0; i < c->path.len - asserted_id.len; i++)
-                if (strncasecmp(c->path.s + i, asserted_id.s, asserted_id.len) == 0) {
+		LM_DBG("Path: <%.*s>.\n",
+		c->path.len, c->path.s);
+		//we compare the asserted_id without "sip:" to the path 
+                if (strncasecmp(c->path.s + i, asserted_id.s+4, asserted_id.len-4) == 0) {
                     LM_DBG("Identity found in Path <%.*s>\n",
                             c->path.len, c->path.s);
                     ret = CSCF_RETURN_TRUE;




More information about the sr-dev mailing list