@ -16,19 +16,16 @@
#!trydef REGISTRAR_CONTACT_MAX_SIZE 2048
#!trydef REGISTRAR_QUERY_TIMEOUT_MS 2500
#!trydef REGISTRAR_HANDLE_LOST_TCP 1
#!trydef REGISTRAR_CLOSE_EXPIRED_TCP 1
#!trydef REGISTRAR_HANDLE_EXPIRED_TCP 1
#!trydef REGISTRAR_HANDLE_EXPIRED_UDP 0
#!trydef REGISTRAR_HANDLE_EXPIRED_TLS 1
#!trydef REGISTRAR_HANDLE_EXPIRED_WS 1
#!trydef REGISTRAR_FORCE_QUERY 0
#!trydef REGISTRAR_FORCE_FAILOVER 0
#!trydef REGISTRAR_CHECK_AMQP_AVAILABILITY 1
#!trydef KZ_REGISTRAR_KEEPALIVE_UDP_ONLY 0
######## Generic Hash Table container in shared memory ########
modparam("htable", "htable", "auth_cache = >size=16;autoexpire=7200;")
@ -84,21 +81,18 @@ modparam("registrar", "received_param", "")
modparam("registrar", "xavp_rcd", "ulrcd")
modparam("registrar", "contact_max_size", REGISTRAR_CONTACT_MAX_SIZE)
##### registrar realtime params #####
kazoo.registrar_error_min_expires = REGISTRAR_ERROR_MIN_EXPIRES descr "send error when UAS sends expires < min-expires"
kazoo.registrar_error_missing_expires = REGISTRAR_ERROR_MISSING_EXPIRES descr "send error when UAS do not send expires header"
##### handle expired registrations realtime params #####
kazoo.registrar_handle_expired_tcp = REGISTRAR_HANDLE_EXPIRED_TCP descr "handles expired tcp registrations"
kazoo.registrar_handle_expired_udp = REGISTRAR_HANDLE_EXPIRED_UDP descr "handles expired udp registrations"
kazoo.registrar_handle_expired_tls = REGISTRAR_HANDLE_EXPIRED_TLS descr "handles expired tls registrations"
kazoo.registrar_handle_expired_ws = REGISTRAR_HANDLE_EXPIRED_WS descr "handles expired ws registrations"
kazoo.registrar_query_timeout_ms = REGISTRAR_QUERY_TIMEOUT_MS descr "timeout waiting for reply from registrar"
kazoo.registrar_failover = REGISTRAR_FORCE_FAILOVER descr "force failover if 1"
kazoo.registrar_force_query = REGISTRAR_FORCE_QUERY descr "force query if 1"
kazoo.registrar_check_amqp_availability = REGISTRAR_CHECK_AMQP_AVAILABILITY descr "checks if amqp connection is available before querying registrar"
kazoo.registrar_keepalive_udp_only = KZ_REGISTRAR_KEEPALIVE_UDP_ONLY descr "should we keepalive nat phones for udp only"
####### Registrar Logic ########
@ -113,7 +107,8 @@ route[REGISTRAR_NAT]
if (!($ua = ~ "Linksys/SPA8000"
|| $ua = ~ "SIPp"
|| (af = =INET6)
|| (proto! = UDP)
|| ($sel(cfg_get.kazoo.registrar_keepalive_udp_only) = = 1 && $proto != "udp")
|| ($proto = ="ws" || $proto == "wss")
|| ($(xavp(ulattrs = >custom_channel_vars){kz.json,Keep-Alive}) == "false")
)) {
xlog("L_DEBUG", "$ci|log|set nat pinging\n");
@ -196,7 +191,7 @@ route[HANDLE_REGISTER]
failure_route[KZ_AUTHORIZATION_TIMEOUT]
{
xlog("L_INFO", "$ci|log|failed $T_reply_code to query Kazoo for authentication credentials for $Au $si:$sp\n");
xlog("L_INFO", "$ci|end|failed $T_reply_code querying directory for authentication credentials for $Au $si:$sp\n");
t_drop();
}
@ -404,12 +399,14 @@ route[REGISTRAR_BOUNDS]
}
if($var(expires) ! = 0) {
if($sel(cfg_get.kazoo.registrar_error_min_expires) = = 1 ) {
if($var(expires) < REGISTRAR_MIN_EXPIRES ) {
if($var(expires) < REGISTRAR_MIN_EXPIRES ) {
if($sel(cfg_get.kazoo.registrar_error_min_expires) = = 1 ) {
xlog("L_WARNING", "$ci|end|expires $var(expires) too brief (configured $def(REGISTRAR_MIN_EXPIRES)) registering $Au from IP $si:$sp\n");
append_to_reply("Min-Expires: $def(REGISTRAR_MIN_EXPIRES)\r\n");
send_reply("423", "Interval Too Brief");
exit;
} else {
xlog("L_WARNING", "$ci|end|allowing expires $var(expires) too brief (configured $def(REGISTRAR_MIN_EXPIRES)) registering $Au from IP $si:$sp\n");
}
}
}