Browse Source

drop testing

drop_requests
swysor 7 years ago
parent
commit
4ba575716e
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      kamailio/registrar-role.cfg

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

@ -14,6 +14,8 @@
######## 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;")
######## Hash table container for handling drop_on_failure feature ######
modparam("htable", "htable", "dropped_reqs=>size=16;autoexpire=300;");
####### Authentication Interface module ########## ####### Authentication Interface module ##########
loadmodule "auth.so" loadmodule "auth.so"
@ -77,6 +79,12 @@ kazoo.registrar_handle_expired_ws = REGISTRAR_HANDLE_EXPIRED_WS descr "handles e
route[HANDLE_REGISTER] route[HANDLE_REGISTER]
{ {
if (is_method("REGISTER")) { if (is_method("REGISTER")) {
if ($sht(dropped_reqs=>$ci)) {
xlog("L_INFO", "$ci|log|dropping failed registration, see you in 5 minutes\n");
t_release();
drop();
exit();
}
#!ifdef NAT_TRAVERSAL_ROLE #!ifdef NAT_TRAVERSAL_ROLE
if (nat_uac_test("3")) { if (nat_uac_test("3")) {
@ -173,6 +181,7 @@ route[KAZOO_AUTHORIZATION]
} }
if(kazoo_async_query("callmgr", $var(amqp_routing_key), $var(amqp_payload_request), "KAZOO_AUTHORIZATION_OK", "KAZOO_AUTHORIZATION_ERROR") != 1) { if(kazoo_async_query("callmgr", $var(amqp_routing_key), $var(amqp_payload_request), "KAZOO_AUTHORIZATION_OK", "KAZOO_AUTHORIZATION_ERROR") != 1) {
xlog("L_INFO", "$ci|log|failed to send Kazoo query for authentication credentials for $Au $si:$sp - dropping request\n"); xlog("L_INFO", "$ci|log|failed to send Kazoo query for authentication credentials for $Au $si:$sp - dropping request\n");
$sht(dropped_reqs=>$ci) = 1;
drop(); drop();
exit; exit;
} }
@ -203,6 +212,7 @@ route[KAZOO_AUTHORIZATION_OK]
route[KAZOO_AUTHORIZATION_ERROR] route[KAZOO_AUTHORIZATION_ERROR]
{ {
xlog("L_INFO", "$ci|log|failed to query Kazoo for authentication credentials for $Au $si:$sp - dropping request\n"); xlog("L_INFO", "$ci|log|failed to query Kazoo for authentication credentials for $Au $si:$sp - dropping request\n");
$sht(dropped_reqs=>$ci) = 1;
drop(); drop();
exit; exit;
} }


Loading…
Cancel
Save