Merge pull request #1805 in FS/freeswitch from bugfix/FS-11995-err-mod_fifo.c-4398-odbc-is-not-available to master
* commit 'fd2f12cf94c4445843a299ef8b87ce2d15d77072': FS-11995: [mod_fifo, mod_directory] Fix database availability check.
This commit is contained in:
commit
1583740133
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue