[SR-Users] Inconsistent string interpolation

Sven Neuhaus neuhaus at tyntec.com
Thu Oct 1 11:56:01 CEST 2015


I'm occasionally running into issues with inconsistent string
interpolation in the kamailio.cfg.

Here's the latest example. Take this line:

$var(x) = "sip:+$var(abc)-$var(def)-$si@$Ri:$Rp";

Here, the values of the variables will NOT be interpolated into the
string. Instead, I have to use this:

$var(x) = "sip:+" + $var(abc) + "-" + $var(def) + "-" + $si + "@" + $Ri
+ ":" + $Rp;

However, when I have an instruction such as:

append_hf("P-Asserted-Identity: $var(x)\r\n");

Then string interpolation takes place (i.e. the value of $var(x) is put
into the string.

This is very confusing and error prone. Is it something that can be
fixed? The behaviour should be consistent.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20151001/e29cc47d/attachment.sig>

More information about the sr-users mailing list