FSMOD-51
This commit is contained in:
parent
0c9bb17450
commit
b073e82b5f
|
@ -189,8 +189,7 @@ static switch_bool_t cidlookup_execute_sql_callback(char *sql, switch_core_db_ca
|
|||
switch_cache_db_handle_t *dbh = NULL;
|
||||
|
||||
if (globals.odbc_dsn && (dbh = cidlookup_get_db_handle())) {
|
||||
if (switch_cache_db_execute_sql_callback(dbh, sql, callback, (void *) cbt, err)
|
||||
== SWITCH_ODBC_FAIL) {
|
||||
if (switch_cache_db_execute_sql_callback(dbh, sql, callback, (void *) cbt, err) != SWITCH_STATUS_SUCCESS) {
|
||||
retval = SWITCH_FALSE;
|
||||
} else {
|
||||
retval = SWITCH_TRUE;
|
||||
|
|
|
@ -152,10 +152,10 @@ static switch_status_t load_config(void)
|
|||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Connected ODBC DSN: %s\n", globals.db_dsn);
|
||||
if (!globals.custom_query) {
|
||||
if (switch_odbc_handle_exec(globals.master_odbc, "select count(*) from numbers", NULL, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_odbc_handle_exec(globals.master_odbc, "select count(*) from numbers", NULL, NULL) != SWITCH_ODBC_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot find SQL Database! (Where\'s the numbers table\?\?)\n");
|
||||
}
|
||||
if (switch_odbc_handle_exec(globals.master_odbc, "select count(*) from gateways", NULL, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_odbc_handle_exec(globals.master_odbc, "select count(*) from gateways", NULL, NULL) != SWITCH_ODBC_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot find SQL Database! (Where\'s the gateways table\?\?)\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -415,7 +415,7 @@ static switch_bool_t db_check(char *sql)
|
|||
switch_cache_db_handle_t *dbh = NULL;
|
||||
|
||||
if (globals.odbc_dsn && (dbh = lcr_get_db_handle())) {
|
||||
if (switch_cache_db_execute_sql(dbh, sql, NULL) == SWITCH_ODBC_SUCCESS) {
|
||||
if (switch_cache_db_execute_sql(dbh, sql, NULL) == SWITCH_STATUS_SUCCESS) {
|
||||
ret = SWITCH_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -545,8 +545,7 @@ static switch_bool_t lcr_execute_sql_callback(char *sql, switch_core_db_callback
|
|||
switch_cache_db_handle_t *dbh = NULL;
|
||||
|
||||
if (globals.odbc_dsn && (dbh = lcr_get_db_handle())) {
|
||||
if (switch_cache_db_execute_sql_callback(dbh, sql, callback, pdata, NULL)
|
||||
== SWITCH_ODBC_FAIL) {
|
||||
if (switch_cache_db_execute_sql_callback(dbh, sql, callback, pdata, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
retval = SWITCH_FALSE;
|
||||
} else {
|
||||
retval = SWITCH_TRUE;
|
||||
|
|
|
@ -320,11 +320,13 @@ static switch_status_t bill_event(float billamount, const char *billaccount, swi
|
|||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doing update query\n[%s]\n", sql);
|
||||
|
||||
if ((status = switch_odbc_handle_exec(globals.master_odbc, sql, &stmt, NULL)) != SWITCH_ODBC_SUCCESS) {
|
||||
if (switch_odbc_handle_exec(globals.master_odbc, sql, &stmt, NULL) != SWITCH_ODBC_SUCCESS) {
|
||||
char *err_str;
|
||||
err_str = switch_odbc_handle_get_error(globals.master_odbc, stmt);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
|
||||
switch_safe_free(err_str);
|
||||
} else {
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (stmt) {
|
||||
|
@ -332,6 +334,7 @@ static switch_status_t bill_event(float billamount, const char *billaccount, swi
|
|||
}
|
||||
|
||||
switch_safe_free(dsql);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue