Browse Source

simplify init deferred

update-rsyslog-config
lazedo 7 years ago
parent
commit
a521a823fe
4 changed files with 34 additions and 35 deletions
  1. +0
    -20
      kamailio/custom-init.cfg
  2. +22
    -1
      kamailio/default.cfg
  3. +0
    -13
      kamailio/presence-custom-cleanup.cfg
  4. +12
    -1
      kamailio/presence-notify.cfg

+ 0
- 20
kamailio/custom-init.cfg View File

@ -1,20 +0,0 @@
######## async operations module ########
loadmodule "async.so"
modparam("async", "workers", 5)
event_route[core:worker-one-init]
{
async_route("DEFERRED_INIT", "20");
}
route[DEFERRED_INIT]
{
xlog("L_INFO", "processing deferred init\n");
#!ifdef PRESENCE_ROLE
route(PRESENCE_INITIAL_CLEANUP);
#!endif
}

+ 22
- 1
kamailio/default.cfg View File

@ -160,6 +160,10 @@ modparam("htable", "htable", "redirects=>size=16;autoexpire=5")
######## Pseudo-Variables module ########
loadmodule "pv.so"
######## async operations module ########
loadmodule "async.so"
modparam("async", "workers", KZ_ASYNC_WORKERS)
######## Advanced logger module ########
loadmodule "xlog.so"
@ -959,6 +963,23 @@ event_route[tm:local-request]
}
#!endif
#!import_file "custom-init.cfg"
event_route[core:worker-one-init]
{
async_route("DEFERRED_INIT", "20");
}
route[DEFERRED_INIT]
{
xlog("L_INFO", "processing deferred init\n");
#!ifdef PRESENCE_ROLE
route(PRESENCE_INITIAL_CLEANUP);
#!endif
#!import_file "custom-init.cfg"
}
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab

+ 0
- 13
kamailio/presence-custom-cleanup.cfg View File

@ -1,13 +0,0 @@
route[PRESENCE_INITIAL_CLEANUP]
{
xlog("L_INFO", "processing presence initial cleanup\n");
if (sql_xquery("cb", "select * from tmp_probe", "ra") == 1)
{
while($xavp(ra) != $null) {
xlog("L_WARNING", "processing $xavp(ra=>event) notifies for $xavp(ra=>presentity_uri)\n");
pres_refresh_watchers("$xavp(ra=>presentity_uri)", "$xavp(ra=>event)", 1);
pv_unset("$xavp(ra)");
}
}
}

+ 12
- 1
kamailio/presence-notify.cfg View File

@ -144,4 +144,15 @@ route[PRESENCE_CLEANUP]
mq_add("presence_last_notity", "$uuid(g)", "$var(Query)");
}
#!import_file "presence-custom-cleanup.cfg"
route[PRESENCE_INITIAL_CLEANUP]
{
xlog("L_INFO", "processing presence initial cleanup\n");
if (sql_xquery("cb", "select * from tmp_probe", "ra") == 1)
{
while($xavp(ra) != $null) {
xlog("L_WARNING", "processing $xavp(ra=>event) notifies for $xavp(ra=>presentity_uri)\n");
pres_refresh_watchers("$xavp(ra=>presentity_uri)", "$xavp(ra=>event)", 1);
pv_unset("$xavp(ra)");
}
}
}

Loading…
Cancel
Save