Rename res_mysql.conf to res_config_mysql.conf, make module support both
authorRussell Bryant <russell@russellbryant.com>
Tue, 30 Jun 2009 17:15:09 +0000 (17:15 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 30 Jun 2009 17:15:09 +0000 (17:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204422 65c4cc65-6c06-0410-ace0-fbb531ad65f3

addons/res_config_mysql.c
configs/res_config_mysql.conf.sample [moved from configs/res_mysql.conf.sample with 100% similarity]

index 2cd1fa4..76a7416 100644 (file)
@@ -47,7 +47,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/utils.h"
 #include "asterisk/threadstorage.h"
 
-#define RES_CONFIG_MYSQL_CONF "res_mysql.conf"
+#define RES_CONFIG_MYSQL_CONF "res_config_mysql.conf"
+#define RES_CONFIG_MYSQL_CONF_OLD "res_mysql.conf"
 #define        READHANDLE      0
 #define        WRITEHANDLE     1
 
@@ -1413,6 +1414,11 @@ static int parse_config(int reload)
        struct mysql_conn *cur;
 
        if ((config = ast_config_load(RES_CONFIG_MYSQL_CONF, config_flags)) == CONFIG_STATUS_FILEMISSING) {
+               /* Support old config file name */
+               config = ast_config_load(RES_CONFIG_MYSQL_CONF_OLD, config_flags);
+       }
+
+       if (config == CONFIG_STATUS_FILEMISSING) {
                return 0;
        } else if (config == CONFIG_STATUS_FILEUNCHANGED) {
                return 0;