Hi,
It is important to know that the scope of $var(...) is per-process[1], and timer functions
run in a different process.
When REFRESH_CALLSTATE_TIMER runs, it is not in response to any particular SIP message or
call, and it does not know the context of any particular SIP message or call.
-- Alex
[1] Which also has unexpected consequences when a different SIP message hits the same
process in which a $var() was set before; they are process-persistent, as the
documentation notes.
On 29 Nov 2023, at 16:02, dries--- via sr-users
<sr-users(a)lists.kamailio.org> wrote:
Hi,
I have a timer which is called each 5 seconds:
modparam("timer", "declare_timer",
"REFRESH_CALLSTATE_TIMER=REFRESH_CALLSTATE_TIMER,5000,slow");
I'm enabling setting the variable "testvar" and enabling the timer when an
INVITE is received:
if (is_method("INVITE|ACK|UPDATE|CANCEL|BYE")) {
$var(testvar) = "blablabla";
timer_enable("REFRESH_CALLSTATE_TIMER", "1");
...
route[REFRESH_CALLSTATE_TIMER] {
xlog("L_INFO", "Testvariable: $var(test)\n");
}
However, the variable is always 0:
INFO: <script>: Testvariable: 0
I've also tried printing pseudovariables like $ci, $du but nothinh seems accessible.
Is there a workaround for this?
Best regards,
Dries
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web:
https://evaristesys.com
Tel: +1-706-510-6800