40 #ifndef SWITCH_MODULE_INTERFACES_H
41 #define SWITCH_MODULE_INTERFACES_H
580 switch_status_t (*
incr) (switch_core_session_t *session,
const char *realm,
const char *resource,
const int max,
const int interval);
584 int (*
usage) (
const char *realm,
const char *resource, uint32_t *rcount);
588 char * (*status) (void);
836 #define PROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); switch_thread_rwlock_rdlock(_it->parent->rwlock); switch_thread_rwlock_rdlock(_it->rwlock); _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);
837 #define UNPROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); switch_thread_rwlock_unlock(_it->rwlock); switch_thread_rwlock_unlock(_it->parent->rwlock); _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, "---------UNLOCK %s %d/%d\n", _it->interface_name, _it->refs, _it->parent->refs);
struct switch_video_codec_settings video
const char * relative_oid
unsigned char * pre_buffer_data
switch_core_session_t * session
switch_state_handler_t on_consume_media
switch_status_t(* asr_unload_grammar)(switch_asr_handle_t *ah, const char *name)
uint8_t *(* switch_stream_handle_read_function_t)(switch_stream_handle_t *handle, int *len)
switch_io_get_jb_t get_jb
A module interface to implement an application.
switch_event_t * param_event
switch_status_t(* release)(switch_core_session_t *session, const char *realm, const char *resource)
switch_state_handler_t on_soft_execute
struct switch_directory_interface * next
void(* speech_numeric_param_tts)(switch_speech_handle_t *sh, char *param, int val)
switch_io_state_run_t state_run
Abstract interface to a limit module.
const char * interface_name
switch_codec_type_t
Codec types.
switch_status_t(* switch_io_state_run_t)(switch_core_session_t *)
const char * interface_name
switch_thread_rwlock_t * rwlock
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)
switch_say_callback_t say_function
switch_core_codec_destroy_func_t destroy
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_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 *)
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
switch_status_t(* file_command)(switch_file_handle_t *fh, switch_file_command_t command)
#define SWITCH_END_EXTERN_C
switch_thread_rwlock_t * rwlock
switch_io_read_frame_t read_frame
uint32_t switch_speech_flag_t
#define SWITCH_RECOMMENDED_BUFFER_SIZE
switch_status_t(* directory_next_pair)(switch_directory_handle_t *dh, char **var, char **val)
switch_loadable_module_interface_t * parent
switch_status_t(* chat_send)(switch_event_t *message_event)
switch_chat_application_function_t chat_application_function
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_status_t(* switch_chat_application_function_t)(switch_event_t *, const char *)
switch_loadable_module_interface_t * parent
A module interface to implement a chat application.
switch_codec_implementation_t * implementations
switch_status_t(* incr)(switch_core_session_t *session, const char *realm, const char *resource, const int max, const int interval)
switch_frame_t * cur_frame
switch_say_string_callback_t say_string_function
switch_io_routines_t * io_routines
switch_status_t(* interval_reset)(const char *realm, const char *resource)
switch_loadable_module_interface_t * parent
switch_jb_t *(* switch_io_get_jb_t)(switch_core_session_t *, switch_media_type_t)
struct switch_endpoint_interface * next
uint8_t try_hardware_encoder
switch_io_receive_event_t receive_event
switch_status_t(* reset)(void)
switch_status_t(* switch_say_string_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, char **rstr)
Abstract interface to a chat module.
switch_status_t(* switch_io_read_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
const char * interface_name
switch_thread_rwlock_t * rwlock
struct switch_audio_codec_settings audio
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_say_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
switch_status_t(* switch_io_write_video_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
uint32_t switch_originate_flag_t
struct switch_speech_interface * next
A table of functions that a timer module implements.
switch_video_encode_speed_t
switch_status_t(* switch_io_kill_channel_t)(switch_core_session_t *, int)
switch_asr_interface_t * asr_interface
A table of i/o routines that an endpoint interface can implement.
switch_status_t(* switch_io_receive_event_t)(switch_core_session_t *, switch_event_t *)
Abstract handler to a timer module.
switch_memory_pool_t * memory_pool
switch_video_profile_t vprofile
const char * interface_name
switch_status_t(* switch_core_codec_video_encode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
switch_state_handler_t on_destroy
switch_thread_rwlock_t * rwlock
switch_status_t(* file_write_video)(switch_file_handle_t *, switch_frame_t *frame)
switch_audio_resampler_t * resampler
switch_state_handler_t on_reporting
Abstract interface to an asr module.
switch_thread_rwlock_t * rwlock
switch_core_session_t * session
switch_status_t(* switch_io_receive_message_t)(switch_core_session_t *, switch_core_session_message_t *)
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.
switch_status_t(* speech_feed_tts)(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
switch_thread_rwlock_t * rwlock
switch_loadable_module_interface_t * parent
struct switch_json_api_interface * next
switch_loadable_module_interface_t * parent
switch_thread_rwlock_t * rwlock
switch_status_t(* file_open)(switch_file_handle_t *, const char *file_path)
struct switch_timer_interface * next
switch_memory_pool_t * memory_pool
switch_status_t(* switch_io_write_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
switch_status_t(* asr_open)(switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags)
switch_state_handler_table_t * state_handler
switch_status_t(* file_close)(switch_file_handle_t *)
switch_status_t(* asr_pause)(switch_asr_handle_t *ah)
switch_thread_rwlock_t * rwlock
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)
void(* switch_application_function_t)(switch_core_session_t *, const char *)
const switch_codec_implementation_t * implementation
switch_state_handler_t on_routing
switch_status_t(* timer_next)(switch_timer_t *)
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
Abstract interface to a say module.
switch_memory_pool_t * memory_pool
switch_status_t(* timer_init)(switch_timer_t *)
void(* asr_text_param)(switch_asr_handle_t *ah, char *param, const char *val)
const char * interface_name
switch_codec_type_t codec_type
uint32_t actual_samples_per_second
Abstract interface to a management module.
switch_memory_pool_t * memory_pool
struct switch_api_interface * next
switch_status_t(* switch_state_handler_t)(switch_core_session_t *)
switch_status_t(* timer_sync)(switch_timer_t *)
switch_status_t(* asr_load_grammar)(switch_asr_handle_t *ah, const char *grammar, const char *name)
int(* usage)(const char *realm, const char *resource, uint32_t *rcount)
struct switch_mm_s switch_mm_t
switch_speech_interface_t * speech_interface
const char * interface_name
struct apr_thread_rwlock_t switch_thread_rwlock_t
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_status_t(* asr_get_result_headers)(switch_asr_handle_t *ah, switch_event_t **headers, switch_asr_flag_t *flags)
switch_status_t(* switch_core_codec_destroy_func_t)(switch_codec_t *)
switch_application_function_t application_function
switch_status_t(* switch_core_codec_init_func_t)(switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings)
switch_status_t(* asr_resume)(switch_asr_handle_t *ah)
switch_status_t(* file_set_string)(switch_file_handle_t *fh, switch_audio_col_t col, const char *string)
switch_status_t(* asr_enable_grammar)(switch_asr_handle_t *ah, const char *name)
An abstraction of a data frame.
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)
struct switch_codec_interface * next
struct switch_chat_interface * next
uint32_t switch_asr_flag_t
switch_status_t(* directory_close)(switch_directory_handle_t *dh)
switch_stream_handle_read_function_t read_function
struct switch_codec * next
switch_status_t(* file_write)(switch_file_handle_t *, void *data, switch_size_t *len)
switch_io_state_change_t state_change
struct switch_chat_application_interface * next
switch_state_handler_t on_execute
struct apr_file_t switch_file_t
switch_status_t(* file_read)(switch_file_handle_t *, void *data, switch_size_t *len)
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_payload_t agreed_pt
int microseconds_per_packet
switch_state_handler_t on_reset
switch_thread_rwlock_t * rwlock
char frame_data[SWITCH_RECOMMENDED_BUFFER_SIZE]
uint32_t actual_samples_per_second
switch_frame_t write_frame
switch_status_t(* switch_io_state_change_t)(switch_core_session_t *)
switch_buffer_t * audio_buffer
switch_size_t alloc_chunk
void(* speech_flush_tts)(switch_speech_handle_t *sh)
switch_video_encode_speed_t vencspd
switch_status_t(* file_read_video)(switch_file_handle_t *, switch_frame_t *frame, switch_video_read_flag_t flags)
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
switch_status_t(* asr_close)(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
uint8_t number_of_channels
struct apr_thread_mutex_t switch_mutex_t
uint32_t samples_per_second
switch_status_t
Common return values.
switch_core_codec_fmtp_parse_func_t parse_fmtp
switch_state_handler_t on_hibernate
switch_status_t(* asr_feed_dtmf)(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)
switch_status_t(* directory_open)(switch_directory_handle_t *dh, char *source, char *dsn, char *passwd)
switch_buffer_t * sp_audio_buffer
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_io_send_dtmf_t)(switch_core_session_t *, const switch_dtmf_t *)
switch_status_t(* switch_json_api_function_t)(const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
switch_caller_extension_t *(* switch_dialplan_hunt_function_t)(switch_core_session_t *, void *, switch_caller_profile_t *)
int codec_frames_per_packet
switch_payload_t ianacode
switch_status_t(* directory_query)(switch_directory_handle_t *dh, char *base, char *query)
switch_status_t(* speech_close)(switch_speech_handle_t *, switch_speech_flag_t *flags)
switch_status_t(* asr_start_input_timers)(switch_asr_handle_t *ah)
switch_thread_rwlock_t * rwlock
switch_status_t(* speech_read_tts)(switch_speech_handle_t *sh, void *data, switch_size_t *datalen, switch_speech_flag_t *flags)
switch_status_t(* switch_io_read_video_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
uint32_t encoded_bytes_per_packet
void(* speech_text_param_tts)(switch_speech_handle_t *sh, char *param, const char *val)
switch_status_t(* switch_stream_handle_raw_write_function_t)(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen)
void(* speech_float_param_tts)(switch_speech_handle_t *sh, char *param, double val)
switch_status_t(* timer_check)(switch_timer_t *, switch_bool_t)
switch_memory_pool_t * memory_pool
const char * interface_name
switch_io_read_video_frame_t read_video_frame
switch_thread_rwlock_t * rwlock
switch_io_receive_message_t receive_message
switch_core_codec_init_func_t init
void(* asr_numeric_param)(switch_asr_handle_t *ah, char *param, int val)
const char * interface_name
switch_io_kill_channel_t kill_channel
switch_status_t(* asr_disable_grammar)(switch_asr_handle_t *ah, const char *name)
struct switch_say_interface * next
switch_io_outgoing_channel_t outgoing_channel
int(* switch_core_recover_callback_t)(switch_core_session_t *session)
switch_status_t(* file_get_string)(switch_file_handle_t *fh, switch_audio_col_t col, const char **string)
switch_status_t(* file_truncate)(switch_file_handle_t *, int64_t offset)
struct switch_codec_implementation * next
switch_size_t samples_out
switch_core_codec_encode_func_t encode
switch_status_t(* timer_destroy)(switch_timer_t *)
switch_status_t(* speech_open)(switch_speech_handle_t *sh, const char *voice_name, int rate, int channels, switch_speech_flag_t *flags)
switch_thread_rwlock_t * rwlock
struct apr_pool_t switch_memory_pool_t
struct switch_application_interface * next
switch_status_t(* switch_stream_handle_write_function_t)(switch_stream_handle_t *handle, const char *fmt,...)
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_status_t(* timer_step)(switch_timer_t *)
switch_loadable_module_interface_t * parent
struct switch_limit_interface * next
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(* asr_get_results)(switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags)
switch_status_t(* management_function)(char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen)
switch_loadable_module_interface_t * parent
switch_size_t sample_count
switch_status_t(* switch_core_codec_video_decode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
switch_audio_resampler_t * resampler
switch_status_t(* asr_check_results)(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
switch_size_t pre_buffer_datalen
switch_status_t(* directory_next)(switch_directory_handle_t *dh)
struct switch_file_interface * next
switch_thread_rwlock_t * rwlock
void(* asr_float_param)(switch_asr_handle_t *ah, char *param, double val)
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_core_codec_fmtp_parse_func_t)(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
switch_state_handler_t on_exchange_media
switch_management_action_t
switch_status_t(* asr_feed)(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags)
The abstraction of a loadable module.
switch_status_t(* asr_disable_all_grammars)(switch_asr_handle_t *ah)
uint8_t try_hardware_encoder
const char * interface_name
A table of lists of io_event_hooks to store the event hooks associated with a session.
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(* file_seek)(switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence)