uint32_t db_handle_timeout;
int cpu_count;
uint32_t time_sync;
+ char *core_db_pre_trans_execute;
+ char *core_db_post_trans_execute;
};
extern struct switch_runtime runtime;
switch_set_flag((&runtime), SCF_EARLY_HANGUP);
} else if (!strcasecmp(var, "colorize-console") && switch_true(val)) {
runtime.colorize_console = SWITCH_TRUE;
+ } else if (!strcasecmp(var, "core-db-pre-trans-execute") && !zstr(val)) {
+ runtime.core_db_pre_trans_execute = switch_core_strdup(runtime.memory_pool, val);
+ } else if (!strcasecmp(var, "core-db-post-trans-execute") && !zstr(val)) {
+ runtime.core_db_post_trans_execute = switch_core_strdup(runtime.memory_pool, val);
} else if (!strcasecmp(var, "mailer-app") && !zstr(val)) {
runtime.mailer_app = switch_core_strdup(runtime.memory_pool, val);
} else if (!strcasecmp(var, "mailer-app-args") && val) {
if (io_mutex) switch_mutex_lock(io_mutex);
+ if (!zstr(runtime.core_db_pre_trans_execute)) {
+ switch_cache_db_execute_sql_real(dbh, runtime.core_db_pre_trans_execute, &errmsg);
+ if (errmsg) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL PRE TRANS EXEC [%s]\n", errmsg);
+ free(errmsg);
+ }
+ }
+
again:
while (begin_retries > 0) {
switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 1);
}
+ if (!zstr(runtime.core_db_post_trans_execute)) {
+ switch_cache_db_execute_sql_real(dbh, runtime.core_db_post_trans_execute, &errmsg);
+ if (errmsg) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL POST TRANS EXEC [%s]\n", errmsg);
+ free(errmsg);
+ }
+ }
+
if (io_mutex) switch_mutex_unlock(io_mutex);
return status;