Browse Source

use rtimer

4.2
lazedo 8 years ago
parent
commit
bc6915394e
2 changed files with 16 additions and 13 deletions
  1. +8
    -7
      kamailio/nodes-role.cfg
  2. +8
    -6
      kamailio/presence_notify_sync-role.cfg

+ 8
- 7
kamailio/nodes-role.cfg View File

@ -11,14 +11,15 @@
modparam("htable", "htable", "nodes=>size=8;initval=0;autoexpire=180"); modparam("htable", "htable", "nodes=>size=8;initval=0;autoexpire=180");
modparam("htable", "htable", "media=>size=8;initval=0;autoexpire=180"); modparam("htable", "htable", "media=>size=8;initval=0;autoexpire=180");
####### TIMER module ##########
#!ifndef TIMER_LOADED
loadmodule "timer.so"
#!trydef TIMER_LOADED
####### RTIMER module ##########
#!ifndef RTIMER_LOADED
loadmodule "rtimer.so"
#!trydef RTIMER_LOADED
#!endif #!endif
modparam("timer", "declare_timer", "NODES_ADVERTISE_TIMER=NODES_ADVERTISE_ROUTE,5000,slow,enable");
modparam("timer", "declare_timer", "NODE_TRACK_TIMER=NODE_TRACK_ROUTE,500,fast,enable");
modparam("timer", "declare_timer", "NODE_HEARTBEAT_TIMER=NODE_HEARTBEAT_ROUTE,500,fast,enable");
modparam("rtimer", "timer", "name=ta;interval=5;mode=2;")
modparam("rtimer", "exec", "timer=ta;route=NODES_ADVERTISE_ROUTE")
modparam("rtimer", "exec", "timer=ta;route=NODE_TRACK_ROUTE")
modparam("rtimer", "exec", "timer=ta;route=NODE_HEARTBEAT_ROUTE")
modparam("mqueue","mqueue", "name=node_track") modparam("mqueue","mqueue", "name=node_track")


+ 8
- 6
kamailio/presence_notify_sync-role.cfg View File

@ -35,11 +35,13 @@ route[PRESENCE_LOCAL_NOTIFY]
modparam("mqueue","mqueue", "name=presence_last_notity") modparam("mqueue","mqueue", "name=presence_last_notity")
#!ifndef TIMER_LOADED
loadmodule "timer.so"
#!trydef TIMER_LOADED
####### RTIMER module ##########
#!ifndef RTIMER_LOADED
loadmodule "rtimer.so"
#!trydef RTIMER_LOADED
#!endif #!endif
modparam("timer", "declare_timer", "PRESENCE_LOG_TIMER=PRESENCE_LOG_TIMER_ROUTE,500,fast,enable");
modparam("rtimer", "timer", "name=notifytimer;interval=500000u;mode=2;")
modparam("rtimer", "exec", "timer=notifytimer;route=PRESENCE_LOG_TIMER_ROUTE")
event_route[presence:notify-reply] event_route[presence:notify-reply]
@ -88,9 +90,9 @@ route[PRESENCE_LOG_TIMER_ROUTE]
$var(runloop) = 1; $var(runloop) = 1;
while(mq_fetch("presence_last_notity") == 1 && $var(runloop) < MAX_WHILE_LOOPS) { while(mq_fetch("presence_last_notity") == 1 && $var(runloop) < MAX_WHILE_LOOPS) {
$var(ci) = $mqk(presence_last_notity); $var(ci) = $mqk(presence_last_notity);
xlog("L_DEBUG", "Query : $mqv(presence_last_notity)");
xlog("L_DEBUG", "Query : $mqv(presence_last_notity)\n");
$var(sqlres) = sql_query("cb", "$mqv(presence_last_notity)"); $var(sqlres) = sql_query("cb", "$mqv(presence_last_notity)");
xlog("L_DEBUG", "Query result : $var(sqlres)");
xlog("L_DEBUG", "Query result : $var(sqlres)\n");
if($var(sqlres) < 0) { if($var(sqlres) < 0) {
xlog("L_ERROR", "$var(ci)|log|error updating active_watchers_log\n"); xlog("L_ERROR", "$var(ci)|log|error updating active_watchers_log\n");
} else { } else {


Loading…
Cancel
Save