Module: kamailio
Branch: master
Commit: bdf92b1eee120d4dce22079faf4d4cf73133c3d7
URL:
https://github.com/kamailio/kamailio/commit/bdf92b1eee120d4dce22079faf4d4cf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-12-22T19:44:47+01:00
pv: removed implementation of $env(name)
---
Modified: src/modules/pv/pv.c
Modified: src/modules/pv/pv_core.c
Modified: src/modules/pv/pv_core.h
---
Diff:
https://github.com/kamailio/kamailio/commit/bdf92b1eee120d4dce22079faf4d4cf…
Patch:
https://github.com/kamailio/kamailio/commit/bdf92b1eee120d4dce22079faf4d4cf…
---
diff --git a/src/modules/pv/pv.c b/src/modules/pv/pv.c
index 67f42c227d..c21298d752 100644
--- a/src/modules/pv/pv.c
+++ b/src/modules/pv/pv.c
@@ -227,8 +227,6 @@ static pv_export_t mod_pvs[] = {
{{"duri", (sizeof("duri")-1)}, /* */
PVT_DSTURI, pv_get_dsturi, pv_set_dsturi,
0, 0, 0, 0},
- {{"env", (sizeof("env")-1)}, PVT_OTHER, pv_get_env, 0,
- pv_parse_env_name, 0, 0, 0},
{{"err.class", (sizeof("err.class")-1)}, /* */
PVT_OTHER, pv_get_errinfo_attr, 0,
0, 0, 0, 0},
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 681e6beab1..ed9abe7cce 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -3737,43 +3737,6 @@ int pv_get_ksr_attrs(sip_msg_t *msg, pv_param_t *param, pv_value_t
*res)
}
}
-int pv_parse_env_name(pv_spec_p sp, str *in)
-{
- char *csname;
-
- if(in->s==NULL || in->len<=0)
- return -1;
-
- csname = pkg_malloc(in->len + 1);
-
- if (csname == NULL) {
- LM_ERR("no more pkg memory");
- return -1;
- }
-
- memcpy(csname, in->s, in->len);
- csname[in->len] = '\0';
-
- sp->pvp.pvn.u.dname = (void*)csname;
- sp->pvp.pvn.type = PV_NAME_OTHER;
- return 0;
-}
-
-int pv_get_env(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
-{
- char *val;
- char *csname = (char *) param->pvn.u.dname;
-
- if (csname) {
- val = getenv(csname);
-
- if (val) {
- return pv_get_strzval(msg, param, res, val);
- }
- }
- return pv_get_null(msg, param, res);
-}
-
int pv_parse_def_name(pv_spec_p sp, str *in)
{
if (in == NULL || in->s == NULL || sp == NULL) {
diff --git a/src/modules/pv/pv_core.h b/src/modules/pv/pv_core.h
index afcaa1f84a..02f1141fdf 100644
--- a/src/modules/pv/pv_core.h
+++ b/src/modules/pv/pv_core.h
@@ -385,10 +385,6 @@ int pv_parse_msg_attrs_name(pv_spec_p sp, str *in);
int pv_get_msg_attrs(sip_msg_t *msg, pv_param_t *param,
pv_value_t *res);
-int pv_parse_env_name(pv_spec_p sp, str *in);
-
-int pv_get_env(sip_msg_t *msg, pv_param_t *param, pv_value_t *res);
-
int pv_parse_ksr_attrs_name(pv_spec_p sp, str *in);
int pv_get_ksr_attrs(sip_msg_t *msg, pv_param_t *param,