FreeSWITCH API Documentation
1.7.0
|
Loadable Module Routines. More...
Go to the source code of this file.
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) |
#define | SWITCH_DECLARE_STATIC_MODULE(init, load, run, shut) |
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) |
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_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, 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 (char *dir, 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_unload_module (char *dir, 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) |
static void | switch_core_codec_add_video_implementation (switch_memory_pool_t *pool, switch_codec_interface_t *codec_interface, switch_payload_t ianacode, const char *iananame, char *fmtp, switch_core_codec_init_func_t init, switch_core_codec_video_encode_func_t encode, switch_core_codec_video_decode_func_t decode, switch_core_codec_control_func_t control, switch_core_codec_destroy_func_t destroy) |
static switch_bool_t | switch_core_codec_ready (switch_codec_t *codec) |
switch_core_recover_callback_t | switch_core_get_secondary_recover_callback (const char *key) |
switch_status_t | switch_core_register_secondary_recover_callback (const char *key, switch_core_recover_callback_t cb) |
void | switch_core_unregister_secondary_recover_callback (const char *key) |
Variables | |
char * | filename |
Loadable Module Routines.
This module is the gateway between external modules and the core of the application. it contains all the access points to the various pluggable interfaces including the codecs and API modules.
Definition in file switch_loadable_module.h.
#define SWITCH_DECLARE_STATIC_MODULE | ( | init, | |
load, | |||
run, | |||
shut | |||
) |
Definition at line 580 of file switch_loadable_module.h.
|
inlinestatic |
ianacode | the IANA code number |
iananame | the IANA code name |
fmtp | default fmtp to send (can be overridden by the init function) |
encode | function to encode raw data into encoded data |
decode | function to decode encoded data into raw data |
control | function to send control messages to the codec |
destroy | deinitalize a codec handle using this implementation |
Definition at line 537 of file switch_loadable_module.h.
References switch_codec_implementation::actual_samples_per_second, switch_codec_implementation::bits_per_second, switch_codec_implementation::codec_control, 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_video, switch_codec_implementation::destroy, switch_codec_implementation::encode_video, 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, memset(), 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_CODEC_TYPE_VIDEO, switch_core_alloc, switch_core_codec_next_id(), and switch_core_strdup.
|
inlinestatic |
Definition at line 585 of file switch_loadable_module.h.
References switch_codec::codec_interface, switch_codec::flags, switch_codec::implementation, switch_codec::mutex, SWITCH_CODEC_FLAG_READY, SWITCH_FALSE, and SWITCH_TRUE.
Referenced by early_thread_run(), switch_core_codec_control(), switch_core_codec_decode(), switch_core_codec_decode_video(), switch_core_codec_destroy(), switch_core_codec_encode(), switch_core_codec_encode_video(), switch_core_media_bug_prune(), switch_core_media_bug_remove(), switch_core_media_bug_remove_all_function(), switch_core_media_bug_remove_callback(), switch_core_media_bug_transfer_callback(), switch_core_media_codec_control(), switch_core_media_negotiate_sdp(), switch_core_media_read_frame(), switch_core_media_read_lock_unlock(), switch_core_media_set_codec(), switch_core_media_set_outgoing_bitrate(), switch_core_media_set_video_codec(), switch_core_media_write_frame(), switch_core_session_outgoing_channel(), switch_core_session_raw_read(), switch_core_session_read_frame(), switch_core_session_reset(), switch_core_session_set_read_codec(), switch_core_session_set_real_read_codec(), switch_core_session_set_video_read_codec(), switch_core_session_set_video_write_codec(), switch_core_session_set_write_codec(), switch_core_session_stop_media(), switch_core_session_write_frame(), switch_ivr_deactivate_unicast(), switch_ivr_originate(), switch_ivr_play_file(), switch_ivr_speak_text_handle(), switch_ivr_wait_for_answer(), and switch_media_handle_destroy().
switch_core_recover_callback_t switch_core_get_secondary_recover_callback | ( | const char * | key | ) |
Definition at line 2802 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::mutex, switch_loadable_module_container::secondary_recover_hash, switch_core_hash_find(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by recover_callback().
switch_status_t switch_core_register_secondary_recover_callback | ( | const char * | key, |
switch_core_recover_callback_t | cb | ||
) |
Definition at line 2814 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::mutex, switch_loadable_module_container::secondary_recover_hash, switch_assert, switch_core_hash_find(), switch_core_hash_insert, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
void switch_core_unregister_secondary_recover_callback | ( | const char * | key | ) |
Definition at line 2832 of file switch_loadable_module.c.
References loadable_modules, switch_loadable_module_container::mutex, switch_loadable_module_container::secondary_recover_hash, switch_core_hash_delete(), switch_mutex_lock(), and switch_mutex_unlock().