Browse Source

remove watchers on registration expiration

update-rsyslog-config
lazedo 7 years ago
parent
commit
73f4875d21
2 changed files with 19 additions and 1 deletions
  1. +15
    -1
      kamailio/presence-notify.cfg
  2. +4
    -0
      kamailio/registrar-role.cfg

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

@ -1,3 +1,5 @@
#!trydef KZ_PRESENCE_REMOVE_WATCHER_ON_EXPIRED_REGISTRATION 1
kazoo.presence_notify = 1 descr "enable/disable sending notify callback to omnipresence"
kazoo.presence_notify_timeout = 3500 descr "timeout in ms waiting for notify reply"
kazoo.presence_notify_log_body = 0 descr "logs the body sent in the notification"
@ -7,6 +9,7 @@ kazoo.presence_notify_log_to_amqp = 0 descr "logs notify/reply to amqp"
kazoo.presence_notify_record_route = 1 descr "add record route header to notify msg sent"
kazoo.presence_notify_log_init_body = 0 descr "logs the body before its sent"
kazoo.presence_notify_force_send_socket = 1 descr "forces the send socket to the contact"
kazoo.presence_remove_watcher_on_expired_registration = KZ_PRESENCE_REMOVE_WATCHER_ON_EXPIRED_REGISTRATION descr "removes watcher on expired registration"
######## Generic Hash Table container in shared memory ########
modparam("htable", "htable", "notify=>size=16;autoexpire=3600;updateexpire=1;initval=0")
@ -191,4 +194,15 @@ route[PRESENCE_DEFERRED_INIT]
xlog("L_NOTICE", "scheduled update for $var(nrows) watched presentities/event\n");
}
}
}
}
route[PRESENCE_EXPIRED_REGISTRATION]
{
if($sel(cfg_get.kazoo.presence_remove_watcher_on_expired_registration) == 1) {
$var(watcher) = $_s(sip:$ulc(exp=>aor));
$var(watcher_username) = $(var(watcher){uri.user});
$var(watcher_domain) = $(var(watcher){uri.host});
$var(Query) = $_s(DELETE FROM active_watchers WHERE watcher_username = "$var(watcher_username)" and watcher_domain = "$var(watcher_domain)";);
mq_add("presence_last_notity", "$uuid(g)", "$var(Query)");
}
}

+ 4
- 0
kamailio/registrar-role.cfg View File

@ -444,6 +444,10 @@ route[REGISTRAR_BOUNDS]
##
event_route[usrloc:contact-expired]
{
#!ifdef PRESENCE_ROLE
route(PRESENCE_EXPIRED_REGISTRATION);
#!endif
## return until we handle this in ecallmr
xlog("L_INFO", "$ulc(exp=>callid)|expired|removed registration for $ulc(exp=>aor) with contact : $ulc(exp=>addr)\n");
return;


Loading…
Cancel
Save