[sr-dev] git:master:21b64194: pv : add auth digest pseudo variables

Luis Azedo luis.azedo at factorlusitano.com
Mon Jul 13 11:47:16 CEST 2015


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

Author: Luis Azedo <luis.azedo at factorlusitano.com>
Committer: Luis Azedo <luis.azedo at factorlusitano.com>
Date: 2015-07-06T15:50:20+01:00

pv : add auth digest pseudo variables

adn -  auth nonce
adc - auth cnonce
adr - auth response
ado - auth opaque

---

Modified: modules/pv/pv.c
Modified: modules/pv/pv_core.c

---

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

---

diff --git a/modules/pv/pv.c b/modules/pv/pv.c
index 11d899a..1145f86 100644
--- a/modules/pv/pv.c
+++ b/modules/pv/pv.c
@@ -123,6 +123,18 @@ static pv_export_t mod_pvs[] = {
 	{{"aa", (sizeof("aa")-1)}, /* auth algorithm */
 		PVT_OTHER, pv_get_authattr, 0,
 		0, 0, pv_init_iname, 6},	
+	{{"adn", (sizeof("adn")-1)}, /* auth nonce */
+		PVT_OTHER, pv_get_authattr, 0,
+		0, 0, pv_init_iname, 7},	
+	{{"adc", (sizeof("adc")-1)}, /* auth cnonce */
+		PVT_OTHER, pv_get_authattr, 0,
+		0, 0, pv_init_iname, 8},	
+	{{"adr", (sizeof("adr")-1)}, /* auth response */
+		PVT_OTHER, pv_get_authattr, 0,
+		0, 0, pv_init_iname, 9},	
+	{{"ado", (sizeof("ado")-1)}, /* auth opaque */
+		PVT_OTHER, pv_get_authattr, 0,
+		0, 0, pv_init_iname, 10},	
 	{{"Au", (sizeof("Au")-1)}, /* */
 		PVT_OTHER, pv_get_acc_username, 0,
 		0, 0, pv_init_iname, 1},
diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c
index 9cbad39..239858c 100644
--- a/modules/pv/pv_core.c
+++ b/modules/pv/pv_core.c
@@ -1254,6 +1254,18 @@ int pv_get_authattr(struct sip_msg *msg, pv_param_t *param,
 	}
 	switch(param->pvn.u.isname.name.n)
 	{
+		case 10:
+			return pv_get_strval(msg, param, res,
+					&((auth_body_t*)(hdr->parsed))->digest.opaque);
+		case 9:
+			return pv_get_strval(msg, param, res,
+					&((auth_body_t*)(hdr->parsed))->digest.response);
+		case 8:
+			return pv_get_strval(msg, param, res,
+					&((auth_body_t*)(hdr->parsed))->digest.cnonce);
+		case 7:
+			return pv_get_strval(msg, param, res,
+					&((auth_body_t*)(hdr->parsed))->digest.nonce);
 		case 6:
 			return pv_get_strval(msg, param, res,
 					&((auth_body_t*)(hdr->parsed))->digest.alg.alg_str);




More information about the sr-dev mailing list