[sr-dev] Selects: interpolation and dynamic properties

Carlos Ruiz Díaz carlos.ruizdiaz at gmail.com
Wed Jun 19 19:26:08 CEST 2013


Hi list,

I have two doubts about selects framework that I wanted to clarify if
possible:

- How do I interpolate a select inside enclosed quotes? i.e.

xlog("channels count for carlos: $sel(cnxcc.channels[carlos].count)");

The parameter "carlos" cannot be resolved and Kamailio fails to start
during pvar's fixup.

Currently, I'm working around this using the following construction:

$var(c) = @cnxcc.channels["carlos"].count;
xlog("channels count for carlos: $var(c)");

- How do I dynamically tell to a module the parameter from which I want to
know its channel count? i.e.

$var(user) = "carlos";

if (@cnxcc.channels[$var(user)].count > 10) {
     xlog("too many channels");
}

Is this possible at all?

Thanks in advance,
-- 
Carlos
http://caruizdiaz.com
+595981146623
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20130619/4a2f86c7/attachment.html>


More information about the sr-dev mailing list