]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11995: [mod_fifo, mod_directory] Fix database availability check.
authorAndrey Volk <andywolk@gmail.com>
Mon, 26 Aug 2019 21:13:10 +0000 (01:13 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 26 Aug 2019 21:13:10 +0000 (01:13 +0400)
src/mod/applications/mod_directory/mod_directory.c
src/mod/applications/mod_fifo/mod_fifo.c

index 1e19adb6f7013cfdabf7db62a6b4a938d0686365..3046558c5d297703eed092cde8fe46b92a4236dc 100644 (file)
@@ -468,10 +468,10 @@ static switch_status_t load_config(switch_bool_t reload)
                        char *val = (char *) switch_xml_attr_soft(param, "value");
 
                        if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
-                               if (switch_database_available(val)) {
+                               if (switch_database_available(val) == SWITCH_STATUS_SUCCESS) {
                                        switch_set_string(globals.odbc_dsn, val);
                                } else {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DATABASE IS NOT AVAILABLE!\n");
                                }
                        } else if (!strcasecmp(var, "dbname") && !zstr(val)) {
                                globals.dbname = switch_core_strdup(globals.pool, val);
index 8749eb84863fe149d968afd80c030fca0680f46c..1087427b36f0f224985088411d6fd14afb541c18 100644 (file)
@@ -4392,10 +4392,10 @@ static switch_status_t read_config_file(switch_xml_t *xml, switch_xml_t *cfg) {
                        if (!strcasecmp(var, "outbound-strategy") && !zstr(val)) {
                                globals.default_strategy = parse_strategy(val);
                        } else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
-                               if (switch_database_available(val)) {
+                               if (switch_database_available(val) == SWITCH_STATUS_SUCCESS) {
                                        switch_set_string(globals.odbc_dsn, val);
                                } else {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DATABASE IS NOT AVAILABLE!\n");
                                }
                        } else if (!strcasecmp(var, "dbname") && !zstr(val)) {
                                globals.dbname = switch_core_strdup(globals.pool, val);