Module: kamailio
Branch: master
Commit: 28553798f5b30a6204752ed38a69c42b78bc91cc
URL:
https://github.com/kamailio/kamailio/commit/28553798f5b30a6204752ed38a69c42…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2015-03-19T18:01:40+01:00
core: introduce '+' as PV_INDX_ITR
With this notation we want to check all values one by one not
the list of coma separated values
---
Modified: pvapi.c
Modified: pvar.h
---
Diff:
https://github.com/kamailio/kamailio/commit/28553798f5b30a6204752ed38a69c42…
Patch:
https://github.com/kamailio/kamailio/commit/28553798f5b30a6204752ed38a69c42…
---
diff --git a/pvapi.c b/pvapi.c
index 710b460..ccf9814 100644
--- a/pvapi.c
+++ b/pvapi.c
@@ -667,6 +667,11 @@ int pv_parse_index(pv_spec_p sp, str *in)
sp->pvp.pvi.type = PV_IDX_ALL;
return 0;
}
+ if(*p=='+' && in->len==1)
+ {
+ sp->pvp.pvi.type = PV_IDX_ITR;
+ return 0;
+ }
sign = 1;
if(*p=='-')
{
@@ -1225,7 +1230,10 @@ int pv_get_spec_index(struct sip_msg* msg, pv_param_p ip, int *idx,
int *flags)
*flags = PV_IDX_ALL;
return 0;
}
-
+ if(ip->pvi.type == PV_IDX_ITR) {
+ *flags = PV_IDX_ITR;
+ return 0;
+ }
if(ip->pvi.type == PV_IDX_INT)
{
*idx = ip->pvi.u.ival;
diff --git a/pvar.h b/pvar.h
index 601f0ef..da13806 100644
--- a/pvar.h
+++ b/pvar.h
@@ -60,6 +60,7 @@
#define PV_IDX_INT 0
#define PV_IDX_PVAR 1
#define PV_IDX_ALL 2
+#define PV_IDX_ITR 3
/*! if PV name is dynamic, integer, or str */
#define pv_has_dname(pv) ((pv)->pvp.pvn.type==PV_NAME_PVAR)