From d98cbd86428b9d33924d12382cf24eef7e0390ec Mon Sep 17 00:00:00 2001 From: russell Date: Tue, 30 Jun 2009 17:10:45 +0000 Subject: [PATCH] Rename mysql.conf to app_mysql.conf, make module support both names git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204419 f38db490-d61c-443f-a65b-d21fe96a405b --- addons/app_mysql.c | 8 +++++++- configs/{mysql.conf.sample => app_mysql.conf.sample} | 0 2 files changed, 7 insertions(+), 1 deletion(-) rename configs/{mysql.conf.sample => app_mysql.conf.sample} (100%) diff --git a/addons/app_mysql.c b/addons/app_mysql.c index db33c11cb..3bc027b5e 100644 --- a/addons/app_mysql.c +++ b/addons/app_mysql.c @@ -92,7 +92,8 @@ exten => s,9,MYSQL(Disconnect ${connid}) AST_MUTEX_DEFINE_STATIC(_mysql_mutex); -#define MYSQL_CONFIG "mysql.conf" +#define MYSQL_CONFIG "app_mysql.conf" +#define MYSQL_CONFIG_OLD "mysql.conf" #define AST_MYSQL_ID_DUMMY 0 #define AST_MYSQL_ID_CONNID 1 #define AST_MYSQL_ID_RESID 2 @@ -586,6 +587,11 @@ static int load_module(void) struct ast_config *cfg = ast_config_load(MYSQL_CONFIG, config_flags); const char *temp; + if (!cfg) { + /* Backwards compatibility ftw */ + cfg = ast_config_load(MYSQL_CONFIG_OLD, config_flags); + } + if (cfg) { if ((temp = ast_variable_retrieve(cfg, "general", "nullvalue"))) { if (!strcasecmp(temp, "nullstring")) { diff --git a/configs/mysql.conf.sample b/configs/app_mysql.conf.sample similarity index 100% rename from configs/mysql.conf.sample rename to configs/app_mysql.conf.sample