Browse Source

nat keepalive options

update-rsyslog-config
lazedo 7 years ago
parent
commit
b7d4f44a77
3 changed files with 19 additions and 22 deletions
  1. +1
    -1
      kamailio/presence-notify.cfg
  2. +8
    -8
      kamailio/presence-role.cfg
  3. +10
    -13
      kamailio/registrar-role.cfg

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

@ -1,5 +1,5 @@
kazoo.presence_notify = 1 descr "enable/disable sending notify callback to omnipresence" kazoo.presence_notify = 1 descr "enable/disable sending notify callback to omnipresence"
kazoo.presence_notify_timeout = 3000 descr "timeout in ms waiting for notify reply"
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" kazoo.presence_notify_log_body = 0 descr "logs the body sent in the notification"
kazoo.presence_notify_log_resp_body = 0 descr "logs the body received from notification" kazoo.presence_notify_log_resp_body = 0 descr "logs the body received from notification"
kazoo.presence_notify_log_to_table = 1 descr "logs notify/reply to active_watchers_log table" kazoo.presence_notify_log_to_table = 1 descr "logs notify/reply to active_watchers_log table"


+ 8
- 8
kamailio/presence-role.cfg View File

@ -4,19 +4,14 @@
#!trydef PRESENCE_MAX_EXPIRES 3600 #!trydef PRESENCE_MAX_EXPIRES 3600
#!trydef KZ_PRESENCE_IGNORE_STATUS_PROBE_RESP 1 #!trydef KZ_PRESENCE_IGNORE_STATUS_PROBE_RESP 1
#!trydef KZ_PRESENCE_CSEQ_OFFSET 2 #!trydef KZ_PRESENCE_CSEQ_OFFSET 2
#!trydef KZ_PRESENCE_MAX_CALL_PER_PRESENTITY 20 #!trydef KZ_PRESENCE_MAX_CALL_PER_PRESENTITY 20
#!trydef BLF_USE_SINGLE_DIALOG 1 #!trydef BLF_USE_SINGLE_DIALOG 1
#!trydef KZ_PRESENCE_AMQP_PUBLISH 0 #!trydef KZ_PRESENCE_AMQP_PUBLISH 0
#!trydef KZ_PRESENCE_REQUEST_RESUBSCRIBE_PROBE 0 #!trydef KZ_PRESENCE_REQUEST_RESUBSCRIBE_PROBE 0
#!trydef KZ_PRESENCE_REQUEST_PROBE 1 #!trydef KZ_PRESENCE_REQUEST_PROBE 1
#!trydef KZ_PRESENCE_NO_TARGETS_LOG_LEVEL L_DBG #!trydef KZ_PRESENCE_NO_TARGETS_LOG_LEVEL L_DBG
#!trydef KZ_PRESENCE_KEEPALIVE_UDP_ONLY 0
modparam("htable", "htable", "p=>size=32;autoexpire=3600;") modparam("htable", "htable", "p=>size=32;autoexpire=3600;")
modparam("htable", "htable", "first=>size=32;autoexpire=3600;initval =0;updateexpire=1;") modparam("htable", "htable", "first=>size=32;autoexpire=3600;initval =0;updateexpire=1;")
@ -76,6 +71,7 @@ kazoo.presence_request_resubscribe_probe = KZ_PRESENCE_REQUEST_RESUBSCRIBE_PROBE
kazoo.presence_ignore_status_probe_resp = KZ_PRESENCE_IGNORE_STATUS_PROBE_RESP descr "ignore online/offline probe replies" kazoo.presence_ignore_status_probe_resp = KZ_PRESENCE_IGNORE_STATUS_PROBE_RESP descr "ignore online/offline probe replies"
kazoo.presence_max_call_per_presentity = KZ_PRESENCE_MAX_CALL_PER_PRESENTITY descr "max number of calls per presentity" kazoo.presence_max_call_per_presentity = KZ_PRESENCE_MAX_CALL_PER_PRESENTITY descr "max number of calls per presentity"
kazoo.presence_no_targets_log_level = KZ_PRESENCE_NO_TARGETS_LOG_LEVEL descr "when a presence event is received and there no targets we can log at another level" kazoo.presence_no_targets_log_level = KZ_PRESENCE_NO_TARGETS_LOG_LEVEL descr "when a presence event is received and there no targets we can log at another level"
kazoo.presence_keepalive_udp_only = KZ_PRESENCE_KEEPALIVE_UDP_ONLY descr "should we keepalive nat phones for udp only"
#!include_file "presence-query.cfg" #!include_file "presence-query.cfg"
#!include_file "presence-notify.cfg" #!include_file "presence-notify.cfg"
@ -87,8 +83,12 @@ kazoo.presence_no_targets_log_level = KZ_PRESENCE_NO_TARGETS_LOG_LEVEL descr "wh
#!ifdef NAT_TRAVERSAL_ROLE #!ifdef NAT_TRAVERSAL_ROLE
route[PRESENCE_NAT] route[PRESENCE_NAT]
{ {
if (isflagset(FLT_NATS) && proto==UDP) {
nat_keepalive();
if (isflagset(FLT_NATS)) {
if(!( ($sel(cfg_get.kazoo.presence_keepalive_udp_only) == 1 && $proto != "udp")
|| ($proto =="ws" || $proto == "wss")
)) {
nat_keepalive();
}
} }
} }
#!endif #!endif


