Hello AliReza,
On 07/11/2014 04:53 PM, AliReza Khoshgoftar Monfared wrote:
Hi,
I have a basic yet weird problem with Rtimer module.
I cannot make it execute a route block for me at an interval of my
choice (which is what it is supposed to do, right?)
Here is a simplified example with relevant parts of my config script:
Assume I want to print "hello" every 100 ms:
I have a script like this (I've put all my global variables, in case
they matter and my relevant route blocks...)
Is there anything I am doing wrong here in the usage of rtimer?
Well, what's not working? Is it not printing anything at all? Or is it
printing at a different interval than you expect? If so, what is the
interval?
Note that you've specified an interval of 1s:
modparam("rtimer", "timer",
"name=ta;interval=1;mode=1;")
By default, the interval value is in seconds. If you append a 'u', the
value is expressed in microseconds (millionths of a second), which gives
you sub-second timing granularity, per
http://kamailio.org/docs/modules/4.1.x/modules/rtimer.html#idp2566368.
This means that to have an interval of 100 ms, you'd define the timer
thusly:
modparam("rtimer", "timer",
"name=ta;interval=100000u;mode=1;")
-- Alex
--
Alex Balashov - Principal
Evariste Systems LLC
Tel: +1-678-954-0670
Web:
http://www.evaristesys.com/,
http://www.alexbalashov.com/
Please be kind to the English language:
http://www.entrepreneur.com/article/232906