Browse Source

remove ipban hash and fix type (var =/= avp)

3.19
karl anderson 11 years ago
parent
commit
87018ca6c0
2 changed files with 4 additions and 13 deletions
  1. +1
    -10
      kamailio/antiflood-role.cfg
  2. +3
    -3
      kamailio/registrar-role.cfg

+ 1
- 10
kamailio/antiflood-role.cfg View File

@ -5,8 +5,7 @@
#!trydef ANTIFLOOD_FAILED_AUTH_DENSITY 3
######## Flood Prevention Hash Tables ########
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
modparam("htable", "htable", "failed_auth_hash=>size=8;autoexpire=125;")
modparam("htable", "htable", "failed_auth_hash=>size=8;autoexpire=3600;")
######## Flood Prevention Module ########
loadmodule "pike.so"
@ -21,17 +20,9 @@ route[ANTIFLOOD_RATE_LIMIT]
return;
}
if($sht(ipban=>$si)!=$null) {
# ip is already blocked
xlog("$ci|log|dropping $rm request from $fu with banned IP $si:$sp");
drop();
exit;
}
# use pike to control the rates
if (!pike_check_req()) {
xlog("L_WARN", "$ci|log|pike dropping $rm from $fu due to rate of requests with source $si:$sp");
$sht(ipban=>$si) = 1;
drop();
exit;
}


+ 3
- 3
kamailio/registrar-role.cfg View File

@ -102,9 +102,9 @@ route[ATTEMPT_AUTHORIZATION]
exit;
}
if ($kzR != $null) {
xlog("L_DBG", "$ci|log|caching SIP credentials for $Au");
$sht(auth_cache=>$Au) = $avp(password);
if ($sht(auth_cache=>$Au) == $null) {
xlog("L_INFO", "$ci|log|caching SIP credentials for $Au");
$sht(auth_cache=>$Au) = $var(password);
}
# user authenticated - remove auth header


Loading…
Cancel
Save