41 #ifndef SWITCH_MODULE_INTERFACES_H 42 #define SWITCH_MODULE_INTERFACES_H 566 switch_status_t (*incr) (switch_core_session_t *session,
const char *realm,
const char *resource,
const int max,
const int interval);
568 switch_status_t (*release) (switch_core_session_t *session,
const char *realm,
const char *resource);
570 int (*
usage) (
const char *realm,
const char *resource, uint32_t *rcount);
574 char * (*status) (void);
634 switch_status_t(*callback_exec_detailed)(
const char *file,
const char *func,
int line,
663 char config_profile_name[64];
864 #define PROTECT_INTERFACE(_it) if (_it) {switch_thread_rwlock_rdlock(_it->parent->rwlock); switch_thread_rwlock_rdlock(_it->rwlock); switch_mutex_lock(_it->reflock); _it->refs++; _it->parent->refs++; switch_mutex_unlock(_it->reflock);} //if (!strcmp(_it->interface_name, "user")) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "+++++++++++LOCK %s %d/%d\n", _it->interface_name, _it->refs, _it->parent->refs); 865 #define UNPROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); _it->refs--; _it->parent->refs--; switch_mutex_unlock(_it->reflock); switch_thread_rwlock_unlock(_it->rwlock); switch_thread_rwlock_unlock(_it->parent->rwlock);} //if (!strcmp(_it->interface_name, "user")) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "---------UNLOCK %s %d/%d\n", _it->interface_name, _it->refs, _it->parent->refs);
const char * relative_oid
struct switch_database_interface * next
unsigned char * pre_buffer_data
switch_core_session_t * session
switch_state_handler_t on_consume_media
static switch_status_t timer_sync(switch_timer_t *timer)
switch_io_get_jb_t get_jb
switch_status_t(* switch_io_read_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
A module interface to implement an application.
static switch_status_t timer_init(switch_timer_t *timer)
switch_event_t * param_event
static switch_status_t timer_step(switch_timer_t *timer)
switch_state_handler_t on_soft_execute
struct switch_directory_interface * next
switch_io_state_run_t state_run
Abstract interface to a limit module.
const char * interface_name
switch_codec_type_t
Codec types.
const char * interface_name
switch_thread_rwlock_t * rwlock
switch_say_callback_t say_function
switch_core_codec_destroy_func_t destroy
switch_status_t(* switch_io_write_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
Abstraction of an module endpoint interface This is the glue between the abstract idea of a "channel"...
switch_stream_handle_raw_write_function_t raw_write_function
switch_directory_interface_t * directory_interface
uint32_t switch_io_flag_t
struct switch_management_interface * next
switch_file_interface_t * file_interface
switch_io_send_dtmf_t send_dtmf
#define SWITCH_END_EXTERN_C
switch_thread_rwlock_t * rwlock
switch_caller_extension_t *(* switch_dialplan_hunt_function_t)(switch_core_session_t *, void *, switch_caller_profile_t *)
switch_io_read_frame_t read_frame
uint32_t switch_speech_flag_t
#define SWITCH_RECOMMENDED_BUFFER_SIZE
switch_loadable_module_interface_t * parent
switch_chat_application_function_t chat_application_function
switch_status_t(* switch_io_receive_message_t)(switch_core_session_t *, switch_core_session_message_t *)
switch_status_t(* asr_disable_grammar)(switch_asr_handle_t *ah, const char *name)
switch_state_handler_name_t
A table of functions to execute at various states.
uint32_t decoded_bytes_per_packet
switch_loadable_module_interface_t * parent
Representation of an event.
switch_loadable_module_interface_t * parent
A module interface to implement a chat application.
switch_codec_implementation_t * implementations
switch_frame_t * cur_frame
switch_say_string_callback_t say_string_function
switch_io_routines_t * io_routines
switch_loadable_module_interface_t * parent
switch_status_t(* switch_io_write_video_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
struct switch_endpoint_interface * next
switch_status_t(* switch_stream_handle_raw_write_function_t)(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen)
switch_io_receive_event_t receive_event
switch_status_t(* switch_core_codec_fmtp_parse_func_t)(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
switch_status_t(* asr_enable_grammar)(switch_asr_handle_t *ah, const char *name)
Abstract interface to a chat module.
switch_cache_db_database_interface_options_t connection_options
const char * interface_name
switch_thread_rwlock_t * rwlock
switch_core_codec_video_decode_func_t decode_video
switch_loadable_module_interface_t * parent
Abstract interface to a dialplan module.
switch_status_t(* switch_core_codec_init_func_t)(switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings)
uint32_t switch_originate_flag_t
struct switch_speech_interface * next
A table of functions that a timer module implements.
switch_asr_interface_t * asr_interface
A table of i/o routines that an endpoint interface can implement.
Abstract handler to a timer module.
switch_memory_pool_t * memory_pool
const char * interface_name
switch_state_handler_t on_destroy
switch_thread_rwlock_t * rwlock
switch_audio_resampler_t * resampler
switch_status_t(* switch_io_write_text_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
switch_io_read_text_frame_t read_text_frame
switch_state_handler_t on_reporting
Abstract interface to an asr module.
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_json_api_function_t)(const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
switch_core_session_t * session
const char * interface_name
A message object designed to allow unlike technologies to exchange data.
switch_memory_pool_t * memory_pool
Abstract interface to a file format module.
static switch_status_t timer_destroy(switch_timer_t *timer)
switch_thread_rwlock_t * rwlock
switch_loadable_module_interface_t * parent
switch_status_t(* switch_chat_application_function_t)(switch_event_t *, const char *)
static switch_status_t timer_next(switch_timer_t *timer)
struct switch_json_api_interface * next
void(* switch_application_function_t)(switch_core_session_t *, const char *)
switch_loadable_module_interface_t * parent
switch_thread_rwlock_t * rwlock
struct switch_timer_interface * next
switch_memory_pool_t * memory_pool
switch_status_t(* switch_stream_handle_write_function_t)(switch_stream_handle_t *handle, const char *fmt,...)
switch_state_handler_table_t * state_handler
static const char usage[]
switch_thread_rwlock_t * rwlock
const switch_codec_implementation_t * implementation
switch_state_handler_t on_routing
Abstract interface to a speech module.
int microseconds_per_packet
switch_loadable_module_interface_t * parent
A module interface to implement an api function.
switch_loadable_module_interface_t * parent
switch_dialplan_hunt_function_t hunt_function
switch_core_codec_decode_func_t decode
switch_state_handler_t on_init
switch_codec_interface_t * codec_interface
switch_loadable_module_interface_t * parent
switch_timer_interface_t * timer_interface
struct switch_dialplan_interface * next
switch_status_t(* switch_core_codec_video_decode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
Abstract interface to a say module.
switch_memory_pool_t * memory_pool
const char * interface_name
const char * interface_name
switch_codec_type_t codec_type
uint32_t actual_samples_per_second
Abstract interface to a management module.
switch_status_t(* asr_feed_dtmf)(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)
switch_memory_pool_t * memory_pool
switch_status_t(* switch_state_handler_t)(switch_core_session_t *)
uint8_t *(* switch_stream_handle_read_function_t)(switch_stream_handle_t *handle, int *len)
struct switch_api_interface * next
switch_status_t(* switch_say_string_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, char **rstr)
switch_speech_interface_t * speech_interface
const char * interface_name
switch_status_t(* affected_rows)(switch_database_interface_handle_t *dih, int *affected_rows)
const char * interface_name
switch_loadable_module_interface_t * parent
switch_state_handler_t on_hangup
Top level module interface to implement a series of codec implementations.
switch_buffer_t * pre_buffer
switch_application_function_t application_function
switch_call_cause_t(* switch_io_outgoing_channel_t)(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t, switch_call_cause_t *)
An abstraction of a data frame.
struct switch_codec_interface * next
struct switch_chat_interface * next
uint32_t switch_asr_flag_t
switch_stream_handle_read_function_t read_function
struct switch_codec * next
switch_status_t(* switch_say_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
switch_status_t(* asr_disable_all_grammars)(switch_asr_handle_t *ah)
switch_io_state_change_t state_change
struct switch_chat_application_interface * next
int(* switch_core_db_callback_func_t)(void *pArg, int argc, char **argv, char **columnNames)
switch_state_handler_t on_execute
switch_payload_t agreed_pt
int microseconds_per_packet
switch_state_handler_t on_reset
uint32_t last_samplecount
switch_thread_rwlock_t * rwlock
uint32_t actual_samples_per_second
switch_frame_t write_frame
switch_buffer_t * audio_buffer
switch_size_t alloc_chunk
switch_status_t(* switch_api_function_t)(_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
static switch_status_t timer_check(switch_timer_t *timer, switch_bool_t step)
struct fspr_thread_mutex_t switch_mutex_t
switch_status_t(* switch_core_codec_video_encode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
An audio resampling handle.
switch_thread_rwlock_t * rwlock
switch_core_recover_callback_t recover_callback
switch_audio_resampler_t * resampler
switch_io_write_frame_t write_frame
uint32_t samples_per_packet
switch_stream_handle_write_function_t write_function
uint8_t number_of_channels
uint32_t samples_per_second
switch_status_t
Common return values.
switch_status_t(* switch_io_read_video_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
switch_core_codec_fmtp_parse_func_t parse_fmtp
switch_jb_t *(* switch_io_get_jb_t)(switch_core_session_t *, switch_media_type_t)
switch_state_handler_t on_hibernate
switch_buffer_t * sp_audio_buffer
switch_thread_rwlock_t * rwlock
int codec_frames_per_packet
switch_payload_t ianacode
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_core_codec_control_func_t)(switch_codec_t *codec, switch_codec_control_command_t cmd, switch_codec_control_type_t ctype, void *cmd_data, switch_codec_control_type_t atype, void *cmd_arg, switch_codec_control_type_t *rtype, void **ret_data)
uint32_t encoded_bytes_per_packet
int(* switch_core_recover_callback_t)(switch_core_session_t *session)
switch_status_t(* switch_io_state_run_t)(switch_core_session_t *)
switch_memory_pool_t * memory_pool
const char * interface_name
struct fspr_file_t switch_file_t
switch_io_read_video_frame_t read_video_frame
switch_thread_rwlock_t * rwlock
switch_io_receive_message_t receive_message
switch_status_t(* switch_core_codec_decode_func_t)(switch_codec_t *codec, switch_codec_t *other_codec, void *encoded_data, uint32_t encoded_data_len, uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag)
switch_core_codec_init_func_t init
const char * interface_name
switch_io_kill_channel_t kill_channel
struct switch_say_interface * next
switch_thread_rwlock_t * rwlock
switch_io_outgoing_channel_t outgoing_channel
struct switch_codec_implementation * next
switch_size_t samples_out
switch_core_codec_encode_func_t encode
switch_thread_rwlock_t * rwlock
struct switch_application_interface * next
const char * interface_name
A table of settings and callbacks that define a paticular implementation of a codec.
switch_io_write_video_frame_t write_video_frame
A module interface to implement a json api function.
switch_state_handler_t on_park
switch_loadable_module_interface_t * parent
switch_loadable_module_interface_t * parent
struct switch_limit_interface * next
struct fspr_pool_t switch_memory_pool_t
const char * interface_name
const char * interface_name
switch_loadable_module_interface_t * parent
switch_core_codec_video_encode_func_t encode_video
switch_status_t(* switch_io_kill_channel_t)(switch_core_session_t *, int)
switch_status_t(* switch_io_receive_event_t)(switch_core_session_t *, switch_event_t *)
switch_loadable_module_interface_t * parent
switch_size_t sample_count
switch_status_t(* switch_io_send_dtmf_t)(switch_core_session_t *, const switch_dtmf_t *)
switch_audio_resampler_t * resampler
switch_status_t(* switch_core_codec_encode_func_t)(switch_codec_t *codec, switch_codec_t *other_codec, void *decoded_data, uint32_t decoded_data_len, uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag)
switch_size_t pre_buffer_datalen
struct fspr_thread_rwlock_t switch_thread_rwlock_t
struct switch_file_interface * next
Abstract interface to a database module.
switch_thread_rwlock_t * rwlock
switch_thread_rwlock_t * rwlock
switch_state_handler_t on_exchange_media
switch_status_t(* switch_io_read_text_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
switch_status_t(* switch_io_state_change_t)(switch_core_session_t *)
switch_management_action_t
The abstraction of a loadable module.
uint8_t try_hardware_encoder
const char * interface_name
switch_io_write_text_frame_t write_text_frame
A table of lists of io_event_hooks to store the event hooks associated with a session.
switch_loadable_module_interface_t * parent
switch_core_codec_control_func_t codec_control
const char * interface_name
Abstract interface to a directory module.
switch_mutex_t * flag_mutex
struct switch_asr_interface * next
#define SWITCH_BEGIN_EXTERN_C
switch_loadable_module_interface_t * parent
switch_status_t(* switch_core_codec_destroy_func_t)(switch_codec_t *)