36 #include <apr_strings.h>
42 #include <apr_file_io.h>
184 unsigned load_interface = 1;
191 "Failed to load codec interface %s from %s due to no iana name in an implementation.\n", ptr->
interface_name,
198 "Failed to load codec interface %s from %s due to bytes per frame %d exceeding buffer size %d.\n",
204 if (load_interface) {
208 "Adding Codec %s %d %s %dhz %dms %dbps\n",
214 "Adding Codec %s %d %s %dhz %dms (VBR)\n",
383 }
else if (!ptr->
extens) {
389 for (i = 0; ptr->
extens[i]; i++) {
527 "Failed to load management interface %s. OID %s already exists\n", key, ptr->
relative_oid);
554 "Failed to load limit interface %s. Name %s already exists\n", key, ptr->
interface_name);
589 #define CHAT_MAX_MSG_QUEUE 101
590 #define CHAT_QUEUE_SIZE 5000
614 const char *replying;
615 const char *dest_proto;
836 if (data && !strcmp(data,
"__undef")) {
844 if (expanded != data) {
859 const
char *subject, const
char *body, const
char *type, const
char *hint,
switch_bool_t blocking)
969 unsigned load_interface = 1;
976 if (load_interface) {
979 "Deleting Codec %s %d %s %dhz %dms\n",
986 for(node = head; node; node = node->
next) {
989 if ((node = node->
next)) {
1182 for (i = 0; ptr->
extens[i]; i++) {
1193 for(node = head; node; node = node->
next) {
1196 if ((node = node->
next)) {
1408 char *struct_name = NULL;
1409 switch_module_load_t load_func_ptr = NULL;
1413 const char *err = NULL;
1426 #elif defined (MACOSX) || defined(DARWIN)
1441 if (!interface_struct_handle) {
1452 if (!interface_struct_handle) {
1462 err =
"Trying to load an out of date module, please rebuild the module.";
1469 interface_struct_handle = NULL;
1475 if (interface_struct_handle) {
1476 mod_interface_functions = interface_struct_handle;
1477 load_func_ptr = mod_interface_functions->
load;
1480 if (load_func_ptr == NULL) {
1481 err =
"Cannot locate symbol 'switch_module_load' please make sure this is a valid module.";
1485 status = load_func_ptr(&module_interface, pool);
1488 err =
"Module load routine returned an error";
1489 module_interface = NULL;
1493 if (!module_interface) {
1494 err =
"Module failed to initialize its module_interface. Is this a valid module?";
1499 err =
"Could not allocate memory\n";
1530 if (mod_interface_functions) {
1537 *new_module = module;
1559 const char *ext =
".dll";
1561 const char *ext =
".so";
1567 *err =
"allocation error";
1574 if ((dot = strchr(file,
'.'))) {
1578 if ((dot = strchr(file,
'.'))) {
1582 len += strlen(file);
1591 *err =
"Module already loaded";
1599 *err =
"module load routine returned an error";
1602 *err =
"module load file routine returned an error";
1642 *err =
"Module is not unloadable";
1656 *err =
"No such module!";
1677 const char *fname_ext;
1681 const char *ext =
".dll";
1683 const char *ext =
".so";
1691 if ((fname_ext = strrchr(fname,
'.'))) {
1692 if (!strcmp(fname_ext, ext)) {
1693 if (!(fname_base =
switch_mprintf(
"%.*s", (
int)(fname_ext-fname), fname))) {
1697 callback(user_data, fname_base);
1728 switch_module_load_t switch_module_load,
1729 switch_module_runtime_t switch_module_runtime,
1733 switch_module_load_t load_func_ptr = NULL;
1735 const char *err = NULL;
1754 load_func_ptr = (switch_module_load_t) switch_module_load;
1756 if (load_func_ptr == NULL) {
1757 err =
"Cannot Load";
1761 status = load_func_ptr(&module_interface, pool);
1764 err =
"Module load routine returned an error";
1765 module_interface = NULL;
1770 err =
"Could not allocate memory\n";
1792 if (switch_module_shutdown) {
1795 if (switch_module_runtime) {
1806 static void switch_loadable_module_path_init()
1808 char *path = NULL, *working = NULL;
1809 apr_dir_t *perl_dir_handle = NULL;
1815 apr_dir_close(perl_dir_handle);
1824 apr_finfo_t finfo = { 0 };
1825 apr_dir_t *module_dir_handle = NULL;
1826 apr_int32_t finfo_flags = APR_FINFO_DIRENT | APR_FINFO_TYPE | APR_FINFO_NAME;
1827 char *cf =
"modules.conf";
1828 char *pcf =
"post_load_modules.conf";
1830 unsigned char all = 0;
1831 unsigned int count = 0;
1836 const char *ext =
".dll";
1837 const char *EXT =
".DLL";
1838 #elif defined (MACOSX) || defined (DARWIN)
1839 const char *ext =
".dylib";
1840 const char *EXT =
".DYLIB";
1842 const char *ext =
".so";
1843 const char *EXT =
".SO";
1851 switch_loadable_module_path_init();
1879 #ifdef SWITCH_HAVE_YUV
1880 #ifdef SWITCH_HAVE_VPX
1894 if (
zstr(val) || (strchr(val,
'.') && !strstr(val, ext) && !strstr(val, EXT))) {
1900 if (path &&
zstr(path)) {
1927 if (
zstr(val) || (strchr(val,
'.') && !strstr(val, ext) && !strstr(val, EXT))) {
1933 if (path &&
zstr(path)) {
1957 while (apr_dir_read(&finfo, finfo_flags, module_dir_handle) == APR_SUCCESS) {
1958 const char *fname = finfo.fname;
1960 if (finfo.filetype != APR_REG) {
1972 if (
zstr(fname) || (!strstr(fname, ext) && !strstr(fname, EXT))) {
1978 apr_dir_close(module_dir_handle);
2001 *err =
"Module in use.";
2034 if ((pool = module->
pool)) {
2070 if (!module->
perm) {
2080 if (!module->
perm) {
2130 for (node = head; node; node = node->
next) {
2157 for (node = head; node; node = node->
next) {
2177 #define HASH_FUNC(_kind_) SWITCH_DECLARE(switch_##_kind_##_interface_t *) switch_loadable_module_get_##_kind_##_interface(const char *name) \
2179 switch_##_kind_##_interface_t *i = NULL; \
2180 if (loadable_modules._kind_##_hash && (i = switch_core_hash_find_locked(loadable_modules._kind_##_hash, name, loadable_modules.mutex))) { \
2181 PROTECT_INTERFACE(i); \
2209 #ifdef DEBUG_CODEC_SORTING
2214 for(i = 0; i < arraylen; i++) {
2216 "DEBUG %d %s:%d %d\n", i, array[i]->iananame, array[i]->ianacode, array[i]->microseconds_per_packet / 1000);
2226 array[b] = array[a];
2232 int i = 0, sorted_ptime = 0;
2234 #ifdef DEBUG_CODEC_SORTING
2236 do_print(array, arraylen);
2240 for (i = 0; i < arraylen; i++) {
2243 if (!strcasecmp(array[i]->iananame,
"ilbc")) {
2247 if (!sorted_ptime) {
2248 sorted_ptime = this_ptime;
2249 #ifdef DEBUG_CODEC_SORTING
2254 if (i > 0 && strcasecmp(array[i]->iananame, array[i-1]->iananame) && this_ptime != sorted_ptime) {
2258 #ifdef DEBUG_CODEC_SORTING
2261 for(j = i; j < arraylen; j++) {
2264 if (!strcasecmp(array[i]->iananame,
"ilbc")) {
2268 if (check_ptime == sorted_ptime) {
2269 #ifdef DEBUG_CODEC_SORTING
2279 sorted_ptime = this_ptime;
2280 #ifdef DEBUG_CODEC_SORTING
2287 #ifdef DEBUG_CODEC_SORTING
2289 do_print(array, arraylen);
2310 for (node = head; node; node = node->
next) {
2345 char *
cur, *next = NULL, *name, *p;
2347 name = next = cur =
buf;
2356 if ((p = strchr(next,
'@'))) {
2362 if (strchr(cur,
'i')) {
2363 *interval = atoi(cur);
2364 }
else if ((strchr(cur,
'k') || strchr(cur,
'h'))) {
2366 }
else if (strchr(cur,
'b')) {
2368 }
else if (strchr(cur,
'c')) {
2369 *channels = atoi(cur);
2377 if ((p = strchr(name,
'.'))) {
2388 int x, i = 0, j = 0;
2394 for (x = 0; x < preflen; x++) {
2395 char *name,
buf[256], jbuf[256], *modname = NULL;
2396 uint32_t interval = 0, rate = 0, bit = 0, channels = 1;
2401 for(j = 0; j < x; j++) {
2402 char *jname, *jmodname = NULL;
2403 uint32_t jinterval = 0, jrate = 0, jbit = 0, jchannels = 1;
2404 uint32_t ointerval = interval, orate = rate, ochannels = channels;
2406 if (ointerval == 0) {
2414 if (ochannels == 0) {
2421 if (jinterval == 0) {
2429 if (jchannels == 0) {
2433 if (!strcasecmp(name, jname) && ointerval == jinterval && orate == jrate && ochannels == jchannels) {
2480 if (rate && (uint32_t) crate != rate) {
2531 if (strcasecmp(cmd,
"console_complete")) {
2535 cmd_used = (
char *) cmd;
2536 arg_used = (
char *) arg;
2540 if (!stream->param_event) {
2544 if (stream->param_event) {
2545 if (cmd_used && *cmd_used) {
2548 if (arg_used && *arg_used) {
2556 stream->write_function(stream,
"COMMAND RETURNED ERROR!\n");
2561 stream->write_function(stream,
"INVALID COMMAND!\n");
2564 if (stream->param_event) {
2568 if (cmd_used != cmd) {
2572 if (arg_used != arg) {
2583 cJSON *
function, *json_reply = NULL;
2589 if (
function && function->valuestring
2603 *retval = json_reply;
2634 #define ALLOC_INTERFACE(_TYPE_) { \
2635 switch_##_TYPE_##_interface_t *i, *ptr; \
2636 i = switch_core_alloc(mod->pool, sizeof(switch_##_TYPE_##_interface_t)); \
2637 switch_assert(i != NULL); \
2638 for (ptr = mod->_TYPE_##_interface; ptr && ptr->next; ptr = ptr->next); \
2642 mod->_TYPE_##_interface = i; \
2644 switch_thread_rwlock_create(&i->rwlock, mod->pool); \
2645 switch_mutex_init(&i->reflock, SWITCH_MUTEX_NESTED, mod->pool); \
2719 if (sh->param_event) {
2729 return (
char *) sh->stream.data;
2737 path = (
char *) sh->stream.data;
2738 sh->stream.data = NULL;
2750 if ((*sh)->param_event) {
2765 *sh = malloc(
sizeof(**sh));
2766 memset(*sh, 0,
sizeof(**sh));
2771 (*sh)->param_event = *var_event;
2775 (*sh)->ext = strdup(ext);
2790 sh->stream.write_function(&sh->stream,
"file_string://%s.%s", buf, sh->ext);
2791 }
else if (strstr(buf,
"://")) {
2792 sh->stream.write_function(&sh->stream,
"!%s", buf);
2794 sh->stream.write_function(&sh->stream,
"!%s.%s", buf, sh->ext);
struct apr_queue_t switch_queue_t
switch_hash_t * timer_hash
const char * relative_oid
void * switch_core_hash_find_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_mutex_t *mutex)
Retrieve data from a given hash.
char * switch_say_file_handle_get_variable(switch_say_file_handle_t *sh, const char *var)
static struct switch_loadable_module_container loadable_modules
#define switch_event_fire(event)
Fire an event filling in most of the arguements with obvious values.
void switch_xml_free(_In_opt_ switch_xml_t xml)
frees the memory allocated for an switch_xml structure
void switch_say_file(switch_say_file_handle_t *sh, const char *fmt,...)
#define switch_core_new_memory_pool(p)
Create a new sub memory pool from the core's master pool.
A module interface to implement an application.
switch_status_t switch_thread_rwlock_unlock(switch_thread_rwlock_t *rwlock)
const char * switch_xml_attr_soft(_In_ switch_xml_t xml, _In_z_ const char *attr)
returns the value of the requested tag attribute, or "" if not found
switch_module_load_t switch_module_load
switch_memory_pool_t * pool
struct switch_directory_interface * next
#define switch_event_expand_headers(_event, _in)
#define ALLOC_INTERFACE(_TYPE_)
Abstract interface to a limit module.
const char * interface_name
cJSON * cJSON_CreateNull(void)
#define SWITCH_CHANNEL_LOG
switch_status_t switch_loadable_module_load_module(char *dir, char *fname, switch_bool_t runtime, const char **err)
Load a module.
static void chat_queue_message(switch_event_t **eventp)
switch_status_t switch_core_hash_destroy(_Inout_ switch_hash_t **hash)
Destroy an existing hash table.
const char * interface_name
switch_api_function_t function
switch_thread_rwlock_t * rwlock
void * switch_core_hash_find(_In_ switch_hash_t *hash, _In_z_ const char *key)
Retrieve data from a given hash.
switch_dialplan_interface_t * dialplan_interface
switch_json_api_interface_t * switch_loadable_module_get_json_api_interface(const char *name)
Retrieve the JSON API interface by it's registered name.
Abstraction of an module endpoint interface This is the glue between the abstract idea of a "channel"...
switch_directory_interface_t * directory_interface
#define switch_core_hash_init(_hash)
const switch_codec_interface_t * ptr
struct switch_management_interface * next
switch_hash_t * endpoint_hash
switch_thread_rwlock_t * rwlock
#define switch_core_session_hupall_matching_var(_vn, _vv, _c)
switch_core_recover_callback_t switch_core_get_secondary_recover_callback(const char *key)
switch_memory_pool_t * pool
switch_status_t switch_loadable_module_enumerate_available(const char *dir_path, switch_modulename_callback_func_t callback, void *user_data)
Enumerates a list of all modules discovered in a directory.
#define SWITCH_RECOMMENDED_BUFFER_SIZE
switch_status_t switch_loadable_module_build_dynamic(char *filename, switch_module_load_t switch_module_load, switch_module_runtime_t switch_module_runtime, switch_module_shutdown_t switch_module_shutdown, switch_bool_t runtime)
build a dynamic module object and register it (for use in double embeded modules) ...
switch_bool_t shutting_down
#define switch_core_strdup(_pool, _todup)
Copy a string using memory allocation from a given pool.
switch_status_t(* chat_send)(switch_event_t *message_event)
switch_chat_application_function_t chat_application_function
switch_status_t switch_api_execute(const char *cmd, const char *arg, switch_core_session_t *session, switch_stream_handle_t *stream)
Execute a registered API command.
switch_codec_interface_t * codec_interface
switch_status_t switch_threadattr_stacksize_set(switch_threadattr_t *attr, switch_size_t stacksize)
#define switch_core_destroy_memory_pool(p)
Returns a subpool back to the main pool.
uint32_t decoded_bytes_per_packet
struct switch_stream_handle stream
Representation of an event.
A module interface to implement a chat application.
switch_codec_implementation_t * implementations
switch_hash_t * secondary_recover_hash
switch_status_t switch_event_add_body(switch_event_t *event, const char *fmt,...) PRINTF_FUNCTION(2
Add a body to an event.
struct switch_endpoint_interface * next
#define FREESWITCH_OID_PREFIX
switch_management_interface_t * switch_loadable_module_get_management_interface(const char *relative_oid)
Retrieve the management interface by it's registered name.
Abstract interface to a chat module.
const char * interface_name
switch_thread_rwlock_t * rwlock
char * switch_strip_whitespace(const char *str)
static void switch_loadable_module_sort_codecs(const switch_codec_implementation_t **array, int arraylen)
A representation of an XML tree.
Abstract interface to a dialplan module.
switch_status_t switch_queue_pop(switch_queue_t *queue, void **data)
switch_status_t switch_json_api_execute(cJSON *json, switch_core_session_t *session, cJSON **retval)
Execute a registered JSON API command.
struct switch_speech_interface * next
A table of functions that a timer module implements.
void *SWITCH_THREAD_FUNC chat_thread_run(switch_thread_t *thread, void *obj)
switch_status_t switch_event_dup(switch_event_t **event, switch_event_t *todup)
Duplicate an event.
#define SWITCH_API_VERSION
static switch_thread_t * thread
int switch_snprintf(_Out_z_cap_(len) char *buf, _In_ switch_size_t len, _In_z_ _Printf_format_string_ const char *format,...)
struct switch_runtime runtime
static int switch_true(const char *expr)
Evaluate the truthfullness of a string expression.
const char * interface_name
switch_thread_rwlock_t * rwlock
Abstract interface to an asr module.
switch_thread_rwlock_t * rwlock
void switch_loadable_module_shutdown(void)
Shutdown the module backend and call the shutdown routine in all loaded modules.
const char * interface_name
switch_api_interface_t * switch_loadable_module_get_api_interface(const char *name)
Retrieve the API interface by it's registered name.
Abstract interface to a file format module.
switch_memory_pool_t * pool
static switch_status_t chat_process_event(switch_event_t **eventp)
struct switch_codec_node_s switch_codec_node_t
switch_memory_pool_t * pool
int(* switch_modulename_callback_func_t)(void *user_data, const char *module_name)
switch_hash_t * module_hash
struct switch_json_api_interface * next
switch_module_load_t load
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
switch_thread_t * msg_queue_thread[CHAT_MAX_MSG_QUEUE]
switch_status_t switch_thread_exit(switch_thread_t *thd, switch_status_t retval)
switch_status_t switch_thread_join(switch_status_t *retval, switch_thread_t *thd)
switch_thread_rwlock_t * rwlock
struct switch_timer_interface * next
#define UNPROTECT_INTERFACE(_it)
switch_status_t switch_core_chat_send(const char *dest_proto, switch_event_t *message_event)
#define HASH_FUNC(_kind_)
#define SWITCH_MUTEX_NESTED
void switch_core_unregister_secondary_recover_callback(const char *key)
switch_timer_interface_t * timer_interface
switch_thread_rwlock_t * rwlock
#define SWITCH_PATH_SEPARATOR
switch_chat_interface_t * switch_loadable_module_get_chat_interface(const char *name)
Retrieve the chat interface by it's registered name.
Abstract interface to a speech module.
switch_hash_t * file_hash
switch_byte_t switch_byte_t * buf
static switch_status_t switch_loadable_module_load_file(char *path, char *filename, switch_bool_t global, switch_loadable_module_t **new_module)
#define switch_yield(ms)
Wait a desired number of microseconds and yield the CPU.
switch_hash_t * codec_hash
A module interface to implement an api function.
static void switch_loadable_module_runtime(void)
switch_status_t switch_core_hash_insert_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ const void *data, _In_opt_ switch_mutex_t *mutex)
Insert data into a hash.
#define CHAT_MAX_MSG_QUEUE
struct switch_dialplan_interface * next
Abstract interface to a say module.
switch_status_t switch_say_file_handle_create(switch_say_file_handle_t **sh, const char *ext, switch_event_t **var_event)
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
switch_core_flag_t switch_core_flags(void)
return core flags
const char * interface_name
void switch_dso_destroy(switch_dso_lib_t *lib)
switch_codec_type_t codec_type
#define switch_core_alloc(_pool, _mem)
Allocate memory directly from a memory pool.
uint32_t actual_samples_per_second
Abstract interface to a management module.
switch_hash_t * application_hash
switch_chat_interface_t * chat_interface
#define SWITCH_THREAD_STACKSIZE
switch_speech_interface_t * speech_interface
switch_status_t switch_event_add_header_string(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *data)
Add a string header to an event.
struct switch_api_interface * next
switch_file_interface_t * switch_loadable_module_get_file_interface(const char *name, const char *modname)
Retrieve the file format interface by it's registered name.
static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t *old_module)
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
const char * interface_name
const char * interface_name
const char * interface_name
Top level module interface to implement a series of codec implementations.
switch_endpoint_interface_t * endpoint_interface
switch_status_t switch_mutex_init(switch_mutex_t **lock, unsigned int flags, switch_memory_pool_t *pool)
int switch_loadable_module_get_codecs(const switch_codec_implementation_t **array, int arraylen)
Retrieve the list of loaded codecs into an array.
switch_status_t switch_loadable_module_exists(const char *mod)
Check if a module is loaded.
void switch_core_hash_this(_In_ switch_hash_index_t *hi, _Out_opt_ptrdiff_cap_(klen) const void **key, _Out_opt_ switch_ssize_t *klen, _Out_ void **val)
Gets the key and value of the current hash element.
switch_module_interface_name_t
struct switch_codec_interface * next
struct switch_chat_interface * next
static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fname, switch_bool_t runtime, switch_bool_t global, const char **err)
switch_hash_index_t * switch_core_hash_next(_In_ switch_hash_index_t **hi)
Gets the next element of a hashtable.
uint32_t switch_default_ptime(const char *name, uint32_t number)
char * switch_say_file_handle_detach_path(switch_say_file_handle_t *sh)
switch_status_t switch_dir_open(switch_dir_t **new_dir, const char *dirname, switch_memory_pool_t *pool)
struct switch_chat_application_interface * next
struct switch_codec_node_s * next
void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item)
void switch_cond_next(void)
switch_queue_t * msg_queue[CHAT_MAX_MSG_QUEUE]
switch_module_runtime_t runtime
#define SWITCH_STANDARD_STREAM(s)
int microseconds_per_packet
char * switch_copy_string(_Out_z_cap_(dst_size) char *dst, _In_z_ const char *src, _In_ switch_size_t dst_size)
cJSON * cJSON_GetObjectItem(const cJSON *object, const char *string)
switch_thread_rwlock_t * rwlock
switch_dso_lib_t switch_dso_open(const char *path, int global, char **err)
void * objs[SWITCH_MAX_CORE_THREAD_SESSION_OBJS]
switch_file_interface_t * file_interface
void * switch_core_hash_delete(_In_ switch_hash_t *hash, _In_z_ const char *key)
Delete data from a hash based on desired key.
switch_application_interface_t * application_interface
const char * switch_dir_next_file(switch_dir_t *thedir, char *buf, switch_size_t len)
switch_codec_interface_t * switch_loadable_module_get_codec_interface(const char *name, const char *modname)
Retrieve the codec interface by it's registered name.
switch_directories SWITCH_GLOBAL_dirs
switch_limit_interface_t * limit_interface
cJSON * cJSON_CreateString(const char *string)
#define switch_str_nil(s)
Make a null string a blank string instead.
switch_management_interface_t * management_interface
static struct @5 chat_globals
switch_thread_rwlock_t * rwlock
uint8_t number_of_channels
struct apr_thread_mutex_t switch_mutex_t
int switch_loadable_module_get_codecs_sorted(const switch_codec_implementation_t **array, int arraylen, char **prefs, int preflen)
Retrieve the list of loaded codecs into an array based on another array showing the sorted order...
uint32_t samples_per_second
switch_status_t
Common return values.
switch_chat_application_interface_t * switch_loadable_module_get_chat_application_interface(const char *name)
Retrieve the chat application interface by it's registered name.
switch_status_t switch_loadable_module_unload_module(char *dir, char *fname, switch_bool_t force, const char **err)
Unoad a module.
#define switch_goto_status(_status, _label)
switch_loadable_module_interface_t * module_interface
switch_endpoint_interface_t * switch_loadable_module_get_endpoint_interface(const char *name)
Retrieve the endpoint interface by it's registered name.
switch_say_interface_t * switch_loadable_module_get_say_interface(const char *name)
Retrieve the say interface by it's registered name.
switch_xml_t switch_xml_open_cfg(_In_z_ const char *file_path, _Out_ switch_xml_t *node, _In_opt_ switch_event_t *params)
open a config in the core registry
char * switch_say_file_handle_get_path(switch_say_file_handle_t *sh)
static switch_status_t do_chat_send(switch_event_t *message_event)
switch_thread_rwlock_t * rwlock
struct switch_file_node_s * next
switch_thread_t * switch_core_launch_thread(void *(SWITCH_THREAD_FUNC *func)(switch_thread_t *, void *), void *obj, switch_memory_pool_t *pool)
Launch a thread.
switch_status_t switch_core_chat_send_args(const char *dest_proto, const char *proto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint, switch_bool_t blocking)
switch_loadable_module_interface_t * switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name)
switch_json_api_interface_t * json_api_interface
switch_payload_t ianacode
#define switch_core_hash_insert(_h, _k, _d)
struct apr_thread_t switch_thread_t
switch_event_t * param_event
switch_hash_t * chat_hash
#define switch_event_create(event, id)
Create a new event assuming it will not be custom event and therefore hiding the unused parameters...
static switch_bool_t switch_is_file_path(const char *file)
switch_status_t switch_core_register_secondary_recover_callback(const char *key, switch_core_recover_callback_t cb)
switch_hash_t * limit_hash
const char * interface_name
#define switch_event_get_header(_e, _h)
const char * interface_name
switch_xml_t switch_xml_child(_In_ switch_xml_t xml, _In_z_ const char *name)
returns the first child tag (one level deeper) with the given name or NULL \ if not found ...
static void *SWITCH_THREAD_FUNC switch_loadable_module_exec(switch_thread_t *thread, void *obj)
switch_status_t switch_loadable_module_enumerate_loaded(switch_modulename_callback_func_t callback, void *user_data)
Enumerates a list of all currently loaded modules.
static void do_swap(const switch_codec_implementation_t **array, int a, int b)
switch_status_t switch_core_execute_chat_app(switch_event_t *message, const char *app, const char *data)
switch_status_t switch_queue_trypush(switch_queue_t *queue, void *data)
const char * interface_name
switch_hash_t * chat_application_hash
struct switch_say_interface * next
void switch_core_session_hupall_endpoint(const switch_endpoint_interface_t *endpoint_interface, switch_call_cause_t cause)
Hangup all sessions that belong to an endpoint.
int(* switch_core_recover_callback_t)(switch_core_session_t *session)
switch_hash_t * directory_hash
struct switch_codec_implementation * next
switch_module_runtime_t switch_module_runtime
switch_thread_rwlock_t * rwlock
switch_status_t switch_loadable_module_init(switch_bool_t autoload)
Initilize the module backend and load all the modules.
A generic object to pass as a thread's session object to allow mutiple arguements and a pool...
switch_status_t switch_queue_push(switch_queue_t *queue, void *data)
switch_status_t switch_core_chat_deliver(const char *dest_proto, switch_event_t **message_event)
void * switch_dso_data_sym(switch_dso_lib_t lib, const char *sym, char **err)
struct apr_pool_t switch_memory_pool_t
static void chat_thread_start(int idx)
struct switch_application_interface * next
switch_memory_pool_t * pool
switch_status_t switch_thread_rwlock_create(switch_thread_rwlock_t **rwlock, switch_memory_pool_t *pool)
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
switch_module_shutdown_t shutdown
const char * interface_name
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
const char * switch_stristr(const char *instr, const char *str)
#define SWITCH_CURRENT_APPLICATION_VARIABLE
switch_status_t switch_threadattr_create(switch_threadattr_t **new_attr, switch_memory_pool_t *pool)
switch_status_t switch_thread_create(switch_thread_t **new_thread, switch_threadattr_t *attr, switch_thread_start_t func, void *data, switch_memory_pool_t *cont)
A table of settings and callbacks that define a paticular implementation of a codec.
#define PROTECT_INTERFACE(_it)
A module interface to implement a json api function.
const switch_file_interface_t * ptr
void switch_say_file_handle_destroy(switch_say_file_handle_t **sh)
struct switch_limit_interface * next
switch_api_interface_t * api_interface
switch_status_t switch_thread_rwlock_trywrlock_timeout(switch_thread_rwlock_t *rwlock, int timeout)
const char * interface_name
const char * interface_name
switch_status_t switch_queue_create(switch_queue_t **queue, unsigned int queue_capacity, switch_memory_pool_t *pool)
void switch_core_set_signal_handlers(void)
void switch_event_destroy(switch_event_t **event)
Destroy an event.
switch_json_api_function_t function
int switch_vsnprintf(char *buf, switch_size_t len, const char *format, va_list ap)
switch_asr_interface_t * asr_interface
char * switch_core_sprintf(_In_ switch_memory_pool_t *pool, _In_z_ _Printf_format_string_ const char *fmt,...)
printf-style style printing routine. The data is output to a string allocated from the pool ...
static switch_status_t switch_loadable_module_process(char *key, switch_loadable_module_t *new_module)
const char * switch_cut_path(const char *in)
Create a pointer to the file name in a given file path eliminating the directory name.
switch_say_interface_t * say_interface
switch_module_shutdown_t switch_module_shutdown
switch_chat_application_interface_t * chat_application_interface
char * switch_parse_codec_buf(char *buf, uint32_t *interval, uint32_t *rate, uint32_t *bit, uint32_t *channels, char **modname)
struct switch_file_interface * next
#define switch_core_hash_first(_h)
switch_thread_rwlock_t * rwlock
SWITCH_BEGIN_EXTERN_C char * switch_mprintf(const char *zFormat,...)
uint32_t switch_default_rate(const char *name, uint32_t number)
switch_hash_t * management_hash
switch_hash_t * speech_hash
#define switch_core_hash_init_nocase(_hash)
The abstraction of a loadable module.
const char * interface_name
static switch_status_t do_shutdown(switch_loadable_module_t *module, switch_bool_t shutdown, switch_bool_t unload, switch_bool_t fail_if_busy, const char **err)
const char * interface_name
void * switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, switch_module_interface_name_t iname)
switch_hash_t * json_api_hash
Abstract interface to a directory module.
struct switch_asr_interface * next
switch_status_t switch_thread_rwlock_trywrlock(switch_thread_rwlock_t *rwlock)
switch_status_t switch_dir_close(switch_dir_t *thedir)
switch_hash_t * dialplan_hash
struct switch_file_node_s switch_file_node_t