Skip to content

Commit

Permalink
etc/kamailio.cfg: use of htable guarded by own ifdef
Browse files Browse the repository at this point in the history
- allows independent loading for extending (e.g., store items to fix
  in-dialog routing)
  • Loading branch information
miconda committed Jun 17, 2022
1 parent a21bf23 commit 2620a22
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion etc/kamailio.cfg
Expand Up @@ -93,6 +93,9 @@
# block if more than 16 requests in 2 seconds and ban for 300 seconds)
# - define WITH_ANTIFLOOD
#
# *** To load htable module execute:
# - define WITH_HTABLE
#
# *** To block 3XX redirect replies execute:
# - define WITH_BLOCK3XX
#
Expand Down Expand Up @@ -148,6 +151,11 @@ import_file "kamailio-local.cfg"
#!define MULTIDOMAIN 0
#!endif

#!ifdef WITH_ANTIFLOOD
# - hash table 'ipban' used to store blocked IP addresses
#!trydef WITH_HTABLE
#!endif

# - flags
# FLT_ - per transaction (message) flags
#!define FLT_ACC 1
Expand Down Expand Up @@ -315,8 +323,11 @@ loadmodule "rtpproxy.so"
loadmodule "tls.so"
#!endif

#!ifdef WITH_ANTIFLOOD
#!ifdef WITH_HTABLE
loadmodule "htable.so"
#!endif

#!ifdef WITH_ANTIFLOOD
loadmodule "pike.so"
#!endif

Expand Down Expand Up @@ -482,11 +493,15 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
modparam("pike", "sampling_time_unit", 2)
modparam("pike", "reqs_density_per_unit", 16)
modparam("pike", "remove_latency", 4)
#!endif

#!ifdef WITH_HTABLE
# ----- htable params -----
#!ifdef WITH_ANTIFLOOD
/* ip ban htable with autoexpire after 5 minutes */
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
#!endif
#!endif

#!ifdef WITH_DEBUG
# ----- debugger params -----
Expand Down

0 comments on commit 2620a22

Please sign in to comment.