Browse code

etc/kamailio.cfg: use of htable guarded by own ifdef

- allows independent loading for extending (e.g., store items to fix
in-dialog routing)

Daniel-Constantin Mierla authored on 17/06/2022 07:15:27
Showing 1 changed files
... ...
@@ -93,6 +93,9 @@
93 93
 #       block if more than 16 requests in 2 seconds and ban for 300 seconds)
94 94
 #     - define WITH_ANTIFLOOD
95 95
 #
96
+# *** To load htable module execute:
97
+#     - define WITH_HTABLE
98
+#
96 99
 # *** To block 3XX redirect replies execute:
97 100
 #     - define WITH_BLOCK3XX
98 101
 #
... ...
@@ -148,6 +151,11 @@ import_file "kamailio-local.cfg"
148 151
 #!define MULTIDOMAIN 0
149 152
 #!endif
150 153
 
154
+#!ifdef WITH_ANTIFLOOD
155
+# - hash table 'ipban' used to store blocked IP addresses
156
+#!trydef WITH_HTABLE
157
+#!endif
158
+
151 159
 # - flags
152 160
 #   FLT_ - per transaction (message) flags
153 161
 #!define FLT_ACC 1
... ...
@@ -315,8 +323,11 @@ loadmodule "rtpproxy.so"
315 323
 loadmodule "tls.so"
316 324
 #!endif
317 325
 
318
-#!ifdef WITH_ANTIFLOOD
326
+#!ifdef WITH_HTABLE
319 327
 loadmodule "htable.so"
328
+#!endif
329
+
330
+#!ifdef WITH_ANTIFLOOD
320 331
 loadmodule "pike.so"
321 332
 #!endif
322 333
 
... ...
@@ -482,11 +493,15 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
482 493
 modparam("pike", "sampling_time_unit", 2)
483 494
 modparam("pike", "reqs_density_per_unit", 16)
484 495
 modparam("pike", "remove_latency", 4)
496
+#!endif
485 497
 
498
+#!ifdef WITH_HTABLE
486 499
 # ----- htable params -----
500
+#!ifdef WITH_ANTIFLOOD
487 501
 /* ip ban htable with autoexpire after 5 minutes */
488 502
 modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
489 503
 #!endif
504
+#!endif
490 505
 
491 506
 #!ifdef WITH_DEBUG
492 507
 # ----- debugger params -----