]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSMOD-51
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 25 May 2010 15:14:04 +0000 (10:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 25 May 2010 15:14:04 +0000 (10:14 -0500)
src/mod/applications/mod_cidlookup/mod_cidlookup.c
src/mod/applications/mod_easyroute/mod_easyroute.c
src/mod/applications/mod_lcr/mod_lcr.c
src/mod/applications/mod_nibblebill/mod_nibblebill.c

index 4e52049784f3add02dcd4be1f4efec61fba994dd..269853eb111f45613a84027211e88b7a2dd23563 100755 (executable)
@@ -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;
index a58bb711c393dfdba51d9dae479cdc94f595c155..8a21a2230caf0400cb17fdb9c4fe33e16698d049 100644 (file)
@@ -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");
                        }
                }
index 7718f66952a6df337918f591bd03e02d9435ae3d..4e85a11d42b46e60c0b7877f153c1dac3e8a8319 100755 (executable)
@@ -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;
index 616b423cb21ad5c54e51ba58016a6ded1bdeec77..58ebd146f885a17f0e235d1bb12e18d8617ee5e5 100755 (executable)
@@ -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;
 }