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

Merge pull request #1805 in FS/freeswitch from…

Merge pull request #1805 in FS/freeswitch from bugfix/FS-11995-err-mod_fifo.c-4398-odbc-is-not-available to master

* commit 'fd2f12cf':
  FS-11995: [mod_fifo, mod_directory] Fix database availability check.
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论