Module: sip-router
Branch: 3.1
Commit: da7e2d7eafbf3b22ff4ef4eaf8cdd952803ed4eb
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=da7e2d7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Mar 6 11:38:35 2011 +0100
pv: reset the index for inner fields of xavp PV
- reported by Alex Hermann
(cherry picked from commit d202b9dc49565aa13c96ed75dc67bc9e389a212a)
---
modules_k/pv/pv_xavp.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules_k/pv/pv_xavp.c b/modules_k/pv/pv_xavp.c
index 34dd91b..e706d04 100644
--- a/modules_k/pv/pv_xavp.c
+++ b/modules_k/pv/pv_xavp.c
@@ -99,7 +99,7 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
if(idx<0)
{
count = xavp_count(&xname->name, NULL);
- idx = count + idx + 1;
+ idx = count + idx;
}
avp = xavp_get_by_index(&xname->name, idx, NULL);
if(avp==NULL)
@@ -107,6 +107,8 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
if(xname->next==NULL)
return pv_xavp_get_value(msg, param, res, avp);
+ idx = 0;
+ idxf = 0;
if(xname->next->index.type==PVT_EXTRA)
{
/* get the index */
@@ -120,7 +122,7 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
if(idx<0)
{
count = xavp_count(&xname->next->name, &avp->val.v.xavp);
- idx = count + idx + 1;
+ idx = count + idx;
}
avp = xavp_get_by_index(&xname->next->name, idx, &avp->val.v.xavp);
if(avp==NULL)