char *mydata = NULL, *argv[11] = { 0 };
int argc, x;
switch_status_t status = SWITCH_STATUS_FALSE;
+ switch_core_flag_t cflags = switch_core_flags();
+
+ if (!(cflags & SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
if (string && (mydata = strdup(string))) {
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
sec = 0;
}
- if (++reg_sec == SQL_REG_TIMEOUT) {
+ if (switch_test_flag((&runtime), SCF_USE_SQL) && ++reg_sec == SQL_REG_TIMEOUT) {
switch_core_expire_registration(0);
reg_sec = 0;
}
switch_cache_db_handle_t *dbh;
char *sql;
+ if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
return SWITCH_STATUS_FALSE;
switch_cache_db_handle_t *dbh;
char *sql;
+ if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
return SWITCH_STATUS_FALSE;
char *sql;
switch_time_t now;
+ if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
return SWITCH_STATUS_FALSE;