Hi, I tried using the timer function to call a function after specific time but it was not working as specified. Could you please help me with some example using timer to trigger a function.
I tried it using the description given in below link.
www.kamailio.org/docs/modules/devel/modules/timer.html
Thanks and regards, Rathna.
Hello,
I haven't used timer module myself, as it was developed by the ser branch in the past and kamailio already had rtimer at the merge, so I can suggest to try rtimer module, should be pretty similar and maybe it fits your needs as well:
- https://www.kamailio.org/docs/modules/stable/modules/rtimer.html
If there is something in timer that you need and is not in rtimer, let us know, maybe there is a solution for it ...
If you want to continue with timer module, then I can suggest to run with debug=3 in kamailio.cfg and see if you can spot anything relevant in the log messages.
Cheers, Daniel
On 24.10.17 09:24, RAJA SREE RATHNA gomathinayagam wrote:
Hi, I tried using the timer function to call a function after specific time but it was not working as specified. Could you please help me with some example using timer to trigger a function. I tried it using the description given in below link. www.kamailio.org/docs/modules/devel/modules/timer.html http://www.kamailio.org/docs/modules/devel/modules/timer.html
Thanks and regards, Rathna.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello Daniel,
While going through the rtimer module we noticed that it execute the routing function repeatedly after the given interval of time. But our specification is to execute the routing function only once and timer should be enabled based on specific condition. Also there is no enable or disable option for rtimer module as in timer module, whether rtimer module can be enabled based on specific condition.If it is possible could you please suggest the solution.
Thanks & Regards, Rathna.
On Oct 24, 2017 12:54 PM, "RAJA SREE RATHNA gomathinayagam" < rajasreerathna@gmail.com> wrote:
Hi, I tried using the timer function to call a function after specific time but it was not working as specified. Could you please help me with some example using timer to trigger a function.
I tried it using the description given in below link.
www.kamailio.org/docs/modules/devel/modules/timer.html
Thanks and regards, Rathna.
Hello,
On 27.10.17 08:14, RAJA SREE RATHNA gomathinayagam wrote:
Hello Daniel,
While going through the rtimer module we noticed that it execute the routing function repeatedly after the given interval of time. But our specification is to execute the routing function only once and timer should be enabled based on specific condition. Also there is no enable or disable option for rtimer module as in timer module, whether rtimer module can be enabled based on specific condition.If it is possible could you please suggest the solution.
the rtimer is indeed designed for repeated execution of routing blocks. You can script ta way to enable disable execution of the route block by having a condition on a shared memory variable, like:
route[RTIMER] {
if($shv(rtimer)==1) return; ... }
Whenever you set the $shv(rtimer) to 1, then practically the execution of the route[RTIMER] ends without running your actions. The shv variable can be set from any other part of the config and even via rpc command from outside of kamailio.
On the other hand, you can just try to go with timer module if suits better your needs. I just can't provide straightforward hints for it, because I don't use it, but it should work.
Cheers, Daniel
Thanks & Regards, Rathna.
On Oct 24, 2017 12:54 PM, "RAJA SREE RATHNA gomathinayagam" <rajasreerathna@gmail.com mailto:rajasreerathna@gmail.com> wrote:
Hi, I tried using the timer function to call a function after specific time but it was not working as specified. Could you please help me with some example using timer to trigger a function. I tried it using the description given in below link. www.kamailio.org/docs/modules/devel/modules/timer.html <http://www.kamailio.org/docs/modules/devel/modules/timer.html> Thanks and regards, Rathna.