#endif
#endif
-#include "uuid.h"
-
/* #define DEBUG_ALLOC */
#define DO_EVENTS
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
uint32_t flags;
switch_time_t timestamp;
- switch_mutex_t *uuid_mutex;
switch_mutex_t *throttle_mutex;
switch_mutex_t *session_hash_mutex;
switch_mutex_t *global_mutex;
char *odbc_user;
char *odbc_pass;
uint32_t debug_level;
- uuid_t *uuid;
};
extern struct switch_runtime runtime;
}
-SWITCH_DECLARE(void) switch_core_uuid_get(switch_uuid_t *uuid)
-{
- size_t n;
- void *vp;
- uuid_t *xuuid;
-
- uuid_create(&xuuid);
-
- switch_mutex_lock(runtime.uuid_mutex);
- uuid_make(xuuid, UUID_MAKE_V4);
- uuid_export(xuuid, UUID_FMT_BIN, &vp, &n);
- //memcpy(xuuid, vp, n);
- switch_mutex_unlock(runtime.uuid_mutex);
-
-}
-
SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switch_bool_t console, const char **err)
{
switch_uuid_t uuid;
char hostname[256] = "";
memset(&runtime, 0, sizeof(runtime));
-
+
runtime.dummy_cng_frame.data = runtime.dummy_data;
runtime.dummy_cng_frame.datalen = sizeof(runtime.dummy_data);
runtime.dummy_cng_frame.buflen = sizeof(runtime.dummy_data);
}
switch_assert(runtime.memory_pool != NULL);
-
dir_path = switch_mprintf("%s%ssounds", SWITCH_GLOBAL_dirs.base_dir, SWITCH_PATH_SEPARATOR);
switch_dir_make_recursive(dir_path, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
switch_safe_free(dir_path);
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.temp_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
- switch_mutex_init(&runtime.uuid_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
- uuid_create(&runtime.uuid);
switch_mutex_init(&runtime.throttle_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
switch_mutex_init(&runtime.session_hash_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
switch_input_args_t args = { 0 };
args.buf = buf;
args.buflen = sizeof(buf);
- if (switch_ivr_play_file(collect->session, NULL, collect->file, &args) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(collect->session), SWITCH_LOG_ERROR, "%s Error Playing File!", switch_channel_get_name(channel));
- switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
- }
+ switch_ivr_play_file(collect->session, NULL, collect->file, &args);
} else {
switch_ivr_collect_digits_count(collect->session, buf, sizeof(buf), 1, SWITCH_BLANK_STRING, &term, 0, 0, 0);
}