Module: sip-router Branch: master Commit: ecd3a8bab1e402435aea213c2ae7df2f55a59202 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ecd3a8ba...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Aug 18 11:01:46 2010 +0200
kamailio.cfg: db_url parameters are set via defined DBURL ID
- one value to be updated in order to change DB connectivity URL, i.e.,
#!define DBURL "mysql://openser:openserrw@localhost/openser" modparam("xyz", "db_url", DBURL)
---
etc/kamailio.cfg | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg index e4de392..5bff832 100644 --- a/etc/kamailio.cfg +++ b/etc/kamailio.cfg @@ -64,6 +64,12 @@ ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT ''; #!endif
+# *** Value defines - IDs used later in config +#!ifdef WITH_MYSQL +# - database URL - used to connect to database server by modules such +# as: auth_db, acc, usrloc, a.s.o. +#!define DBURL "mysql://openser:openserrw@localhost/openser" +#!endif
####### Global Parameters #########
@@ -228,8 +234,7 @@ modparam("acc", "log_extra", #!ifdef WITH_ACCDB modparam("acc", "db_flag", 1) modparam("acc", "db_missed_flag", 2) -modparam("acc", "db_url", - "mysql://openser:openserrw@localhost/openser") +modparam("acc", "db_url", DBURL) modparam("acc", "db_extra", "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd") #!endif @@ -237,9 +242,8 @@ modparam("acc", "db_extra", # ----- usrloc params ----- /* enable DB persistency for location entries */ #!ifdef WITH_USRLOCDB -modparam("usrloc", "db_mode", 2) -modparam("usrloc", "db_url", - "mysql://openser:openserrw@localhost/openser") +modparam("usrloc", "db_mode", 2) +modparam("usrloc", "db_url", DBURL) #!endif
# ----- auth_db params ----- @@ -247,13 +251,11 @@ modparam("usrloc", "db_url", #!ifdef WITH_AUTH modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") -modparam("auth_db", "db_url", - "mysql://openser:openserrw@localhost/openser") +modparam("auth_db", "db_url", DBURL) modparam("auth_db", "load_credentials", "")
#!ifdef WITH_IPAUTH -modparam("permissions", "db_url", - "mysql://openser:openserrw@localhost/openser") +modparam("permissions", "db_url", DBURL) modparam("permissions", "db_mode", 1) #!endif
@@ -262,15 +264,13 @@ modparam("permissions", "db_mode", 1) # ----- alias_db params ----- /* uncomment the following lines if you want to enable the DB based aliases */ -#modparam("alias_db", "db_url", -# "mysql://openser:openserrw@localhost/openser") +#modparam("alias_db", "db_url", DBURL)
# ----- domain params ----- /* uncomment the following lines to enable multi-domain detection support */ -#modparam("domain", "db_url", -# "mysql://openser:openserrw@localhost/openser") +#modparam("domain", "db_url", DBURL) #modparam("domain", "db_mode", 1) # Use caching
@@ -283,8 +283,7 @@ modparam("permissions", "db_mode", 1) # ----- presence params ----- /* enable presence server support */ #!ifdef WITH_PRESENCE -modparam("presence|presence_xml", "db_url", - "mysql://openser:openserrw@localhost/openser") +modparam("presence|presence_xml", "db_url", DBURL) modparam("presence_xml", "force_active", 1) modparam("presence", "server_address", "sip:10.0.0.10:5060") #!endif