提交 fd2f12cf authored 作者: Andrey Volk's avatar Andrey Volk

FS-11995: [mod_fifo, mod_directory] Fix database availability check.

上级 8c1697b9
......@@ -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);
......
......@@ -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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论