[sr-dev] [kamailio/kamailio] pv: add the $env() PV class to read env vars (#978)
Camille Oudot
notifications at github.com
Tue Feb 7 18:21:50 CET 2017
camilleoudot commented on this pull request.
> + 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);
+ } else {
easier to read, thanks
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/978
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170207/d79ad41b/attachment.html>
More information about the sr-dev
mailing list