[SR-Users] Timer function didnot trigger the routing function

Daniel-Constantin Mierla miconda at gmail.com
Fri Oct 27 10:58:12 CEST 2017


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 at gmail.com <mailto:rajasreerathna at 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.
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20171027/a6d89fb0/attachment.html>


More information about the sr-users mailing list