]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5314 --resolve
authorJeff Lenk <jeff@jefflenk.com>
Wed, 17 Apr 2013 14:21:14 +0000 (09:21 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Sun, 2 Jun 2013 03:38:39 +0000 (22:38 -0500)
(cherry picked from commit 40e33572b34e777deca8629bee1dc0cc3143e0ea)

src/mod/applications/mod_nibblebill/mod_nibblebill.c

index 3b5703a9e2c7811446d988ff8a07cbd47c4eb344..a16c51cdfa1bcc5a3694d29af20f5e71e923727b 100755 (executable)
@@ -174,6 +174,24 @@ static switch_bool_t nibblebill_execute_sql_callback(char *sql, switch_core_db_c
        return retval;
 }
 
+static switch_bool_t nibblebill_execute_sql(char *sql)
+{
+       switch_bool_t retval = SWITCH_FALSE;
+       switch_cache_db_handle_t *dbh = NULL;
+
+       if (globals.odbc_dsn && (dbh = nibblebill_get_db_handle())) {
+
+               if ( switch_cache_db_execute_sql(dbh, sql, NULL ) != SWITCH_STATUS_SUCCESS ) {
+                       retval = SWITCH_FALSE;
+               } else {
+                       retval = SWITCH_TRUE;
+               }
+       }
+       switch_cache_db_release_db_handle(&dbh);
+
+       return retval;
+}
+
 
 static switch_status_t nibblebill_load_config(void)
 {
@@ -354,7 +372,7 @@ static switch_bool_t bill_event(double billamount, const char *billaccount, swit
        }
 
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doing update query\n[%s]\n", sql);
-       status = nibblebill_execute_sql_callback(sql, nibblebill_callback, NULL);
+       status = nibblebill_execute_sql(sql);
        switch_safe_free(dsql);
 
        return status;