Przeglądaj źródła

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

jaybeepee 8 lat temu
rodzic
commit
a23f4e6650
1 zmienionych plików z 7 dodań i 2 usunięć
  1. 7 2
      src/lib/ims/ims_getters.c

+ 7 - 2
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: