diff --git a/kamailio/custom-init.cfg b/kamailio/custom-init.cfg deleted file mode 100644 index ecd73a6..0000000 --- a/kamailio/custom-init.cfg +++ /dev/null @@ -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 - -} diff --git a/kamailio/default.cfg b/kamailio/default.cfg index 09c2d55..361575d 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -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 diff --git a/kamailio/presence-custom-cleanup.cfg b/kamailio/presence-custom-cleanup.cfg deleted file mode 100644 index 20389cf..0000000 --- a/kamailio/presence-custom-cleanup.cfg +++ /dev/null @@ -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)"); - } - } -} diff --git a/kamailio/presence-notify.cfg b/kamailio/presence-notify.cfg index 59d66bc..58f3ab5 100644 --- a/kamailio/presence-notify.cfg +++ b/kamailio/presence-notify.cfg @@ -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)"); + } + } +}