diff --git a/kamailio/keepalive.cfg b/kamailio/keepalive.cfg index 76cac86..d5f68fd 100644 --- a/kamailio/keepalive.cfg +++ b/kamailio/keepalive.cfg @@ -15,6 +15,7 @@ kazoo.keepalive_udp_only = KEEPALIVE_UDP_ONLY descr "should we send keepalive for udp only" kazoo.keepalive_nat_only = KEEPALIVE_NAT_ONLY descr "should we send keepalive for nat phones only" kazoo.keepalive_timeout = KEEPALIVE_TIMEOUT descr "timeout in ms for keepalive transaction" +kazoo.keepalive_failed_threshold = KEEPALIVE_FAILED_THRESHOLD descr "how many times can a device fail to respond to OPTIONS" kazoo.keepalive_expire_subscriptions = KEEPALIVE_EXPIRE_SUBSCRIPTIONS descr "expires subscriptions that do not respond to OPTIONS" kazoo.keepalive_expire_registrations = KEEPALIVE_EXPIRE_REGISTRATIONS descr "expires registrations that do not respond to OPTIONS" @@ -53,14 +54,14 @@ route[KEEPALIVE_CLEANUP] { lock("keepalive"); if($sel(cfg_get.kazoo.keepalive_expire_registrations) == 1) { - $var(Query) = $_s(update location set expires = last_modified where id in(select b.id from w_keepalive_contact a inner join w_location_contact b on a.contact = b.contact where slot = $rtimer_worker AND failed > $def(KEEPALIVE_FAILED_THRESHOLD))); + $var(Query) = $_s(update location set expires = last_modified where id in(select b.id from w_keepalive_contact a inner join w_location_contact b on a.contact = b.contact where slot = $rtimer_worker AND failed > $sel(cfg_get.kazoo.keepalive_failed_threshold))); sql_query("cb", "$var(Query)"); } if($sel(cfg_get.kazoo.keepalive_expire_subscriptions) == 1) { - $var(Query) = $_s(DELETE FROM active_watchers where id in(select b.id from w_keepalive_contact a inner join w_watchers_contact b on a.contact = b.contact where slot = $rtimer_worker and failed > $def(KEEPALIVE_FAILED_THRESHOLD))); + $var(Query) = $_s(DELETE FROM active_watchers where id in(select b.id from w_keepalive_contact a inner join w_watchers_contact b on a.contact = b.contact where slot = $rtimer_worker and failed > $sel(cfg_get.kazoo.keepalive_failed_threshold))); sql_query("cb", "$var(Query)"); } - $var(Query) = $_s(DELETE FROM keepalive where slot = $rtimer_worker and failed > $def(KEEPALIVE_FAILED_THRESHOLD)); + $var(Query) = $_s(DELETE FROM keepalive where slot = $rtimer_worker and failed > $sel(cfg_get.kazoo.keepalive_failed_threshold)); sql_query("cb", "$var(Query)"); unlock("keepalive"); }