+ 10
- 13
kamailio/registrar-role.cfg View File

@ -16,19 +16,16 @@
#!trydef REGISTRAR_CONTACT_MAX_SIZE 2048 #!trydef REGISTRAR_CONTACT_MAX_SIZE 2048
#!trydef REGISTRAR_QUERY_TIMEOUT_MS 2500 #!trydef REGISTRAR_QUERY_TIMEOUT_MS 2500
#!trydef REGISTRAR_HANDLE_LOST_TCP 1 #!trydef REGISTRAR_HANDLE_LOST_TCP 1
#!trydef REGISTRAR_CLOSE_EXPIRED_TCP 1 #!trydef REGISTRAR_CLOSE_EXPIRED_TCP 1
#!trydef REGISTRAR_HANDLE_EXPIRED_TCP 1 #!trydef REGISTRAR_HANDLE_EXPIRED_TCP 1
#!trydef REGISTRAR_HANDLE_EXPIRED_UDP 0 #!trydef REGISTRAR_HANDLE_EXPIRED_UDP 0
#!trydef REGISTRAR_HANDLE_EXPIRED_TLS 1 #!trydef REGISTRAR_HANDLE_EXPIRED_TLS 1
#!trydef REGISTRAR_HANDLE_EXPIRED_WS 1 #!trydef REGISTRAR_HANDLE_EXPIRED_WS 1
#!trydef REGISTRAR_FORCE_QUERY 0 #!trydef REGISTRAR_FORCE_QUERY 0
#!trydef REGISTRAR_FORCE_FAILOVER 0 #!trydef REGISTRAR_FORCE_FAILOVER 0
#!trydef REGISTRAR_CHECK_AMQP_AVAILABILITY 1 #!trydef REGISTRAR_CHECK_AMQP_AVAILABILITY 1
#!trydef KZ_REGISTRAR_KEEPALIVE_UDP_ONLY 0
######## Generic Hash Table container in shared memory ######## ######## Generic Hash Table container in shared memory ########
modparam("htable", "htable", "auth_cache=>size=16;autoexpire=7200;") modparam("htable", "htable", "auth_cache=>size=16;autoexpire=7200;")
@ -84,21 +81,18 @@ modparam("registrar", "received_param", "")
modparam("registrar", "xavp_rcd", "ulrcd") modparam("registrar", "xavp_rcd", "ulrcd")
modparam("registrar", "contact_max_size", REGISTRAR_CONTACT_MAX_SIZE) 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_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" 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_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_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_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_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_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_failover = REGISTRAR_FORCE_FAILOVER descr "force failover if 1"
kazoo.registrar_force_query = REGISTRAR_FORCE_QUERY descr "force query 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_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 ######## ####### Registrar Logic ########
@ -113,7 +107,8 @@ route[REGISTRAR_NAT]
if (!($ua =~ "Linksys/SPA8000" if (!($ua =~ "Linksys/SPA8000"
|| $ua =~ "SIPp" || $ua =~ "SIPp"
|| (af==INET6) || (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") || ($(xavp(ulattrs=>custom_channel_vars){kz.json,Keep-Alive}) == "false")
)) { )) {
xlog("L_DEBUG", "$ci|log|set nat pinging\n"); xlog("L_DEBUG", "$ci|log|set nat pinging\n");
@ -196,7 +191,7 @@ route[HANDLE_REGISTER]
failure_route[KZ_AUTHORIZATION_TIMEOUT] 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(); t_drop();
} }
@ -404,12 +399,14 @@ route[REGISTRAR_BOUNDS]
} }
if($var(expires) != 0) { 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"); 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"); append_to_reply("Min-Expires: $def(REGISTRAR_MIN_EXPIRES)\r\n");
send_reply("423", "Interval Too Brief"); send_reply("423", "Interval Too Brief");
exit; 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");
} }
} }
} }


Loading…
Cancel
Save