From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Mon, 1 Jun 2020 12:08:38 +0200
Subject: [PATCH] pv: fix for new PV_IDX_NONE value

---
 src/modules/pv/pv_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index d4ae29b..ca863b4 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -1791,7 +1791,7 @@ int pv_get_avp(struct sip_msg *msg,  pv_param_t *param, pv_value_t *res)
 	if ((avp=search_first_avp(name_type, avp_name, &avp_value, &state))==0)
 		return pv_get_null(msg, param, res);
 	res->flags = PV_VAL_STR;
-	if(idxf==0 && idx==0)
+	if(idx==0 && (idxf==PV_IDX_INT || idxf==PV_IDX_NONE))
 	{
 		if(avp->flags & AVP_VAL_STR)
 		{
@@ -1949,7 +1949,7 @@ int pv_get_hdr(struct sip_msg *msg,  pv_param_t *param, pv_value_t *res)
 
 	/* get the value */
 	res->flags = PV_VAL_STR;
-	if(idxf==0 && idx==0)
+	if(idx==0 && (idxf==PV_IDX_INT || idxf==PV_IDX_NONE))
 	{
 		res->rs  = hf->body;
 		return 0;
