Browse code

pv: fix for new PV_IDX_NONE value

Victor Seva authored on 01/06/2020 10:08:38
Showing 1 changed files
... ...
@@ -1823,7 +1823,7 @@ int pv_get_avp(struct sip_msg *msg,  pv_param_t *param, pv_value_t *res)
1823 1823
 	if ((avp=search_first_avp(name_type, avp_name, &avp_value, &state))==0)
1824 1824
 		return pv_get_null(msg, param, res);
1825 1825
 	res->flags = PV_VAL_STR;
1826
-	if(idxf==0 && idx==0)
1826
+	if(idx==0 && (idxf==PV_IDX_INT || idxf==PV_IDX_NONE))
1827 1827
 	{
1828 1828
 		if(avp->flags & AVP_VAL_STR)
1829 1829
 		{
... ...
@@ -1981,7 +1981,7 @@ int pv_get_hdr(struct sip_msg *msg,  pv_param_t *param, pv_value_t *res)
1981 1981
 
1982 1982
 	/* get the value */
1983 1983
 	res->flags = PV_VAL_STR;
1984
-	if(idxf==0 && idx==0)
1984
+	if(idx==0 && (idxf==PV_IDX_INT || idxf==PV_IDX_NONE))
1985 1985
 	{
1986 1986
 		res->rs  = hf->body;
1987 1987
 		return 0;