RTS API Documentation
1.10.11
|
Data Structures | |
struct | switch_loadable_module_interface |
The abstraction of a loadable module. More... | |
Macros | |
#define | SWITCH_ADD_API(api_int, int_name, descript, funcptr, syntax_string) |
#define | SWITCH_ADD_JSON_API(json_api_int, int_name, descript, funcptr, syntax_string) |
#define | SWITCH_ADD_CHAT(chat_int, int_name, funcptr) |
#define | SWITCH_ADD_APP(app_int, int_name, short_descript, long_descript, funcptr, syntax_string, app_flags) |
#define | SWITCH_ADD_CHAT_APP(app_int, int_name, short_descript, long_descript, funcptr, syntax_string, app_flags) |
#define | SWITCH_ADD_DIALPLAN(dp_int, int_name, funcptr) |
#define | SWITCH_ADD_LIMIT(limit_int, int_name, incrptr, releaseptr, usageptr, resetptr, statusptr, interval_resetptr) |
#define | SWITCH_ADD_CODEC(codec_int, int_name) |
Enumerations | |
enum | switch_loadable_module_type_t { SWITCH_LOADABLE_MODULE_TYPE_PRELOAD, SWITCH_LOADABLE_MODULE_TYPE_COMMON, SWITCH_LOADABLE_MODULE_TYPE_POSTLOAD } |
List of loadable module types. More... | |
Functions | |
switch_status_t | switch_loadable_module_init (switch_bool_t autoload) |
Initilize the module backend and load all the modules. More... | |
void | switch_loadable_module_shutdown (void) |
Shutdown the module backend and call the shutdown routine in all loaded modules. More... | |
switch_endpoint_interface_t * | switch_loadable_module_get_endpoint_interface (const char *name) |
Retrieve the endpoint interface by it's registered name. More... | |
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. More... | |
char * | switch_parse_codec_buf (char *buf, uint32_t *interval, uint32_t *rate, uint32_t *bit, uint32_t *channels, char **modname, char **fmtp) |
switch_dialplan_interface_t * | switch_loadable_module_get_dialplan_interface (const char *name) |
Retrieve the dialplan interface by it's registered name. More... | |
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. More... | |
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. More... | |
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) More... | |
switch_timer_interface_t * | switch_loadable_module_get_timer_interface (const char *name) |
Retrieve the timer interface by it's registered name. More... | |
switch_application_interface_t * | switch_loadable_module_get_application_interface (const char *name) |
Retrieve the application interface by it's registered name. More... | |
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. More... | |
switch_status_t | switch_core_execute_chat_app (switch_event_t *message, const char *app, const char *data) |
switch_api_interface_t * | switch_loadable_module_get_api_interface (const char *name) |
Retrieve the API interface by it's registered name. More... | |
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. More... | |
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. More... | |
switch_database_interface_t * | switch_loadable_module_get_database_interface (const char *name, const char *modname) |
Retrieve the database interface by it's registered name. More... | |
switch_speech_interface_t * | switch_loadable_module_get_speech_interface (const char *name) |
Retrieve the speech interface by it's registered name. More... | |
switch_asr_interface_t * | switch_loadable_module_get_asr_interface (const char *name) |
Retrieve the asr interface by it's registered name. More... | |
switch_directory_interface_t * | switch_loadable_module_get_directory_interface (const char *name) |
Retrieve the directory interface by it's registered name. More... | |
switch_chat_interface_t * | switch_loadable_module_get_chat_interface (const char *name) |
Retrieve the chat interface by it's registered name. More... | |
switch_say_interface_t * | switch_loadable_module_get_say_interface (const char *name) |
Retrieve the say interface by it's registered name. More... | |
switch_management_interface_t * | switch_loadable_module_get_management_interface (const char *relative_oid) |
Retrieve the management interface by it's registered name. More... | |
switch_limit_interface_t * | switch_loadable_module_get_limit_interface (const char *name) |
Retrieve the limit interface by it's registered name. More... | |
int | switch_loadable_module_get_codecs (const switch_codec_implementation_t **array, int arraylen) |
Retrieve the list of loaded codecs into an array. More... | |
int | switch_loadable_module_get_codecs_sorted (const switch_codec_implementation_t **array, char fmtp_array[SWITCH_MAX_CODECS][MAX_FMTP_LEN], int arraylen, char **prefs, int preflen) |
Retrieve the list of loaded codecs into an array based on another array showing the sorted order. More... | |
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. More... | |
switch_status_t | switch_json_api_execute (cJSON *json, switch_core_session_t *session, cJSON **retval) |
Execute a registered JSON API command. More... | |
switch_status_t | switch_loadable_module_load_module (const char *dir, const char *fname, switch_bool_t runtime, const char **err) |
Load a module. More... | |
switch_status_t | switch_loadable_module_exists (const char *mod) |
Check if a module is loaded. More... | |
switch_status_t | switch_loadable_module_protect (const char *mod) |
Protect module from beeing unloaded. More... | |
switch_status_t | switch_loadable_module_unload_module (const char *dir, const char *fname, switch_bool_t force, const char **err) |
Unoad a module. More... | |
SWITCH_MOD_DECLARE (switch_status_t) switch_module_load(switch_loadable_module_interface_t **module_interface | |
Load a module. More... | |
uint32_t | switch_core_codec_next_id (void) |
static int | switch_check_interval (uint32_t rate, uint32_t ptime) |
static void | switch_core_codec_add_implementation (switch_memory_pool_t *pool, switch_codec_interface_t *codec_interface, const switch_codec_type_t codec_type, switch_payload_t ianacode, const char *iananame, char *fmtp, uint32_t samples_per_second, uint32_t actual_samples_per_second, int bits_per_second, int microseconds_per_packet, uint32_t samples_per_packet, uint32_t decoded_bytes_per_packet, uint32_t encoded_bytes_per_packet, uint8_t number_of_channels, int codec_frames_per_packet, switch_core_codec_init_func_t init, switch_core_codec_encode_func_t encode, switch_core_codec_decode_func_t decode, switch_core_codec_destroy_func_t destroy) |
Variables | |
const char * | filename |
#define SWITCH_ADD_API | ( | api_int, | |
int_name, | |||
descript, | |||
funcptr, | |||
syntax_string | |||
) |
Definition at line 365 of file switch_loadable_module.h.
Referenced by switch_msrp_load_apis_and_applications().
#define SWITCH_ADD_APP | ( | app_int, | |
int_name, | |||
short_descript, | |||
long_descript, | |||
funcptr, | |||
syntax_string, | |||
app_flags | |||
) |
Definition at line 393 of file switch_loadable_module.h.
Referenced by switch_msrp_load_apis_and_applications().
#define SWITCH_ADD_CHAT | ( | chat_int, | |
int_name, | |||
funcptr | |||
) |
Definition at line 385 of file switch_loadable_module.h.
#define SWITCH_ADD_CHAT_APP | ( | app_int, | |
int_name, | |||
short_descript, | |||
long_descript, | |||
funcptr, | |||
syntax_string, | |||
app_flags | |||
) |
Definition at line 405 of file switch_loadable_module.h.
#define SWITCH_ADD_CODEC | ( | codec_int, | |
int_name | |||
) |
Definition at line 440 of file switch_loadable_module.h.
Referenced by mod_g711_load(), and SWITCH_MODULE_LOAD_FUNCTION().
#define SWITCH_ADD_DIALPLAN | ( | dp_int, | |
int_name, | |||
funcptr | |||
) |
Definition at line 417 of file switch_loadable_module.h.
#define SWITCH_ADD_JSON_API | ( | json_api_int, | |
int_name, | |||
descript, | |||
funcptr, | |||
syntax_string | |||
) |
Definition at line 375 of file switch_loadable_module.h.
#define SWITCH_ADD_LIMIT | ( | limit_int, | |
int_name, | |||
incrptr, | |||
releaseptr, | |||
usageptr, | |||
resetptr, | |||
statusptr, | |||
interval_resetptr | |||
) |
Definition at line 425 of file switch_loadable_module.h.
List of loadable module types.
Enumerator | |
---|---|
SWITCH_LOADABLE_MODULE_TYPE_PRELOAD | |
SWITCH_LOADABLE_MODULE_TYPE_COMMON | |
SWITCH_LOADABLE_MODULE_TYPE_POSTLOAD |
Definition at line 57 of file switch_loadable_module.h.
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.
cmd | the name of the API command to execute |
arg | the optional arguement to the command |
session | an optional session |
stream | stream for output |
Definition at line 2933 of file switch_loadable_module.c.
References switch_stream_handle::data, switch_api_interface::function, switch_stream_handle::param_event, switch_assert, switch_event_add_header_string(), SWITCH_EVENT_API, switch_event_create, switch_event_fire, switch_loadable_module_get_api_interface(), switch_safe_free, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_strip_whitespace(), UNPROTECT_INTERFACE, and switch_stream_handle::write_function.
Referenced by api_hook(), do_api_on(), API::execute(), API::executeString(), record_helper_post_process(), switch_channel_expand_variables_check(), switch_console_execute(), switch_core_perform_file_open(), switch_event_expand_headers_check(), switch_ivr_parse_event(), switch_ivr_record_file_event(), switch_nat_republish(), and switch_nat_status().
|
inlinestatic |
Definition at line 449 of file switch_loadable_module.h.
References SWITCH_RECOMMENDED_BUFFER_SIZE.
Referenced by switch_core_codec_add_implementation().
|
inlinestatic |
codec_type | enumeration defining the type of the codec |
ianacode | the IANA code number |
iananame | the IANA code name |
fmtp | default fmtp to send (can be overridden by the init function) |
samples_per_second | samples transferred per second |
actual_samples_per_second | actual samples transferred per second for those who are not moron g722 RFC writers |
bits_per_second | bits transferred per second |
microseconds_per_packet | number of microseconds that denote one frame |
samples_per_packet | number of samples that denote one frame |
decoded_bytes_per_packet | number of bytes that denote one frame decompressed |
encoded_bytes_per_packet | number of bytes that denote one frame compressed |
number_of_channels | number of channels represented |
codec_frames_per_packet | number of frames to send in one network packet |
init | function to initialize a codec handle using this implementation |
encode | function to encode raw data into encoded data |
decode | function to decode encoded data into raw data |
destroy | deinitalize a codec handle using this implementation |
Definition at line 487 of file switch_loadable_module.h.
References switch_codec_implementation::actual_samples_per_second, switch_codec_implementation::bits_per_second, switch_codec_implementation::codec_frames_per_packet, switch_codec_implementation::codec_id, switch_codec_interface::codec_id, switch_codec_implementation::codec_type, switch_codec_implementation::decode, switch_codec_implementation::decoded_bytes_per_packet, switch_codec_implementation::destroy, switch_codec_implementation::encode, switch_codec_implementation::encoded_bytes_per_packet, switch_codec_implementation::fmtp, switch_codec_implementation::ianacode, switch_codec_implementation::iananame, switch_codec_implementation::impl_id, switch_codec_interface::implementations, switch_codec_implementation::init, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::modname, switch_codec_interface::modname, switch_codec_implementation::next, switch_codec_implementation::number_of_channels, switch_codec_implementation::samples_per_packet, switch_codec_implementation::samples_per_second, SWITCH_CHANNEL_LOG, switch_check_interval(), SWITCH_CODEC_TYPE_VIDEO, switch_core_alloc, switch_core_codec_next_id(), switch_core_strdup, SWITCH_LOG_CRIT, switch_log_printf(), and SWITCH_RECOMMENDED_BUFFER_SIZE.
Referenced by mod_g711_load(), and SWITCH_MODULE_LOAD_FUNCTION().
uint32_t switch_core_codec_next_id | ( | void | ) |
Definition at line 41 of file switch_core_codec.c.
References CODEC_ID.
Referenced by switch_core_codec_add_implementation(), and switch_core_codec_add_video_implementation().
switch_status_t switch_core_execute_chat_app | ( | switch_event_t * | message, |
const char * | app, | ||
const char * | data | ||
) |
Definition at line 995 of file switch_loadable_module.c.
References switch_chat_application_interface::chat_application_function, EF_NO_CHAT_EXEC, SWITCH_CHANNEL_LOG, switch_event_expand_headers, switch_goto_status, switch_loadable_module_get_chat_application_interface(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, and UNPROTECT_INTERFACE.
Referenced by Event::chat_execute().
switch_status_t switch_json_api_execute | ( | cJSON * | json, |
switch_core_session_t * | session, | ||
cJSON ** | retval | ||
) |
Execute a registered JSON API command.
json | the name of the JSON API command to execute |
arg | the optional arguement to the command |
session | an optional session |
stream | stream for output |
Definition at line 2992 of file switch_loadable_module.c.
References switch_json_api_interface::function, switch_assert, switch_loadable_module_get_json_api_interface(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and UNPROTECT_INTERFACE.
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)
filename | the name of the modules source file |
switch_module_load | the function to call when the module is loaded |
switch_module_runtime | a function requested to be started in it's own thread once loaded |
switch_module_shutdown | the function to call when the system is shutdown |
runtime | start the runtime thread or not |
Definition at line 1987 of file switch_loadable_module.c.
References switch_loadable_module::filename, loadable_modules, switch_loadable_module::module_interface, switch_loadable_module_interface::module_name, path, switch_loadable_module::perm, switch_loadable_module::pool, switch_loadable_module_container::pool, pool, SWITCH_CHANNEL_LOG, switch_core_alloc, switch_core_destroy_memory_pool, switch_core_launch_thread(), switch_core_new_memory_pool, switch_core_strdup, switch_loadable_module_exec(), switch_loadable_module_process(), SWITCH_LOG_CONSOLE, SWITCH_LOG_CRIT, switch_log_printf(), switch_loadable_module::switch_module_load, switch_loadable_module::switch_module_runtime, switch_loadable_module::switch_module_shutdown, SWITCH_STATUS_GENERR, SWITCH_STATUS_NOUNLOAD, SWITCH_STATUS_SUCCESS, and switch_loadable_module::thread.
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.
the | directory to look for modules in |
memory | pool |
callback | function to call for each module found |
user | data argument to pass to the callback function |
Definition at line 1931 of file switch_loadable_module.c.
References buffer, loadable_modules, switch_loadable_module_container::pool, switch_dir_close(), switch_dir_next_file(), switch_dir_open(), switch_mprintf(), switch_safe_free, SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
Referenced by switch_console_list_available_modules().
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.
callback | function to call for each module found |
user | data argument to pass to the callback function |
Definition at line 1969 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::module_hash, switch_loadable_module::module_interface, switch_loadable_module_interface::module_name, switch_loadable_module_container::mutex, switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_console_list_loaded_modules().
switch_status_t switch_loadable_module_exists | ( | const char * | mod | ) |
Check if a module is loaded.
mod | the module name |
Definition at line 1846 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::module_hash, switch_loadable_module_container::mutex, switch_core_hash_find(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
switch_api_interface_t* switch_loadable_module_get_api_interface | ( | const char * | name | ) |
Retrieve the API interface by it's registered name.
name | the name of the API |
Referenced by switch_api_execute().
switch_application_interface_t* switch_loadable_module_get_application_interface | ( | const char * | name | ) |
Retrieve the application interface by it's registered name.
name | the name of the application |
Referenced by collect_thread_run(), switch_core_session_execute_application_get_flags(), switch_core_session_get_app_flags(), switch_ivr_menu_execute(), and switch_ivr_phrase_macro_event().
switch_asr_interface_t* switch_loadable_module_get_asr_interface | ( | const char * | name | ) |
Retrieve the asr interface by it's registered name.
name | the name of the asr interface |
Referenced by switch_core_asr_open().
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.
name | the name of the chat application |
Referenced by switch_core_execute_chat_app().
switch_chat_interface_t* switch_loadable_module_get_chat_interface | ( | const char * | name | ) |
Retrieve the chat interface by it's registered name.
name | the name of the chat interface |
Referenced by do_chat_send().
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.
name | the name of the codec |
Definition at line 2547 of file switch_loadable_module.c.
References switch_loadable_module_container::codec_hash, switch_codec_node_s::interface_name, loadable_modules, switch_loadable_module_container::mutex, switch_codec_node_s::next, PROTECT_INTERFACE, switch_codec_node_s::ptr, switch_core_hash_find(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_codec_init_with_bitrate(), switch_core_codec_parse_fmtp(), and switch_loadable_module_get_codecs_sorted().
int switch_loadable_module_get_codecs | ( | const switch_codec_implementation_t ** | array, |
int | arraylen | ||
) |
Retrieve the list of loaded codecs into an array.
array | the array to populate |
arraylen | the max size in elements of the array |
Definition at line 2699 of file switch_loadable_module.c.
References switch_loadable_module_container::codec_hash, switch_codec_implementation::ianacode, switch_codec_implementation::iananame, switch_codec_interface::implementations, loadable_modules, switch_codec_implementation::microseconds_per_packet, switch_loadable_module_container::mutex, switch_codec_node_s::next, switch_codec_implementation::next, switch_codec_node_s::ptr, switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_default_ptime(), switch_loadable_module_sort_codecs(), switch_mutex_lock(), switch_mutex_unlock(), and switch_safe_free.
Referenced by switch_core_media_set_r_sdp_codec_string().
int switch_loadable_module_get_codecs_sorted | ( | const switch_codec_implementation_t ** | array, |
char | fmtp_array[SWITCH_MAX_CODECS][MAX_FMTP_LEN], | ||
int | arraylen, | ||
char ** | prefs, | ||
int | preflen | ||
) |
Retrieve the list of loaded codecs into an array based on another array showing the sorted order.
array | the array to populate |
arraylen | the max size in elements of the array |
prefs | the array of preferred codec names |
preflen | the size in elements of the prefs |
Definition at line 2796 of file switch_loadable_module.c.
References switch_codec_implementation::actual_samples_per_second, switch_codec_implementation::bits_per_second, buf, switch_codec_implementation::codec_type, switch_codec_implementation::ianacode, switch_codec_implementation::iananame, switch_codec_interface::implementations, loadable_modules, switch_codec_implementation::microseconds_per_packet, switch_loadable_module_container::mutex, name, switch_codec_implementation::next, switch_codec_implementation::number_of_channels, switch_codec_implementation::samples_per_second, SWITCH_CODEC_TYPE_VIDEO, switch_copy_string(), switch_default_ptime(), switch_default_rate(), switch_loadable_module_get_codec_interface(), switch_loadable_module_sort_codecs(), switch_mutex_lock(), switch_mutex_unlock(), switch_parse_codec_buf(), switch_set_string, switch_str_nil, UNPROTECT_INTERFACE, and zstr.
Referenced by switch_core_media_negotiate_sdp(), switch_core_media_prepare_codecs(), switch_core_media_recover_session(), and switch_core_media_set_r_sdp_codec_string().
switch_database_interface_t* switch_loadable_module_get_database_interface | ( | const char * | name, |
const char * | modname | ||
) |
Retrieve the database interface by it's registered name.
name | the name of the dsn prefix |
Definition at line 2519 of file switch_loadable_module.c.
References switch_loadable_module_container::database_hash, switch_database_node_s::interface_name, loadable_modules, switch_loadable_module_container::mutex, switch_database_node_s::next, PROTECT_INTERFACE, switch_database_node_s::ptr, switch_core_hash_find(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by _switch_cache_db_get_db_handle_dsn_ex(), and switch_database_available().
switch_dialplan_interface_t* switch_loadable_module_get_dialplan_interface | ( | const char * | name | ) |
Retrieve the dialplan interface by it's registered name.
name | the name of the dialplan |
Referenced by switch_core_session_execute_exten(), and switch_core_standard_on_routing().
switch_directory_interface_t* switch_loadable_module_get_directory_interface | ( | const char * | name | ) |
Retrieve the directory interface by it's registered name.
name | the name of the directory interface |
Referenced by switch_core_directory_open().
switch_endpoint_interface_t* switch_loadable_module_get_endpoint_interface | ( | const char * | name | ) |
Retrieve the endpoint interface by it's registered name.
name | the name of the endpoint |
Definition at line 2479 of file switch_loadable_module.c.
References switch_loadable_module_container::endpoint_hash, loadable_modules, switch_loadable_module_container::mutex, PROTECT_INTERFACE, switch_file_node_s::ptr, switch_core_hash_find(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by recover_callback(), switch_core_session_outgoing_channel(), and switch_core_session_request_by_name().
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.
name | the name of the file format |
Definition at line 2492 of file switch_loadable_module.c.
References switch_loadable_module_container::file_hash, switch_file_node_s::interface_name, loadable_modules, switch_loadable_module_container::mutex, switch_file_node_s::next, PROTECT_INTERFACE, switch_file_node_s::ptr, switch_core_hash_find(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_perform_file_open().
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.
name | the name of the API |
Referenced by switch_json_api_execute().
switch_limit_interface_t* switch_loadable_module_get_limit_interface | ( | const char * | name | ) |
Retrieve the limit interface by it's registered name.
name | the name of the limit interface |
Referenced by get_backend().
switch_management_interface_t* switch_loadable_module_get_management_interface | ( | const char * | relative_oid | ) |
Retrieve the management interface by it's registered name.
relative_oid | the relative oid of the management interface |
Definition at line 2601 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::management_hash, switch_loadable_module_container::mutex, SWITCH_CHANNEL_LOG, switch_core_hash_find_locked(), SWITCH_LOG_ERROR, and switch_log_printf().
Referenced by switch_core_management_exec().
switch_say_interface_t* switch_loadable_module_get_say_interface | ( | const char * | name | ) |
Retrieve the say interface by it's registered name.
name | the name of the say interface |
Definition at line 2596 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::mutex, switch_loadable_module_container::say_hash, and switch_core_hash_find_locked().
Referenced by switch_ivr_phrase_macro_event(), switch_ivr_say(), and switch_ivr_say_string().
switch_speech_interface_t* switch_loadable_module_get_speech_interface | ( | const char * | name | ) |
Retrieve the speech interface by it's registered name.
name | the name of the speech interface |
Referenced by switch_core_speech_open().
switch_timer_interface_t* switch_loadable_module_get_timer_interface | ( | const char * | name | ) |
Retrieve the timer interface by it's registered name.
name | the name of the timer |
Referenced by switch_core_timer_init().
switch_status_t switch_loadable_module_init | ( | switch_bool_t | autoload | ) |
Initilize the module backend and load all the modules.
Definition at line 2080 of file switch_loadable_module.c.
References switch_loadable_module_container::api_hash, switch_loadable_module_container::application_hash, switch_loadable_module_container::asr_hash, switch_loadable_module_container::chat_application_hash, chat_globals, switch_loadable_module_container::chat_hash, switch_loadable_module_container::chat_rwlock, chat_thread_start(), switch_loadable_module_container::codec_hash, count, switch_loadable_module_container::database_hash, switch_loadable_module_container::dialplan_hash, switch_loadable_module_container::directory_hash, switch_loadable_module_container::endpoint_hash, switch_loadable_module_container::file_hash, switch_loadable_module_container::json_api_hash, switch_loadable_module_container::limit_hash, loadable_modules, switch_loadable_module_container::management_hash, memset(), switch_directories::mod_dir, switch_loadable_module_container::module_hash, switch_loadable_module_container::mutex, switch_xml::next, path, switch_loadable_module_container::pool, switch_loadable_module_container::say_hash, switch_loadable_module_container::secondary_recover_hash, switch_loadable_module_container::speech_hash, SWITCH_CHANNEL_LOG, switch_core_hash_destroy(), switch_core_hash_first, switch_core_hash_init, switch_core_hash_init_nocase, switch_core_hash_next(), switch_core_hash_this(), switch_core_new_memory_pool, switch_core_sqldb_init(), switch_event_fire, SWITCH_FALSE, SWITCH_GLOBAL_dirs, switch_loadable_module_load_module(), switch_loadable_module_load_module_ex(), switch_loadable_module_runtime(), SWITCH_LOADABLE_MODULE_TYPE_COMMON, SWITCH_LOADABLE_MODULE_TYPE_POSTLOAD, SWITCH_LOADABLE_MODULE_TYPE_PRELOAD, SWITCH_LOG_CONSOLE, SWITCH_LOG_CRIT, switch_log_printf(), switch_mutex_init(), SWITCH_MUTEX_NESTED, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_create(), switch_true(), switch_xml_attr_soft(), switch_xml_child(), switch_xml_free(), switch_xml_open_cfg(), switch_loadable_module_container::timer_hash, and zstr.
Referenced by fs_loadable_module_init(), main(), and switch_core_init_and_modload().
switch_status_t switch_loadable_module_load_module | ( | const char * | dir, |
const char * | fname, | ||
switch_bool_t | runtime, | ||
const char ** | err | ||
) |
Load a module.
dir | the directory where the module resides |
fname | the file name of the module |
runtime | option to start the runtime thread if it exists |
err | pointer to error message |
Definition at line 1779 of file switch_loadable_module.c.
References SWITCH_FALSE, switch_loadable_module_load_module_ex(), and SWITCH_LOADABLE_MODULE_TYPE_COMMON.
Referenced by main(), and switch_loadable_module_init().
switch_status_t switch_loadable_module_protect | ( | const char * | mod | ) |
Protect module from beeing unloaded.
mod | the module name |
Definition at line 1865 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::module_hash, switch_loadable_module_container::mutex, switch_loadable_module::perm, switch_core_hash_find(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
Referenced by _switch_cache_db_get_db_handle().
void switch_loadable_module_shutdown | ( | void | ) |
Shutdown the module backend and call the shutdown routine in all loaded modules.
Definition at line 2386 of file switch_loadable_module.c.
References switch_loadable_module_container::api_hash, switch_loadable_module_container::application_hash, switch_loadable_module_container::asr_hash, switch_loadable_module_container::chat_application_hash, chat_globals, switch_loadable_module_container::chat_hash, switch_loadable_module_container::codec_hash, switch_loadable_module_container::database_hash, switch_loadable_module_container::dialplan_hash, switch_loadable_module_container::directory_hash, do_shutdown(), switch_loadable_module_container::endpoint_hash, switch_loadable_module_container::file_hash, switch_loadable_module_container::json_api_hash, key, switch_loadable_module_container::limit_hash, loadable_modules, switch_loadable_module_container::management_hash, switch_loadable_module_container::module_hash, switch_loadable_module::perm, switch_loadable_module_container::pool, switch_loadable_module_container::say_hash, switch_loadable_module_container::secondary_recover_hash, switch_loadable_module_container::speech_hash, switch_core_destroy_memory_pool, switch_core_hash_delete(), switch_core_hash_destroy(), switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_core_sqldb_destroy(), SWITCH_FALSE, SWITCH_LOADABLE_MODULE_TYPE_PRELOAD, switch_queue_push(), SWITCH_STATUS_SUCCESS, switch_thread_join(), SWITCH_TRUE, switch_yield, switch_loadable_module_container::timer_hash, and switch_loadable_module::type.
Referenced by fs_loadable_module_shutdown(), and switch_core_destroy().
switch_status_t switch_loadable_module_unload_module | ( | const char * | dir, |
const char * | fname, | ||
switch_bool_t | force, | ||
const char ** | err | ||
) |
Unoad a module.
dir | the directory where the module resides |
fname | the file name of the module |
err | pointer to error message |
Definition at line 1889 of file switch_loadable_module.c.
References do_shutdown(), loadable_modules, switch_loadable_module_container::module_hash, switch_loadable_module_container::mutex, switch_loadable_module::perm, SWITCH_CHANNEL_LOG, switch_core_hash_delete(), switch_core_hash_find(), switch_core_hash_insert_locked(), SWITCH_LOG_CRIT, switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_NOUNLOAD, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_yield.
SWITCH_MOD_DECLARE | ( | switch_status_t | ) |
Load a module.
Shutdown a module.
module_interface | a pointer to a pointer to aim at your module's local interface |
filename | the path to the module's dll or so file |
char* switch_parse_codec_buf | ( | char * | buf, |
uint32_t * | interval, | ||
uint32_t * | rate, | ||
uint32_t * | bit, | ||
uint32_t * | channels, | ||
char ** | modname, | ||
char ** | fmtp | ||
) |
Definition at line 2746 of file switch_loadable_module.c.
References buf, cur, name, switch_file_node_s::next, SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, and switch_log_printf().
Referenced by switch_loadable_module_get_codecs_sorted().
const char* filename |
Definition at line 356 of file switch_loadable_module.h.
Referenced by core_event_handler(), switch_simple_email(), and SWITCH_STANDARD_APP().