Module: kamailio Branch: master Commit: a23f4e66507195c5b2e83a2a8cf1e445a65b3e96 URL: https://github.com/kamailio/kamailio/commit/a23f4e66507195c5b2e83a2a8cf1e445...
Author: jaybeepee jason.penton@gmail.com Committer: jaybeepee jason.penton@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/a23f4e66507195c5b2e83a2a8cf1e445... Patch: https://github.com/kamailio/kamailio/commit/a23f4e66507195c5b2e83a2a8cf1e445...
---
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: