switch_mutex_lock(globals.mutex);
}
/* Do the Query */
- if (switch_odbc_handle_callback_exec(globals.master_odbc, sql, route_callback, &pdata) == SWITCH_ODBC_SUCCESS){
+ if (switch_odbc_handle_callback_exec(globals.master_odbc, sql, route_callback, &pdata, NULL) == SWITCH_ODBC_SUCCESS){
char tmp_profile[129];
char tmp_gateway[129];
switch_mutex_lock(globals.db_mutex);
if (globals.odbc_dsn) {
- if (switch_odbc_handle_callback_exec(globals.master_odbc, sql, callback, pdata)
+ if (switch_odbc_handle_callback_exec(globals.master_odbc, sql, callback, pdata, NULL)
== SWITCH_ODBC_FAIL) {
retval = SWITCH_FALSE;
} else {
memset(&pdata, 0, sizeof(pdata));
snprintf(sql, 1024, SQL_LOOKUP, globals.db_column_cash, globals.db_table, globals.db_column_account, billaccount);
- if (switch_odbc_handle_callback_exec(globals.master_odbc, sql, nibblebill_callback, &pdata) != SWITCH_ODBC_SUCCESS) {
+ if (switch_odbc_handle_callback_exec(globals.master_odbc, sql, nibblebill_callback, &pdata, NULL) != SWITCH_ODBC_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error running this query: [%s]\n", sql);
/* Return -1 for safety */
void do_index(switch_stream_handle_t *stream)
{
- switch_core_db_t *db = switch_core_db_handle();
+ switch_cache_db_handle_t *db;
const char *sql = "select * from channels";
struct holder holder;
char *errmsg;
+ switch_core_db_handle(&db);
+
holder.host = switch_event_get_header(stream->param_event, "http-host");
holder.port = switch_event_get_header(stream->param_event, "http-port");
holder.uri = switch_event_get_header(stream->param_event, "http-uri");
"<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
"Created", "CID Name", "CID Num", "Ext", "App", "Data", "Codec", "Rate", "Listen");
- switch_core_db_exec(db, sql, web_callback, &holder, &errmsg);
+ switch_cache_db_execute_sql_callback(db, sql, web_callback, &holder, &errmsg);
stream->write_function(stream, "</table>");