[SR-Users] function calling in the config script with $var() as attribute(s)

Alex Balashov abalashov at evaristesys.com
Wed Feb 24 15:44:39 CET 2010


Klaus,

1) Variables are always evaluated in a lexical context, so

    func($var(x));

    will never work.  What you want is:

    func("$var(x)");

    Just call it an idiosyncrasy of Kamailio/SR.

2) Not ALL core and module functions evaluate pseudo-variables and 
substitute their values;  most do, but there are still some out there 
that don't and always evaluate their string arguments strictly literally.

These are mostly old-school core functions as rewritehostport().  There 
are a few module functions that don't support PVs as well, but I imagine 
that will be changing soon.  A number of functions have been upgraded 
recently to allow PV arguments.

Cheers,

-- Alex

-- 
Alex Balashov - Principal
Evariste Systems LLC

Tel    : +1 678-954-0670
Direct : +1 678-954-0671
Web    : http://www.evaristesys.com/




More information about the sr-users mailing list