[OpenSIPS-Users] add_diversion counter variable

Edwin eahaselhoff at gmail.com
Tue Jan 26 12:26:13 CET 2016


I'm using the latest opensips release 2.1.2 on Debian and have a problem with
the add_diversion header.

For every callforward I have to add a diversion header at top level with the
counter increased by one. I can put the counter number in manual, but not
use a variable:

add_diversion("unknown;privacy=off;screen=yes","sip:+1234567 at sip.provider.org;user=phone","1");
[OK]

add_diversion("unknown;privacy=off;screen=yes","sip:+1234567 at sip.provider.org;user=phone","$var(dic)");
[FAIL]

This is my chunck of code:

if($di)
{
  $var(dic) = $(hdr(Diversion){param.value,counter}{s.int});
}
else {
  $var(dic) = 0;
}

add_diversion("unknown;privacy=off;screen=yes","sip:+1234567 at sip.provider.org;user=phone","$var(dic)");

Jan 26 opensips[]: ERROR:core:fixup_uint: bad number <$var(dic)>
Jan 26 opensips[]: ERROR:core:fix_actions: fixing failed (code=-6) at
/etc/opensips/opensips.cfg:842
Jan 26 opensips[]: ERROR:core:main: failed to fix configuration with err
code -6

I also tried other options (with and without quotes etc. It would be nice to
use a variable for the counter or have a function that automaticly increases
the counter with one.



--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/add-diversion-counter-variable-tp7601042.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list