/**
* initialize FS core from optional configuration dir
*/
-static switch_status_t fst_init_core_and_modload(const char *confdir, const char *basedir, int minimal)
+static switch_status_t fst_init_core_and_modload(const char *confdir, const char *basedir, int minimal, switch_core_flag_t flags)
{
switch_status_t status;
const char *err;
switch_core_set_globals();
if (!minimal) {
- status = switch_core_init_and_modload(SCF_USE_SQL, SWITCH_TRUE, &err);
+ status = switch_core_init_and_modload(flags, SWITCH_TRUE, &err);
switch_sleep(1 * 1000000);
switch_core_set_variable("sound_prefix", "." SWITCH_PATH_SEPARATOR);
if (status != SWITCH_STATUS_SUCCESS && err) {
int fst_timer_started = 0; \
fst_getenv_default("FST_SUPPRESS_UNUSED_STATIC_WARNING", NULL, SWITCH_FALSE); \
if (fst_core) { \
- fst_init_core_and_modload(NULL, NULL, 0); /* shuts up compiler */ \
+ fst_init_core_and_modload(NULL, NULL, 0, 0); /* shuts up compiler */ \
} \
{ \
* Define the beginning of a freeswitch core test driver. Only one per test application allowed.
* @param confdir directory containing freeswitch.xml configuration
*/
-#define FST_CORE_BEGIN(confdir) \
+#define FST_CORE_EX_BEGIN(confdir, flags) \
FCT_BGN() \
{ \
int fst_core = 0; \
switch_memory_pool_t *fst_pool = NULL; \
int fst_timer_started = 0; \
fst_getenv_default("FST_SUPPRESS_UNUSED_STATIC_WARNING", NULL, SWITCH_FALSE); \
- if (fst_init_core_and_modload(confdir, confdir, 0) == SWITCH_STATUS_SUCCESS) { \
+ if (fst_init_core_and_modload(confdir, confdir, 0, flags) == SWITCH_STATUS_SUCCESS) { \
fst_core = 2; \
} else { \
fprintf(stderr, "Failed to load FS core\n"); \
} \
FCT_END()
+#define FST_CORE_BEGIN(confdir) FST_CORE_EX_BEGIN(confdir, 0)
+#define FST_CORE_DB_BEGIN(confdir) FST_CORE_EX_BEGIN(confdir, SCF_USE_SQL)
+
/**
* Minimal FS core load
*/
switch_memory_pool_t *fst_pool = NULL; \
int fst_timer_started = 0; \
fst_getenv_default("FST_SUPPRESS_UNUSED_STATIC_WARNING", NULL, SWITCH_FALSE); \
- if (fst_init_core_and_modload(confdir, NULL, 1) == SWITCH_STATUS_SUCCESS) { /* minimal load */ \
+ if (fst_init_core_and_modload(confdir, NULL, 1, 0) == SWITCH_STATUS_SUCCESS) { /* minimal load */ \
fst_core = 1; \
} else { \
fprintf(stderr, "Failed to load FS core\n"); \