diff --git a/src/mod/applications/mod_cidlookup/mod_cidlookup.c b/src/mod/applications/mod_cidlookup/mod_cidlookup.c index 4e52049784..269853eb11 100755 --- a/src/mod/applications/mod_cidlookup/mod_cidlookup.c +++ b/src/mod/applications/mod_cidlookup/mod_cidlookup.c @@ -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; diff --git a/src/mod/applications/mod_easyroute/mod_easyroute.c b/src/mod/applications/mod_easyroute/mod_easyroute.c index a58bb711c3..8a21a2230c 100644 --- a/src/mod/applications/mod_easyroute/mod_easyroute.c +++ b/src/mod/applications/mod_easyroute/mod_easyroute.c @@ -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"); } } diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index 7718f66952..4e85a11d42 100755 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -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; diff --git a/src/mod/applications/mod_nibblebill/mod_nibblebill.c b/src/mod/applications/mod_nibblebill/mod_nibblebill.c index 616b423cb2..58ebd146f8 100755 --- a/src/mod/applications/mod_nibblebill/mod_nibblebill.c +++ b/src/mod/applications/mod_nibblebill/mod_nibblebill.c @@ -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; }