Hello all,
Looking for some clarification regarding quoting and !#defenv . I understand that the example below fails because the environmental variable HOME is not quoted, thus when used in the xlog() call it fails. How is it possible to evaluate
and/or use the value of the environmental variable if defined as a preprocessor variable? Looking at the documentation the reason for this directive is “It is a simplified
alternative of using #!substdef with $env(NAME) in the replacement part.” But #!substdef would allow setting the
value inside of a quoted string, so does it really meet that requirement?
I’m aware that I could use $env(HOME) rather than a preprocessor directive of HOME. I’m just trying to understand the usage of the #!defenv feature.
#!KAMAILIO
## Tested in 5.5.2
loadmodule "xlog"
loadmodule "pv"
loadmodule "evrexec"
modparam("evrexec", "exec", "name=evrexec:timer;wait=1000;workers=1;")
#!defenv HOME
request_route{
forward();
}
event_route[evrexec:timer] {
xlog("L_N", "HOME: " + HOME + "\n");
}
Ben Kaufman |