mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add core-db-pre-trans-execute and core-db-post-trans-execute to switch.conf.xml to wrap sql stmts around the core transactions
This commit is contained in:
@@ -731,6 +731,14 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_
|
||||
|
||||
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) {
|
||||
@@ -810,6 +818,14 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_
|
||||
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;
|
||||
|
Reference in New Issue
Block a user