<div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>I have a basic yet weird problem with Rtimer module.<br></div>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?)<br>

<br></div>Here is a simplified example with relevant parts of my config script:<br><br></div>Assume I want to print "hello" every 100 ms:<br><br></div>I have a script like this (I've put all my global variables, in case they matter and my relevant route blocks...)<br>

<br></div><div>Is there anything I am doing wrong here in the usage of rtimer?<br></div><div><br><br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">

<i>####### Global Parameters #########</i><br><br><i>#!ifdef WITH_DEBUG</i><br><i>debug=4</i><br><i>log_stderror=yes</i><br><i>#!else</i><br><i>debug=-2</i><br><i>log_stderror=no</i><br><i>#!endif</i><br><br><i>memdbg=5</i><br>

<i>memlog=5</i><br><br><i>log_facility=LOG_LOCAL0</i><br><br><i>fork=yes</i><br><i>children=4</i><br><br><i>/* comment the next line to enable TCP */</i><br><i>disable_tcp=yes</i><br><br><i>/* uncomment the next line to disable the auto discovery of local aliases</i><br>

<i>   based on revers DNS on IPs (default on) */</i><br><i>auto_aliases=no</i><br><br><i>/* add local domain aliases */</i><br><i># alias="<a href="http://mysipserver.com">mysipserver.com</a>"</i><br><i>dns=no          # (cmd. line: -r)</i><br>

<i>rev_dns=no      # (cmd. line: -R)</i><br><br><i>port=5060</i><br><br><i>/* uncomment and configure the following line if you want Kamailio to </i><br><i>   bind on a specific interface/port/proto (default bind on all available) */</i><br>

<i>listen=eth0:5060</i><br><br><i>sip_warning=no</i><br><br><i>####### Modules Section ########</i><br><br><i>#set module path</i><br><i>#mpath="/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/"</i><br>

<i>loadpath "/usr/lib/x86_64-linux-gnu/kamailio/modules"</i><br><br><br><i>#loadmodule "db_mysql.so"</i><br><i>loadmodule "mi_fifo.so"</i><br><i>loadmodule "kex.so"</i><br><i>loadmodule "tm.so"</i><br>

<i>loadmodule "tmx.so"</i><br><i>loadmodule "sl.so"</i><br><i>loadmodule "rr.so"</i><br><i>loadmodule "pv.so"</i><br><i>loadmodule "maxfwd.so"</i><br><i>loadmodule "textops.so"</i><br>

<i>loadmodule "siputils.so"</i><br><i>loadmodule "xlog.so"</i><br><i>loadmodule "xprint.so"</i><br><i>loadmodule "sanity.so"</i><br><i>loadmodule "ctl.so"</i><br><i>loadmodule "mi_rpc.so"</i><br>

<i>loadmodule "acc.so"</i><br><i>loadmodule "dispatcher.so"</i><br><i>loadmodule "exec.so"</i><br><i>loadmodule "rtimer.so"</i><br><i>loadmodule "benchmark.so"</i><br><br>

<br><i># ----------------- setting module-specific parameters ---------------</i><br><br><br><i># ----- mi_fifo params -----</i><br><i>modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")</i><br>

<br><br><i># ----- rr params -----</i><br><i># add value to ;lr param to cope with most of the UAs</i><br><i>modparam("rr", "enable_full_lr", 1)</i><br><i># do not append from tag to the RR (no need for this script)</i><br>

<i>modparam("rr", "append_fromtag", 0)</i><br><br><br><i># ----- acc params -----</i><br><i>modparam("acc", "log_flag", 1)</i><br><i>modparam("acc", "failed_transaction_flag", 3)</i><br>

<i>modparam("acc", "log_extra", </i><br><i>    "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")</i><br><br><i># ----- tm params -----</i><br><i>modparam("tm", "fr_timer", 2000)</i><br>

<i>modparam("tm", "fr_inv_timer", 40000)</i><br><br><i># ----- dispatcher params -----</i><br><i>modparam("dispatcher", "list_file", "/home/ubuntu/Downloads/dispatcher.list")</i><br>

<i>modparam("dispatcher", "flags", 2)</i><br><i>modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")</i><br><i>modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")</i><br>

<i>modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")</i><br><br><i># ----- xlog params -----</i><br><i>modparam("xlog", "buf_size", 8192)</i><br><i>modparam("xlog", "log_facility", "LOG_LOCAL0")</i><br>

<br><i># ----- rtimer params -----</i><br><i>modparam("rtimer", "timer", "name=ta;interval=1;mode=1;")</i><br><i>modparam("rtimer", "exec", "timer=ta;route=8")</i><br>

<br><br><i>####### Routing Logic ########</i><br><br><br><i># main request routing logic</i><br><i>route {</i><br><i>    ...</i><br></blockquote></div><blockquote><i>    # calls various routing blocks, but no explicit call to route("8")</i><br>

</blockquote><div><blockquote><br><i>}</i><br><br><i>route[8] {</i><br><i>    # to be executed on timer    </i><br><i>    xplog("L_ALERT","hello");</i><br><i>}</i><br></blockquote><br></div></div>