Hi,
I'm trying to use this line in one route:
$shtinc(pushedUsers=>$avp(s:authuser));
However, when checking the syntax of this file, Kamailio says:
0(609) : <core> [cfg.y:3365]: yyerror_at(): parse error in config file /etc/kamailio/kamailio_sip_proxy.cfg, line 3304, column 2-39: read only pvar in assignment left side
According to the pseudo vars documentation, I should be able to use it like that.
Can someone tell me what I am missing?
Best Regards, Sebastian
Hello,
you ave to use it in right side of an assignment, like:
$var(x) = ...
Cheers, Daniel
On 08/07/16 12:20, Sebastian Damm wrote:
Hi,
I'm trying to use this line in one route:
$shtinc(pushedUsers=>$avp(s:authuser));
However, when checking the syntax of this file, Kamailio says:
0(609) : <core> [cfg.y:3365]: yyerror_at(): parse error in config file /etc/kamailio/kamailio_sip_proxy.cfg, line 3304, column 2-39: read only pvar in assignment left side
According to the pseudo vars documentation, I should be able to use it like that.
Can someone tell me what I am missing?
Best Regards, Sebastian
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi,
is there a reason to not allow it as a simple operation on a separate line without a left and right side? After all, it's just an incrementation of a value, so why do I have to assign it to a variable (which I don't need at this point) or use it somewhere else? I now included it into an xlog line as shown in the docs, but the readability for sure would be a lot better if it was a separate command.
Best Regards, Sebastian
Hello,
this is a special variable -- that's why they were called pseudo-variables in the first place.
It does an atomic increment when evaluated in a expression. The interpreter doesn't trigger evaluation if the variable is not in the right side of an assignment (or parameter for functions).
If you use xlog, be aware that the variable is evaluated only if the log message is printed (e.g, if you use xdbg and debug=1, then the xdbg is not evaluated).
Cheers, Daniel
On 08/07/16 14:43, Sebastian Damm wrote:
Hi,
is there a reason to not allow it as a simple operation on a separate line without a left and right side? After all, it's just an incrementation of a value, so why do I have to assign it to a variable (which I don't need at this point) or use it somewhere else? I now included it into an xlog line as shown in the docs, but the readability for sure would be a lot better if it was a separate command.
Best Regards, Sebastian
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users