[sr-dev] git:master:2620a22d: etc/kamailio.cfg: use of htable guarded by own ifdef

Daniel-Constantin Mierla miconda at gmail.com
Fri Jun 17 09:17:26 CEST 2022


Module: kamailio
Branch: master
Commit: 2620a22d8793f7e40b10765d46dba952adb677bf
URL: https://github.com/kamailio/kamailio/commit/2620a22d8793f7e40b10765d46dba952adb677bf

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-06-17T09:15:27+02:00

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

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

---

Modified: etc/kamailio.cfg

---

Diff:  https://github.com/kamailio/kamailio/commit/2620a22d8793f7e40b10765d46dba952adb677bf.diff
Patch: https://github.com/kamailio/kamailio/commit/2620a22d8793f7e40b10765d46dba952adb677bf.patch

---

diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index 2333eacacc3..eb41c14d41f 100644
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -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
 #
@@ -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
@@ -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
 
@@ -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 -----




More information about the sr-dev mailing list