Browse Source

kamailio.cfg: alias_db lookup enabled by define

- replaced the alias_db related comments with defines
- lookup in db-aliases can be enabled now by #!define WITH_ALIASDB
Daniel-Constantin Mierla 15 năm trước cách đây
mục cha
commit
2d9a8454fe
1 tập tin đã thay đổi với 17 bổ sung9 xóa
  1. 17 9
      etc/kamailio.cfg

+ 17 - 9
etc/kamailio.cfg

@@ -47,6 +47,10 @@
 #     - set the value of pstn.gw_ip
 #     - check route[PSTN] for regexp routing condition
 #
+# *** To enable database aliases lookup execute:
+#     - enable mysql
+#     - define WITH_ALIASDB
+#
 # *** To enhance accounting execute:
 #     - enable mysql
 #     - define WITH_ACCDB
@@ -160,9 +164,11 @@ loadmodule "auth_db.so"
 loadmodule "permissions.so"
 #!endif
 #!endif
-/* uncomment next line for aliases support
-   NOTE: a DB (like db_mysql) module must be also loaded */
-#loadmodule "alias_db.so"
+
+#!ifdef WITH_ALIASDB
+loadmodule "alias_db.so"
+#!endif
+
 /* uncomment next line for multi-domain support
    NOTE: a DB (like db_mysql) module must be also loaded
    NOTE: be sure and enable multi-domain support in all used modules
@@ -262,10 +268,9 @@ modparam("permissions", "db_mode", 1)
 #!endif
 
 # ----- alias_db params -----
-/* uncomment the following lines if you want to enable the DB based
-   aliases */
-#modparam("alias_db", "db_url", DBURL)
-
+#!ifdef WITH_ALIASDB
+modparam("alias_db", "db_url", DBURL)
+#!endif
 
 # ----- domain params -----
 /* uncomment the following lines to enable multi-domain detection
@@ -460,8 +465,11 @@ route[REGISTRAR] {
 
 # USER location service
 route[LOCATION] {
-	# apply DB based aliases (uncomment to enable)
-	##alias_db_lookup("dbaliases");
+
+#!ifdef WITH_ALIASDB
+	# search in DB-based aliases
+	alias_db_lookup("dbaliases");
+#!endif
 
 	if (!lookup("location")) {
 		switch ($rc) {