pv: use the corresponding functions for parsing names of xavu and xavi
authorDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 29 Sep 2020 05:25:46 +0000 (07:25 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 29 Sep 2020 07:20:49 +0000 (09:20 +0200)
(cherry picked from commit aa8589ba66f984e93438a91a7fe8b26bd9d5b62e)

src/modules/pv/pv.c
src/modules/pv/pv_xavp.c

index 4d3d8b3..ab48a54 100644 (file)
@@ -96,10 +96,10 @@ static pv_export_t mod_pvs[] = {
                pv_parse_xavp_name, 0, 0, 0 },
        { {"xavu", sizeof("xavu")-1}, /* xavu */
                PVT_XAVU, pv_get_xavu, pv_set_xavu,
-               pv_parse_xavp_name, 0, 0, 0 },
+               pv_parse_xavu_name, 0, 0, 0 },
        { {"xavi", sizeof("xavi")-1}, /* xavi */
                PVT_XAVI, pv_get_xavi, pv_set_xavi,
-               pv_parse_xavp_name, 0, 0, 0 },
+               pv_parse_xavi_name, 0, 0, 0 },
        {{"avp", (sizeof("avp")-1)}, PVT_AVP, pv_get_avp, pv_set_avp,
                pv_parse_avp_name, pv_parse_index, 0, 0},
        {{"hdr", (sizeof("hdr")-1)}, PVT_HDR, pv_get_hdr, 0, pv_parse_hdr_name,
@@ -1221,7 +1221,7 @@ static int w_xav_child_seti(sip_msg_t *msg, char *prname, char *pcname,
                return -1;
        }
 
-       return ki_xav_child_seti(msg, &rname, &cname, ival, _case);
+       return ki_xav_child_seti(msg, &rname, &cname, ival, _case);
 }
 
 static int w_xavp_child_seti(sip_msg_t *msg, char *prname, char *pcname,
index 9510c40..36127a2 100644 (file)
@@ -234,7 +234,7 @@ int pv_set_xavp(struct sip_msg* msg, pv_param_t *param,
                        xavp_rm_by_index(&xname->name, idx, NULL);
                        return 0;
                }
-               
+
                if(xname->next->index.type==PVT_EXTRA)
                {
                        /* get the index */
@@ -352,7 +352,7 @@ int pv_set_xavp(struct sip_msg* msg, pv_param_t *param,
                        return -1;
                return 0;
        }
-               
+
        /* xavp with xavp list value */
        if(xname->next->index.type==PVT_EXTRA)
        {
@@ -389,7 +389,7 @@ int pv_set_xavp(struct sip_msg* msg, pv_param_t *param,
 
                if(avp->val.type!=SR_XTYPE_XAVP)
                        return -1;
-                       
+
                if(xname->next->index.type==PVT_EXTRA) {
                        if(idxf1==PV_IDX_ALL) {
                                /* ignore: should iterate and set same value to all xavps
@@ -416,7 +416,7 @@ int pv_set_xavp(struct sip_msg* msg, pv_param_t *param,
        /* add new xavp with xavp list */
        if(xavp_add_value(&xname->next->name, &xval, &list)==NULL)
                return -1;
-       
+
        /* build xavp value */
        memset(&xval, 0, sizeof(sr_xval_t));
        xval.type = SR_XTYPE_XAVP;
@@ -895,7 +895,7 @@ int pv_set_xavu(struct sip_msg* msg, pv_param_t *param,
                        xavu_rm_by_name(&xname->name, NULL);
                        return 0;
                }
-               
+
                avu = xavu_lookup(&xname->name, NULL);
                if(avu!=NULL && avu->val.type==SR_XTYPE_XAVP) {
                        xavu_rm_by_name(&xname->next->name, &avu->val.v.xavp);