[sr-dev] git:master:a23f4e66: lib/ims: if no domain for IMPI fallback to IMPU

jaybeepee jason.penton at gmail.com
Mon Dec 12 12:49:43 CET 2016


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

Author: jaybeepee <jason.penton at gmail.com>
Committer: jaybeepee <jason.penton at gmail.com>
Date: 2016-12-12T13:49:06+02:00

lib/ims: if no domain for IMPI fallback to IMPU

---

Modified: src/lib/ims/ims_getters.c

---

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

---

diff --git a/src/lib/ims/ims_getters.c b/src/lib/ims/ims_getters.c
index aedf686..170aa93 100644
--- a/src/lib/ims/ims_getters.c
+++ b/src/lib/ims/ims_getters.c
@@ -159,8 +159,13 @@ str cscf_get_private_identity(struct sip_msg *msg, str realm) {
 		return pi;
 	}
 
-	if (h) pi = ((auth_body_t*) h->parsed)->digest.username.whole;
-
+	if (h) {
+		pi = ((auth_body_t*) h->parsed)->digest.username.whole;
+		if (memchr(pi.s, '@', pi.len) == 0) {
+			LM_DBG("no domain in username - required for IMPI - falling back to IMPU\n");
+			goto fallback;
+		}
+	}
 	goto done;
 
 fallback:




More information about the sr-dev mailing list