47 #define SWITCH_MAX_CORE_THREAD_SESSION_OBJS 128 48 #define SWITCH_MAX_STREAMS 128 148 #define DTLS_SRTP_FNAME "dtls-srtp" 150 #define MAX_FPSTRLEN 192 175 #define MESSAGE_STAMP_FFL(_m) _m->_file = __FILE__; _m->_func = __SWITCH_FUNC__; _m->_line = __LINE__ 177 #define MESSAGE_STRING_ARG_MAX 10 229 struct switch_core_runtime;
235 void *m = malloc(_b);
242 void *m = realloc(_b, _z);
265 #define switch_core_session_get_name(_s) switch_channel_get_name(switch_core_session_get_channel(_s)) 291 _In_ const char *
function,
405 #define switch_core_media_bug_remove_all(_s) switch_core_media_bug_remove_all_function(_s, NULL) 532 #ifdef SWITCH_DEBUG_RWLOCKS 541 #ifdef SWITCH_DEBUG_RWLOCKS 542 #define switch_core_session_read_lock(session) switch_core_session_perform_read_lock(session, __FILE__, __SWITCH_FUNC__, __LINE__) 548 #ifdef SWITCH_DEBUG_RWLOCKS 558 #ifdef SWITCH_DEBUG_RWLOCKS 559 #define switch_core_session_read_lock_hangup(session) switch_core_session_perform_read_lock_hangup(session, __FILE__, __SWITCH_FUNC__, __LINE__) 565 #ifdef SWITCH_DEBUG_RWLOCKS 573 #ifdef SWITCH_DEBUG_RWLOCKS 574 #define switch_core_session_write_lock(session) switch_core_session_perform_write_lock(session, __FILE__, __SWITCH_FUNC__, __LINE__) 579 #ifdef SWITCH_DEBUG_RWLOCKS 587 #ifdef SWITCH_DEBUG_RWLOCKS 588 #define switch_core_session_rwunlock(session) switch_core_session_perform_rwunlock(session, __FILE__, __SWITCH_FUNC__, __LINE__) 633 #define switch_core_new_memory_pool(p) switch_core_perform_new_memory_pool(p, __FILE__, __SWITCH_FUNC__, __LINE__) 642 #define switch_core_destroy_memory_pool(p) switch_core_perform_destroy_memory_pool(p, __FILE__, __SWITCH_FUNC__, __LINE__) 671 #define switch_core_permanent_alloc(_memory) switch_core_perform_permanent_alloc(_memory, __FILE__, __SWITCH_FUNC__, __LINE__) 684 #define switch_core_alloc(_pool, _mem) switch_core_perform_alloc(_pool, _mem, __FILE__, __SWITCH_FUNC__, __LINE__) 687 const char *func,
int line);
696 #define switch_core_session_alloc(_session, _memory) switch_core_perform_session_alloc(_session, _memory, __FILE__, __SWITCH_FUNC__, __LINE__) 707 #define switch_core_permanent_strdup(_todup) switch_core_perform_permanent_strdup(_todup, __FILE__, __SWITCH_FUNC__, __LINE__) 719 #define switch_core_session_strdup(_session, _todup) switch_core_perform_session_strdup(_session, _todup, __FILE__, __SWITCH_FUNC__, __LINE__) 733 #define switch_core_strdup(_pool, _todup) switch_core_perform_strdup(_pool, _todup, __FILE__, __SWITCH_FUNC__, __LINE__) 735 #define switch_core_strndup(_pool, _todup, _len) switch_core_perform_strndup(_pool, _todup, _len, __FILE__, __SWITCH_FUNC__, __LINE__) 803 #define switch_core_session_request(_ep, _d, _f, _p) switch_core_session_request_uuid(_ep, _d, _f, _p, NULL) 817 #define switch_core_session_destroy(session) switch_core_session_perform_destroy(session, __FILE__, __SWITCH_FUNC__, __LINE__) 932 #define switch_core_session_locate(uuid_str) switch_core_session_perform_locate(uuid_str, __FILE__, __SWITCH_FUNC__, __LINE__) 941 #define switch_core_session_force_locate(uuid_str) switch_core_session_perform_force_locate(uuid_str, __FILE__, __SWITCH_FUNC__, __LINE__) 1000 #define switch_core_session_hupall_matching_var(_vn, _vv, _c) switch_core_session_hupall_matching_var_ans(_vn, _vv, _c, SHT_UNANSWERED | SHT_ANSWERED) 1010 #define switch_core_session_hupall_matching_vars(_vs, _c) switch_core_session_hupall_matching_vars_ans(_vs, _c, SHT_UNANSWERED | SHT_ANSWERED) 1026 const char *file,
const char *func,
int line);
1028 #define switch_core_session_get_partner(_session, _partner) switch_core_session_perform_get_partner(_session, _partner, __FILE__, __SWITCH_FUNC__, __LINE__) 1129 #define switch_core_session_execute_application(_a, _b, _c) switch_core_session_execute_application_get_flags(_a, _b, _c, NULL) 1143 _In_z_ const char *exten,
1160 #define switch_core_session_get_private(_s) switch_core_session_get_private_class(_s, SWITCH_PVT_PRIMARY) 1169 #define switch_core_session_set_private(_s, _p) switch_core_session_set_private_class(_s, _p, SWITCH_PVT_PRIMARY) 1216 #define switch_core_service_session(_s) switch_core_service_session_av(_s, SWITCH_TRUE, SWITCH_FALSE) 1232 _In_z_ const char *endpoint_name,
1246 const char *file,
const char *func,
int line);
1247 #define switch_core_session_receive_message(_session, _message) switch_core_session_perform_receive_message(_session, _message, \ 1248 __FILE__, __SWITCH_FUNC__, __LINE__) 1393 #define switch_core_session_kill_channel(session, sig) switch_core_session_perform_kill_channel(session, __FILE__, __SWITCH_FUNC__, __LINE__, sig) 1431 #define switch_core_hash_init(_hash) switch_core_hash_init_case(_hash, SWITCH_TRUE) 1432 #define switch_core_hash_init_nocase(_hash) switch_core_hash_init_case(_hash, SWITCH_FALSE) 1479 #define switch_core_hash_insert(_h, _k, _d) switch_core_hash_insert_destructor(_h, _k, _d, NULL) 1490 #define switch_core_hash_insert_alloc(_h, _k, _s) switch_core_hash_insert_alloc_destructor(_h, _k, _s, NULL) 1501 #define switch_core_hash_insert_dup(_h, _k, _d) switch_core_hash_insert_dup_destructor(_h, _k, _d, NULL) 1592 #define switch_core_hash_first(_h) switch_core_hash_first_iter(_h, NULL) 1693 #define switch_core_codec_init(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, _flags, _codec_settings, _pool) \ 1694 switch_core_codec_init_with_bitrate(_codec, _codec_name, _modname, _fmtp, _rate, _ms, _channels, 0, _flags, _codec_settings, _pool) 1696 const char *codec_name,
1698 const char *modname,
1729 uint32_t decoded_data_len,
1730 uint32_t decoded_rate,
1731 void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate,
unsigned int *flag);
1750 uint32_t encoded_data_len,
1751 uint32_t encoded_rate,
1752 void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate,
unsigned int *flag);
1949 _In_ uint32_t channels,
1963 #define switch_core_file_open(_fh, _file_path, _channels, _rate, _flags, _pool) \ 1964 switch_core_perform_file_open(__FILE__, __SWITCH_FUNC__, __LINE__, _fh, _file_path, _channels, _rate, _flags, _pool) 2069 const char *module_name,
2070 const char *voice_name,
2071 _In_ unsigned int rate,
2072 _In_ unsigned int interval,
2073 _In_ unsigned int channels,
2145 const char *module_name,
2519 #define switch_check_network_list_ip(_ip_str, _list_name) switch_check_network_list_ip_token(_ip_str, _list_name, NULL) 2538 const char *subject,
const char *body,
const char *type,
const char *hint,
switch_bool_t blocking);
2555 #define CACHE_DB_LEN 256 2604 const char *type_str =
"INVALID";
2609 type_str =
"DATABASE_INTERFACE";
2619 type_str =
"CORE_DB";
2650 switch_cache_db_handle_type_t
type,
2652 const char *file,
const char *func,
int line);
2653 #define switch_cache_db_get_db_handle(_a, _b, _c) _switch_cache_db_get_db_handle(_a, _b, _c, __FILE__, __SWITCH_FUNC__, __LINE__) 2656 const char *file,
const char *func,
int line);
2658 const char *file,
const char *func,
int line);
2659 #define switch_cache_db_get_db_handle_dsn(_a, _b) _switch_cache_db_get_db_handle_dsn(_a, _b, __FILE__, __SWITCH_FUNC__, __LINE__) 2707 void *pdata,
char **err);
2729 #define switch_core_db_handle(_a) _switch_core_db_handle(_a, __FILE__, __SWITCH_FUNC__, __LINE__) 2732 const char *test_sql,
const char *drop_sql,
const char *reactive_sql);
2734 const char *test_sql,
const char *drop_sql,
const char *reactive_sql,
const char *row_size_limited_reactive_sql);
2737 const char *pre_trans_execute,
2738 const char *post_trans_execute,
2739 const char *inner_pre_trans_execute,
2740 const char *inner_post_trans_execute);
2741 #define switch_cache_db_persistant_execute_trans(_d, _s, _r) switch_cache_db_persistant_execute_trans_full(_d, _s, _r, NULL, NULL, NULL, NULL) 2784 const char *network_ip,
const char *network_port,
const char *network_proto,
2785 const char *metadata);
2844 uint32_t numq,
const char *dsn, uint32_t max_trans,
2845 const char *pre_trans_execute,
2846 const char *post_trans_execute,
2847 const char *inner_pre_trans_execute,
2848 const char *inner_post_trans_execute);
2850 #define switch_sql_queue_manager_init(_q, _n, _d, _m, _p1, _p2, _ip1, _ip2) switch_sql_queue_manager_init_name(__FILE__, _q, _n, _d, _m, _p1, _p2, _ip1, _ip2) 2881 #define switch_core_session_request_video_refresh(_s) _switch_core_session_request_video_refresh(_s, 0, __FILE__, __SWITCH_FUNC__, __LINE__) 2882 #define switch_core_session_force_request_video_refresh(_s) _switch_core_session_request_video_refresh(_s, 1, __FILE__, __SWITCH_FUNC__, __LINE__) switch_status_t switch_sql_queue_manager_destroy(switch_sql_queue_manager_t **qmp)
switch_status_t switch_core_codec_decode_video(switch_codec_t *codec, switch_frame_t *frame)
Decode video data using a codec handle.
switch_console_callback_match_t * switch_core_session_findall(void)
char * switch_core_perform_strndup(_In_ switch_memory_pool_t *pool, _In_z_ const char *todup, size_t len, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
int32_t change_user_group(const char *user, const char *group)
Change user and/or group of the running process.
switch_status_t switch_core_speech_read_tts(switch_speech_handle_t *sh, void *data, switch_size_t *datalen, switch_speech_flag_t *flags)
Read rendered audio from the TTS module.
switch_frame_t * switch_core_media_bug_get_video_ping_frame(switch_media_bug_t *bug)
switch_time_t switch_micro_time_now(void)
Get the current epoch time in microseconds.
void switch_core_session_hangup_state(switch_core_session_t *session, switch_bool_t force)
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.
switch_status_t switch_core_session_start_text_thread(switch_core_session_t *session)
switch_status_t switch_core_hash_insert_dup_destructor(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ const char *str, hashtable_destructor_t destructor)
Insert strdup(str) into a hash.
const char * switch_core_get_switchname(void)
switch_status_t switch_core_speech_feed_tts(switch_speech_handle_t *sh, const char *text, switch_speech_flag_t *flags)
Feed text to the TTS module.
switch_status_t switch_console_set_complete(const char *string)
void switch_core_thread_session_end(_In_ switch_core_session_t *session)
Signal a thread using a thread session to terminate.
void switch_time_sync(void)
switch_status_t switch_ivr_dmachine_set_terminators(switch_ivr_dmachine_t *dmachine, const char *terminators)
switch_status_t switch_core_session_io_write_lock(switch_core_session_t *session)
void switch_core_session_set_dmachine(switch_core_session_t *session, switch_ivr_dmachine_t *dmachine, switch_digit_action_target_t target)
switch_status_t switch_core_session_set_external_id(_In_ switch_core_session_t *session, _In_z_ const char *use_external_id)
A module interface to implement an application.
switch_bool_t make_module_no_unloadable
switch_status_t switch_cache_db_execute_sql_event_callback(switch_cache_db_handle_t *dbh, const char *sql, switch_core_db_event_callback_func_t callback, void *pdata, char **err)
void switch_close_extra_files(int *keep, int keep_ttl)
switch_status_t switch_core_asr_start_input_timers(switch_asr_handle_t *ah)
Start input timers on an asr handle.
switch_status_t switch_core_mime_add_type(const char *type, const char *ext)
void switch_sql_queue_manager_execute_sql_event_callback_err(switch_sql_queue_manager_t *qm, const char *sql, switch_core_db_event_callback_func_t callback, switch_core_db_err_callback_func_t err_callback, void *pdata)
char * switch_core_session_sprintf(_In_ switch_core_session_t *session, _In_z_ _Printf_format_string_ const char *fmt,...)
printf-style style printing routine. The data is output to a string allocated from the session ...
switch_status_t switch_core_codec_parse_fmtp(const char *codec_name, const char *fmtp, uint32_t rate, switch_codec_fmtp_t *codec_fmtp)
int switch_sql_queue_manager_size(switch_sql_queue_manager_t *qm, uint32_t index)
void switch_core_memory_reclaim_logger(void)
void switch_core_session_reporting_state(switch_core_session_t *session)
switch_status_t switch_core_port_allocator_free_port(_In_ switch_core_port_allocator_t *alloc, _In_ switch_port_t port)
Return unused port to the port allocator.
switch_status_t switch_core_inthash_init(switch_inthash_t **hash)
switch_text_channel_t
A target to write log/debug info to.
switch_status_t switch_core_timer_init(switch_timer_t *timer, const char *timer_name, int interval, int samples, switch_memory_pool_t *pool)
Request a timer handle using given time module.
switch_core_session_message_types_t message_id
switch_status_t switch_core_session_set_codec_slin(switch_core_session_t *session, switch_slin_data_t *data)
void switch_core_session_reset(_In_ switch_core_session_t *session, switch_bool_t flush_dtmf, switch_bool_t reset_read_codec)
Reset the buffers and resampler on a session.
switch_status_t switch_core_asr_disable_all_grammars(switch_asr_handle_t *ah)
Disable all grammars from an asr handle.
switch_time_t switch_core_uptime(void)
Number of microseconds the system has been up.
void switch_core_session_passthru(switch_core_session_t *session, switch_media_type_t type, switch_bool_t on)
switch_status_t switch_core_hash_destroy(_Inout_ switch_hash_t **hash)
Destroy an existing hash table.
void switch_core_asr_float_param(switch_asr_handle_t *ah, char *param, double val)
Set a float parameter on an asr handle.
const char *const const double number
const char * switch_version_minor(void)
void * switch_core_hash_find(_In_ switch_hash_t *hash, _In_z_ const char *key)
Retrieve data from a given hash.
struct switch_hold_record_s * next
void switch_core_session_signal_state_change(_In_ switch_core_session_t *session)
struct switch_odbc_handle switch_odbc_handle_t
char * switch_core_vsprintf(switch_memory_pool_t *pool, _In_z_ _Printf_format_string_ const char *fmt, va_list ap)
printf-style style printing routine. The data is output to a string allocated from the pool ...
switch_status_t switch_core_asr_get_result_headers(switch_asr_handle_t *ah, switch_event_t **headers, switch_asr_flag_t *flags)
Get result headers from an asr handle.
switch_status_t switch_core_directory_query(switch_directory_handle_t *dh, char *base, char *query)
Query a directory handle.
Abstraction of an module endpoint interface This is the glue between the abstract idea of a "channel"...
void * switch_core_media_bug_get_user_data(_In_ switch_media_bug_t *bug)
Obtain private data from a media bug.
switch_size_t string_arg_size
uint32_t switch_core_sessions_per_second(_In_ uint32_t new_limit)
Set/Get Session Rate Limit.
switch_bool_t(* switch_hash_delete_callback_t)(_In_ const void *key, _In_ const void *val, _In_opt_ void *pData)
void switch_core_media_bug_flush(_In_ switch_media_bug_t *bug)
Flush the read and write buffers for the bug.
int switch_core_test_flag(int flag)
switch_status_t switch_core_session_set_video_read_callback(switch_core_session_t *session, switch_core_video_thread_callback_func_t func, void *user_data)
const char * switch_version_full(void)
uint32_t switch_io_flag_t
int switch_stream_system_fork(const char *cmd, switch_stream_handle_t *stream)
switch_frame_t * switch_core_media_bug_get_native_read_frame(switch_media_bug_t *bug)
void switch_time_set_nanosleep(switch_bool_t enable)
uint16_t switch_core_get_rtp_port_range_end_port(void)
Get RTP port range end value.
#define SWITCH_END_EXTERN_C
switch_device_state_t state
void switch_core_media_bug_set_write_replace_frame(_In_ switch_media_bug_t *bug, _In_ switch_frame_t *frame)
Set a return replace frame.
#define MESSAGE_STRING_ARG_MAX
switch_device_state_t last_state
switch_cache_db_handle_type_t type
switch_status_t switch_core_init(_In_ switch_core_flag_t flags, _In_ switch_bool_t console, _Out_ const char **err)
Initilize the core.
char * switch_core_perform_strdup(_In_ switch_memory_pool_t *pool, _In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
switch_status_t switch_core_session_perform_kill_channel(_In_ switch_core_session_t *session, const char *file, const char *func, int line, switch_signal_t sig)
char * switch_core_get_variable_pdup(_In_z_ const char *varname, switch_memory_pool_t *pool)
int32_t set_low_priority(void)
switch_status_t switch_core_del_registration(const char *user, const char *realm, const char *token)
Delete user registration.
switch_status_t switch_core_session_set_video_read_codec(_In_ switch_core_session_t *session, switch_codec_t *codec)
Assign the video_read codec to a given session.
switch_cache_db_core_db_options_t core_db_options
uint32_t switch_speech_flag_t
void switch_core_session_perform_destroy(_Inout_ switch_core_session_t **session, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
switch_device_stats_t stats
uint32_t switch_core_debug_level(void)
#define SWITCH_MAX_CORE_THREAD_SESSION_OBJS
switch_bool_t switch_core_running(void)
void switch_core_session_unsched_heartbeat(switch_core_session_t *session)
switch_status_t switch_core_session_perform_receive_message(_In_ switch_core_session_t *session, _In_ switch_core_session_message_t *message, const char *file, const char *func, int line)
Receive a message on a given session.
const char * switch_version_major(void)
void switch_core_remove_state_handler(_In_ const switch_state_handler_table_t *state_handler)
Remove a global state handler.
switch_codec_t * switch_core_session_get_video_read_codec(_In_ switch_core_session_t *session)
Retrieve the video_read codec from a given session.
switch_mutex_t * switch_core_session_get_mutex(switch_core_session_t *session)
Signal a session's state machine thread that a state change has occured.
switch_bool_t(* switch_media_bug_callback_t)(switch_media_bug_t *, void *, switch_abc_type_t)
switch_status_t switch_core_asr_open(switch_asr_handle_t *ah, const char *module_name, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags, switch_memory_pool_t *pool)
Open an asr handle.
switch_status_t switch_core_session_set_read_codec(_In_ switch_core_session_t *session, switch_codec_t *codec)
Assign the read codec to a given session.
switch_status_t switch_database_available(char *dsn)
Returns error if no suitable database interface found for a dsn.
void switch_core_media_bug_set_media_params(switch_media_bug_t *bug, switch_mm_t *mm)
switch_status_t switch_core_codec_encode(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)
Encode data using a codec handle.
switch_status_t switch_core_get_stacksizes(switch_size_t *cur, switch_size_t *max)
switch_status_t switch_core_asr_get_results(switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags)
Get results from an asr handle.
switch_bool_t switch_core_set_var_conditional(_In_z_ const char *varname, _In_opt_z_ const char *value, _In_opt_z_ const char *val2)
Conditionally add a global variable to the core.
switch_status_t switch_core_session_set_read_impl(switch_core_session_t *session, const switch_codec_implementation_t *impp)
switch_time_t active_stop
uint8_t switch_core_session_check_interface(switch_core_session_t *session, const switch_endpoint_interface_t *endpoint_interface)
Checks if a session is using a specific endpoint.
switch_status_t switch_cache_db_execute_sql(switch_cache_db_handle_t *dbh, char *sql, char **err)
Executes the sql.
switch_status_t switch_core_session_set_video_write_codec(_In_ switch_core_session_t *session, switch_codec_t *codec)
Assign the video_write codec to a given session.
void * switch_core_session_get_stream(_In_ switch_core_session_t *session, _In_ int index)
Retreive a logical stream from a session.
switch_status_t _switch_core_db_handle(switch_cache_db_handle_t **dbh, const char *file, const char *func, int line)
Open the default system database.
switch_status_t switch_sql_queue_manager_init_name(const char *name, switch_sql_queue_manager_t **qmp, uint32_t numq, const char *dsn, uint32_t max_trans, const char *pre_trans_execute, const char *post_trans_execute, const char *inner_pre_trans_execute, const char *inner_post_trans_execute)
int switch_core_session_sync_clock(void)
void switch_core_session_raw_read(switch_core_session_t *session)
switch_status_t switch_core_media_bug_flush_all(_In_ switch_core_session_t *session)
Flush the read/write buffers for all media bugs on the session.
void switch_core_autobind_cpu(void)
switch_status_t switch_core_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)
Feed DTMF to an asr handle.
void * switch_core_session_get_private_class(_In_ switch_core_session_t *session, _In_ switch_pvt_class_t index)
Retrieve private user data from a session.
switch_memory_pool_t * pool
void(* hashtable_destructor_t)(void *ptr)
void switch_ivr_dmachine_set_target(switch_ivr_dmachine_t *dmachine, switch_digit_action_target_t target)
void switch_core_media_bug_inuse(switch_media_bug_t *bug, switch_size_t *readp, switch_size_t *writep)
switch_status_t switch_core_session_read_video_frame(_In_ switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id)
Read a video frame from a session.
Representation of an event.
switch_core_session_t * switch_core_session_request_by_name(_In_z_ const char *endpoint_name, _In_ switch_call_direction_t direction, _Inout_ switch_memory_pool_t **pool)
Allocate and return a new session from the core based on a given endpoint module name.
switch_status_t switch_core_media_bug_set_pre_buffer_framecount(switch_media_bug_t *bug, uint32_t framecount)
int switch_core_session_get_stream_count(_In_ switch_core_session_t *session)
Determine the number of logical streams a session has.
switch_caller_profile_t * hup_profile
void switch_core_set_variable(_In_z_ const char *varname, _In_opt_z_ const char *value)
Add a global variable to the core.
void * switch_core_inthash_find(switch_inthash_t *hash, uint32_t key)
void * switch_core_memory_pool_get_data(switch_memory_pool_t *pool, const char *key)
void switch_core_set_globals(void)
Initiate Globals.
switch_core_session_t * switch_core_session_request_xml(switch_endpoint_interface_t *endpoint_interface, switch_memory_pool_t **pool, switch_xml_t xml)
void switch_media_bug_set_spy_fmt(switch_media_bug_t *bug, switch_vid_spy_fmt_t spy_fmt)
void switch_sql_queue_manager_pause(switch_sql_queue_manager_t *qm, switch_bool_t flush)
switch_status_t switch_say_file_handle_create(switch_say_file_handle_t **sh, const char *ext, switch_event_t **var_event)
uint16_t switch_core_get_rtp_port_range_start_port(void)
Get RTP port range start value.
void switch_core_speech_float_param_tts(switch_speech_handle_t *sh, char *param, double val)
Set a float parameter on a TTS handle.
const char *const const char *const const cJSON *const value
switch_status_t switch_core_session_read_lock(_In_ switch_core_session_t *session)
Acquire a read lock on the session.
void switch_core_session_free_message(switch_core_session_message_t **message)
void switch_cond_yield(switch_interval_time_t t)
switch_core_session_message_types_t
Possible types of messages for inter-session communication.
switch_digit_action_target_t
switch_core_db_t * switch_core_db_open_in_memory(const char *uri)
Open a core db (SQLite) in-memory.
uint32_t switch_core_media_bug_count(switch_core_session_t *orig_session, const char *function)
switch_status_t switch_core_media_bug_remove_all_function(_In_ switch_core_session_t *session, const char *function)
Remove all media bugs from the session.
static const char * switch_cache_db_type_name(switch_cache_db_handle_type_t type)
switch_status_t switch_core_destroy(void)
Destroy the core.
static void * switch_must_malloc(size_t _b)
switch_core_session_t * switch_core_media_bug_get_session(_In_ switch_media_bug_t *bug)
Obtain the session from a media bug.
struct switch_hold_record_s switch_hold_record_t
switch_status_t switch_core_session_video_read_callback(switch_core_session_t *session, switch_frame_t *frame)
switch_status_t switch_core_session_exec(_In_ switch_core_session_t *session, _In_ const switch_application_interface_t *application_interface, _In_opt_z_ const char *arg)
Execute an application on a session.
switch_status_t switch_thread_pool_wait(switch_thread_data_t *td, int ms)
switch_status_t switch_core_session_get_real_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
switch_status_t switch_core_timer_step(switch_timer_t *timer)
Step the timer one step.
switch_status_t switch_core_hash_insert_auto_free(switch_hash_t *hash, const char *key, const void *data)
Insert data into a hash and set flags so the value is automatically freed on delete.
switch_status_t switch_core_codec_decode(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)
Decode data using a codec handle.
void switch_core_session_lock_codec_read(_In_ switch_core_session_t *session)
switch_status_t switch_core_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags)
Feed audio data to an asr handle.
void switch_core_media_bug_pause(switch_core_session_t *session)
Pause a media bug on the session.
const char * switch_core_session_get_external_id(_In_ switch_core_session_t *session)
Retrieve the unique external identifier from a session.
switch_status_t switch_core_hash_delete_multi(_In_ switch_hash_t *hash, _In_ switch_hash_delete_callback_t callback, _In_opt_ void *pData)
Delete data from a hash based on callback function.
uint32_t switch_core_media_bug_set_flag(_In_ switch_media_bug_t *bug, _In_ uint32_t flag)
A representation of an XML tree.
switch_time_t active_start
switch_call_cause_t switch_core_session_outgoing_channel(_In_opt_ switch_core_session_t *session, _In_opt_ switch_event_t *var_event, _In_z_ const char *endpoint_name, _In_ switch_caller_profile_t *caller_profile, _Inout_ switch_core_session_t **new_session, _Inout_ switch_memory_pool_t **pool, _In_ switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
Request an outgoing session spawned from an existing session using a desired endpoing module...
switch_status_t switch_core_codec_destroy(switch_codec_t *codec)
Destroy an initalized codec handle.
switch_memory_pool_t * pool
void switch_core_speech_numeric_param_tts(switch_speech_handle_t *sh, char *param, int val)
Set a numeric parameter on a TTS handle.
uint32_t switch_core_cpu_count(void)
switch_status_t switch_core_db_persistant_execute(switch_core_db_t *db, char *sql, uint32_t retries)
Execute a sql stmt until it is accepted.
const char * switch_core_mime_type2ext(const char *type)
void switch_core_media_bug_set_read_replace_frame(_In_ switch_media_bug_t *bug, _In_ switch_frame_t *frame)
Set a return replace frame.
switch_status_t switch_core_session_queue_message(_In_ switch_core_session_t *session, _In_ switch_core_session_message_t *message)
Queue a message on a session.
switch_status_t switch_core_timer_check(switch_timer_t *timer, switch_bool_t step)
Check if the current step has been exceeded.
uint32_t switch_originate_flag_t
char const int const cJSON_bool format
switch_status_t _switch_cache_db_get_db_handle(switch_cache_db_handle_t **dbh, switch_cache_db_handle_type_t type, switch_cache_db_connection_options_t *connection_options, const char *file, const char *func, int line)
Gets a new cached handle from the pool, potentially creating a new connection. The connection is boun...
switch_status_t switch_core_media_bug_patch_spy_frame(switch_media_bug_t *bug, switch_image_t *img, switch_rw_t rw)
void switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val)
Set a text parameter on a TTS handle.
void switch_time_set_timerfd(int enable)
A table of i/o routines that an endpoint interface can implement.
Abstract handler to a timer module.
switch_status_t switch_core_session_execute_application_async(switch_core_session_t *session, const char *app, const char *arg)
switch_status_t switch_core_media_bug_enumerate(switch_core_session_t *session, switch_stream_handle_t *stream)
switch_status_t switch_core_media_bug_add(_In_ switch_core_session_t *session, _In_ const char *function, _In_ const char *target, _In_ switch_media_bug_callback_t callback, _In_opt_ void *user_data, _In_ time_t stop_time, _In_ switch_media_bug_flag_t flags, _Out_ switch_media_bug_t **new_bug)
Add a media bug to the session.
int switch_core_cert_verify(dtls_fingerprint_t *fp)
switch_status_t switch_sql_queue_manager_push_confirm(switch_sql_queue_manager_t *qm, const char *sql, uint32_t pos, switch_bool_t dup)
switch_status_t switch_core_perform_destroy_memory_pool(_Inout_ switch_memory_pool_t **pool, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
uint32_t switch_core_flag_t
switch_sql_queue_manager_t * qm
switch_status_t switch_core_session_override_io_routines(switch_core_session_t *session, switch_io_routines_t *ior)
switch_input_callback_function_t input_callback
void switch_core_pool_stats(switch_stream_handle_t *stream)
void switch_core_session_soft_lock(switch_core_session_t *session, uint32_t sec)
switch_status_t switch_core_session_read_frame(_In_ switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id)
Read a frame from a session.
int switch_stream_system(const char *cmd, switch_stream_handle_t *stream)
struct switch_device_stats_s switch_device_stats_t
switch_status_t switch_core_asr_load_grammar(switch_asr_handle_t *ah, const char *grammar, const char *name)
Load a grammar to an asr handle.
switch_coredb_handle_t * core_db_dbh
switch_codec_t * switch_core_session_get_write_codec(_In_ switch_core_session_t *session)
Retrieve the write codec from a given session.
A message object designed to allow unlike technologies to exchange data.
uint32_t switch_core_session_message_flag_t
switch_console_callback_match_t * switch_core_session_findall_matching_var(const char *var_name, const char *var_val)
switch_status_t switch_core_asr_pause(switch_asr_handle_t *ah)
Pause detection on an asr handle.
switch_hash_index_t * switch_core_mime_index(void)
switch_memory_pool_t * pool
switch_status_t switch_core_session_get_video_write_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
switch_status_t switch_cache_db_execute_sql_callback(switch_cache_db_handle_t *dbh, const char *sql, switch_core_db_callback_func_t callback, void *pdata, char **err)
Executes the sql and uses callback for row-by-row processing.
switch_status_t switch_core_session_set_uuid(_In_ switch_core_session_t *session, _In_z_ const char *use_uuid)
struct device_uuid_node_s * uuid_tail
switch_status_t switch_core_thread_set_cpu_affinity(int cpu)
switch_status_t switch_core_expire_registration(int force)
Expire user registrations.
switch_core_session_message_flag_t flags
const char * original_dsn
void switch_core_session_unset_write_codec(_In_ switch_core_session_t *session)
switch_codec_t * switch_core_session_get_read_codec(_In_ switch_core_session_t *session)
Retrieve the read codec from a given session.
switch_bool_t switch_check_network_list_ip_port_token(const char *ip_str, int port, const char *list_name, const char **token)
switch_status_t switch_core_session_queue_indication(_In_ switch_core_session_t *session, _In_ switch_core_session_message_types_t indication)
Queue an indication message on a session.
switch_size_t switch_core_session_id(void)
Provide the current session_id.
uint32_t switch_core_max_dtmf_duration(uint32_t duration)
switch_status_t switch_core_session_perform_get_partner(switch_core_session_t *session, switch_core_session_t **partner, const char *file, const char *func, int line)
Get the session's partner (the session its bridged to)
char * switch_core_get_domain(switch_bool_t dup)
const char * switch_core_media_bug_get_text(switch_media_bug_t *bug)
switch_status_t switch_core_session_io_read_lock(switch_core_session_t *session)
switch_status_t switch_core_codec_reset(switch_codec_t *codec)
switch_status_t switch_core_session_write_frame(_In_ switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id)
Write a frame to a session.
void * switch_core_hash_insert_alloc_destructor(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ size_t size, hashtable_destructor_t destructor)
Allocate memory and insert into a hash.
int switch_system(const char *cmd, switch_bool_t wait)
void switch_core_dump_variables(_In_ switch_stream_handle_t *stream)
void switch_say_file_handle_destroy(switch_say_file_handle_t **sh)
switch_status_t switch_core_session_get_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
void switch_cache_db_release_db_handle(switch_cache_db_handle_t **dbh)
Returns the handle to the pool, handle is NOT available to other threads until the allocating thread ...
_Ret_ switch_channel_t * switch_core_session_get_channel(_In_ switch_core_session_t *session)
Retrieve a pointer to the channel object associated with a given session.
switch_codec_control_command_t
switch_status_t switch_core_inthash_destroy(switch_inthash_t **hash)
void switch_core_recovery_track(switch_core_session_t *session)
uint8_t switch_core_session_compare(switch_core_session_t *a, switch_core_session_t *b)
Checks if 2 sessions are using the same endpoint module.
switch_status_t switch_core_session_io_rwunlock(switch_core_session_t *session)
switch_size_t switch_core_session_get_id(_In_ switch_core_session_t *session)
switch_status_t switch_core_chat_send(const char *dest_proto, switch_event_t *message_event)
int switch_core_cert_gen_fingerprint(const char *prefix, dtls_fingerprint_t *fp)
switch_status_t switch_core_hash_insert_dup_auto_free(switch_hash_t *hash, const char *key, const char *str)
Insert strdup(str) into a hash and set flags so the value is automatically freed on delete...
uint32_t switch_core_min_dtmf_duration(uint32_t duration)
int32_t set_auto_priority(void)
switch_frame_t * switch_core_media_bug_get_read_replace_frame(_In_ switch_media_bug_t *bug)
Obtain a replace frame from a media bug.
switch_status_t switch_core_media_bug_pop(switch_core_session_t *orig_session, const char *function, switch_media_bug_t **pop)
void switch_core_session_enable_heartbeat(switch_core_session_t *session, uint32_t seconds)
switch_status_t switch_core_session_get_app_flags(const char *app, int32_t *flags)
switch_status_t switch_core_speech_close(switch_speech_handle_t *sh, switch_speech_flag_t *flags)
Close an open speech handle.
switch_codec_control_type_t
double switch_core_idle_cpu(void)
switch_status_t switch_core_directory_next(switch_directory_handle_t *dh)
Obtain the next record in a lookup.
switch_status_t switch_core_media_bug_transfer_callback(switch_core_session_t *orig_session, switch_core_session_t *new_session, switch_media_bug_callback_t callback, void *(*user_data_dup_func)(switch_core_session_t *, void *))
void switch_os_yield(void)
switch_status_t switch_core_session_execute_application_get_flags(_In_ switch_core_session_t *session, _In_ const char *app, _In_opt_z_ const char *arg, _Out_opt_ int32_t *flags)
Execute an application on a session.
switch_status_t switch_console_set_alias(const char *string)
switch_core_session_t * switch_core_session_request_uuid(_In_ switch_endpoint_interface_t *endpoint_interface, _In_ switch_call_direction_t direction, switch_originate_flag_t originate_flags, _Inout_opt_ switch_memory_pool_t **pool, _In_opt_z_ const char *use_uuid)
Allocate and return a new session from the core.
struct switch_thread_data_s switch_thread_data_t
switch_status_t switch_core_get_variables(switch_event_t **event)
uint32_t switch_core_media_bug_prune(switch_core_session_t *session)
int32_t switch_core_sps_last(void)
switch_status_t _switch_cache_db_get_db_handle_dsn(switch_cache_db_handle_t **dbh, const char *dsn, const char *file, const char *func, int line)
switch_status_t switch_core_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
Close an asr handle.
switch_status_t switch_core_init_and_modload(_In_ switch_core_flag_t flags, _In_ switch_bool_t console, _Out_ const char **err)
Initilize the core and load modules.
switch_status_t switch_core_session_thread_pool_launch(switch_core_session_t *session)
switch_status_t switch_core_session_execute_exten(_In_ switch_core_session_t *session, _In_z_ const char *exten, _In_opt_z_ const char *dialplan, _In_opt_z_ const char *context)
Run a dialplan and execute an extension.
uint32_t switch_core_session_hupall_matching_vars_ans(_In_ switch_event_t *vars, _In_ switch_call_cause_t cause, switch_hup_type_t type)
Hangup all sessions which match specific channel variable(s)
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.
char * switch_core_get_uuid(void)
Retrieve the unique identifier from the core.
switch_core_session_t * switch_core_session_perform_force_locate(const char *uuid_str, const char *file, const char *func, int line)
switch_status_t switch_core_port_allocator_request_port(_In_ switch_core_port_allocator_t *alloc, _Out_ switch_port_t *port_ptr)
Get a port from the port allocator.
void switch_core_recovery_untrack(switch_core_session_t *session, switch_bool_t force)
void * switch_core_inthash_delete(switch_inthash_t *hash, uint32_t key)
void switch_core_session_disable_heartbeat(switch_core_session_t *session)
void switch_time_set_matrix(switch_bool_t enable)
void switch_core_asr_numeric_param(switch_asr_handle_t *ah, char *param, int val)
Set a numeric parameter on an asr handle.
switch_core_session_t * switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line)
switch_core_flag_t switch_core_flags(void)
return core flags
void switch_core_hash_this_val(switch_hash_index_t *hi, void *val)
char * switch_core_perform_permanent_strdup(_In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
switch_status_t switch_core_session_set_video_read_impl(switch_core_session_t *session, const switch_codec_implementation_t *impp)
switch_status_t switch_core_session_dequeue_signal_data(switch_core_session_t *session, void **signal_data)
void switch_core_setrlimits(void)
switch_size_t string_reply_size
int switch_max_file_desc(void)
void switch_core_session_hupall(_In_ switch_call_cause_t cause)
Hangup all sessions.
switch_cache_db_handle_type_t
switch_frame_t * switch_core_media_bug_get_write_replace_frame(_In_ switch_media_bug_t *bug)
Obtain a replace frame from a media bug.
switch_status_t switch_core_session_send_dtmf(_In_ switch_core_session_t *session, const switch_dtmf_t *dtmf)
Send DTMF to a session.
switch_status_t switch_core_media_bug_push_spy_frame(switch_media_bug_t *bug, switch_frame_t *frame, switch_rw_t rw)
switch_status_t switch_core_session_set_video_write_impl(switch_core_session_t *session, const switch_codec_implementation_t *impp)
int switch_stream_spawn(const char *cmd, switch_bool_t shell, switch_bool_t wait, switch_stream_handle_t *stream)
switch_call_direction_t direction
switch_codec_t * switch_core_session_get_effective_read_codec(_In_ switch_core_session_t *session)
Retrieve the effevtive read codec from a given session.
switch_status_t switch_core_media_bug_remove_callback(switch_core_session_t *session, switch_media_bug_callback_t callback)
Remove media bug callback.
int switch_spawn(const char *cmd, switch_bool_t wait)
switch_status_t switch_core_directory_close(switch_directory_handle_t *dh)
Close an open directory handle.
uint32_t switch_core_session_messages_waiting(switch_core_session_t *session)
void switch_core_memory_reclaim_all(void)
void switch_core_port_allocator_destroy(_Inout_ switch_core_port_allocator_t **alloc)
destroythe port allocator
switch_status_t switch_core_hash_insert_destructor(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ const void *data, hashtable_destructor_t destructor)
Insert data into a hash.
void switch_core_session_sched_heartbeat(switch_core_session_t *session, uint32_t seconds)
switch_status_t switch_core_inthash_insert(switch_inthash_t *hash, uint32_t key, const void *data)
switch_thread_start_t func
int32_t set_normal_priority(void)
Set the maximum priority the process can obtain.
switch_status_t switch_core_add_registration(const char *user, const char *realm, const char *token, const char *url, uint32_t expires, const char *network_ip, const char *network_port, const char *network_proto, const char *metadata)
Add user registration.
switch_status_t switch_ivr_preprocess_session(switch_core_session_t *session, const char *cmds)
switch_status_t _switch_cache_db_get_db_handle_dsn_ex(switch_cache_db_handle_t **dbh, const char *dsn, switch_bool_t make_module_no_unloadable, const char *file, const char *func, int line)
uint32_t switch_core_session_flush_private_events(switch_core_session_t *session)
Flush the private event queue of a session.
switch_status_t(* switch_input_callback_function_t)(switch_core_session_t *session, void *input, switch_input_type_t input_type, void *buf, unsigned int buflen)
switch_status_t switch_core_codec_copy(switch_codec_t *codec, switch_codec_t *new_codec, const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool)
void switch_core_session_debug_pool(switch_stream_handle_t *stream)
void switch_core_service_session_av(_In_ switch_core_session_t *session, switch_bool_t audio, switch_bool_t video)
Launch a service thread on a session to drop inbound data.
void switch_sql_queue_manager_execute_sql_event_callback(switch_sql_queue_manager_t *qm, const char *sql, switch_core_db_event_callback_func_t callback, void *pdata)
switch_status_t switch_core_session_dequeue_private_event(_In_ switch_core_session_t *session, _Out_ switch_event_t **event)
DE-Queue a private event on a given session.
switch_status_t switch_core_hash_insert_wrlock(switch_hash_t *hash, const char *key, const void *data, switch_thread_rwlock_t *rwlock)
Retrieve data from a given hash.
void switch_core_sqldb_resume(void)
int32_t switch_core_sps(void)
static void * switch_must_realloc(void *_b, size_t _z)
void switch_core_db_test_reactive(switch_core_db_t *db, char *test_sql, char *drop_sql, char *reactive_sql)
perform a test query then perform a reactive query if the first one fails
uint32_t switch_core_media_bug_clear_flag(_In_ switch_media_bug_t *bug, _In_ uint32_t flag)
switch_status_t switch_strftime_tz(const char *tz, const char *format, char *date, size_t len, switch_time_t thetime)
switch_status_t switch_core_directory_open(switch_directory_handle_t *dh, char *module_name, char *source, char *dsn, char *passwd, switch_memory_pool_t *pool)
Open a directory handle.
const cJSON *const const cJSON_bool case_sensitive
int switch_cache_db_load_extension(switch_cache_db_handle_t *dbh, const char *extension)
load an external extension to db
switch_status_t switch_core_session_recv_dtmf(_In_ switch_core_session_t *session, const switch_dtmf_t *dtmf)
RECV DTMF on a session.
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
uint32_t switch_core_max_audio_channels(uint32_t limit)
An abstraction of a data frame.
switch_status_t switch_core_asr_disable_grammar(switch_asr_handle_t *ah, const char *name)
Disable a grammar from an asr handle.
switch_status_t switch_core_session_message_send(_In_z_ const char *uuid_str, _In_ switch_core_session_message_t *message)
Send a message to another session using it's uuid.
char * switch_cache_db_execute_sql2str(switch_cache_db_handle_t *dbh, char *sql, char *str, size_t len, char **err)
Executes the sql and returns the result as a string.
switch_status_t switch_cache_db_persistant_execute_trans_full(switch_cache_db_handle_t *dbh, char *sql, uint32_t retries, const char *pre_trans_execute, const char *post_trans_execute, const char *inner_pre_trans_execute, const char *inner_post_trans_execute)
switch_hash_index_t * switch_core_hash_next(_In_ switch_hash_index_t **hi)
Gets the next element of a hashtable.
FILE * switch_core_data_channel(switch_text_channel_t channel)
Retrieve a FILE stream of a given text channel name.
switch_status_t switch_core_media_bug_read(_In_ switch_media_bug_t *bug, _In_ switch_frame_t *frame, switch_bool_t fill)
Read a frame from the bug.
uint32_t switch_default_ptime(const char *name, uint32_t number)
uint32_t switch_asr_flag_t
switch_status_t switch_core_media_bug_remove(_In_ switch_core_session_t *session, _Inout_ switch_media_bug_t **bug)
Remove a media bug from the session.
int switch_core_cert_expand_fingerprint(dtls_fingerprint_t *fp, const char *str)
switch_codec_t * switch_core_session_get_video_write_codec(_In_ switch_core_session_t *session)
Retrieve the video_write codec from a given session.
struct device_uuid_node_s * next
switch_vid_spy_fmt_t switch_media_bug_parse_spy_fmt(const char *name)
char * switch_core_session_vsprintf(switch_core_session_t *session, const char *fmt, va_list ap)
printf-style style printing routine. The data is output to a string allocated from the session ...
int(* switch_core_db_callback_func_t)(void *pArg, int argc, char **argv, char **columnNames)
switch_size_t pointer_arg_size
void switch_core_runtime_loop(int bg)
Run endlessly until the system is shutdown.
int switch_core_session_add_stream(_In_ switch_core_session_t *session, _In_opt_ void *private_info)
Add a logical stream to a session.
switch_status_t switch_core_session_send_and_request_video_refresh(switch_core_session_t *session)
void switch_cond_next(void)
int64_t switch_interval_time_t
switch_size_t switch_core_session_id_dec(void)
switch_status_t switch_core_session_get_write_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
switch_odbc_handle_t * odbc_dbh
char * switch_core_get_variable(_In_z_ const char *varname)
Retrieve a global variable from the core.
switch_channel_callstate_t
uint32_t switch_core_session_count(void)
Provide the total number of sessions.
double switch_core_min_idle_cpu(double new_limit)
switch_status_t switch_core_session_queue_event(_In_ switch_core_session_t *session, _Inout_ switch_event_t **event)
Queue an event on a given session.
int32_t switch_core_sps_peak(void)
switch_status_t switch_core_timer_destroy(switch_timer_t *timer)
Destroy an allocated timer.
switch_status_t switch_core_db_persistant_execute_trans(switch_core_db_t *db, char *sql, uint32_t retries)
switch_cache_db_odbc_options_t odbc_options
switch_database_interface_handle_t * database_interface_dbh
void switch_sql_queue_manager_execute_sql_callback(switch_sql_queue_manager_t *qm, const char *sql, switch_core_db_callback_func_t callback, void *pdata)
void * switch_core_hash_delete(_In_ switch_hash_t *hash, _In_z_ const char *key)
Delete data from a hash based on desired key.
void switch_core_memory_reclaim_events(void)
switch_status_t switch_cache_db_persistant_execute(switch_cache_db_handle_t *dbh, const char *sql, uint32_t retries)
void switch_core_media_bug_get_media_params(switch_media_bug_t *bug, switch_mm_t *mm)
void switch_core_session_rwunlock(_In_ switch_core_session_t *session)
Unlock a read or write lock on as given session.
int32_t set_realtime_priority(void)
void switch_core_session_video_reset(switch_core_session_t *session)
char * switch_core_session_get_uuid(_In_ switch_core_session_t *session)
Retrieve the unique identifier from a session.
int32_t switch_core_sessions_peak_fivemin(void)
switch_channel_callstate_t callstate
switch_cache_db_handle_t * dbh
switch_status_t switch_core_codec_encode_video(switch_codec_t *codec, switch_frame_t *frame)
Encode video data using a codec handle.
const char * switch_version_full_human(void)
void switch_core_speech_flush_tts(switch_speech_handle_t *sh)
Flush TTS audio on a given handle.
switch_status_t switch_core_hash_insert_pointer(switch_hash_t *hash, const void *data)
Insert data into a hash with an auto-generated key based on the data pointer.
void * switch_core_perform_alloc(_In_ switch_memory_pool_t *pool, _In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
struct fspr_thread_mutex_t switch_mutex_t
switch_status_t switch_core_session_flush_message(_In_ switch_core_session_t *session)
Flush a message queue on a given session.
void switch_core_sqldb_pause(void)
switch_status_t switch_core_timer_next(switch_timer_t *timer)
Wait for one cycle on an existing timer.
switch_bool_t switch_core_session_transcoding(switch_core_session_t *session_a, switch_core_session_t *session_b, switch_media_type_t type)
void switch_cache_db_flush_handles(void)
void switch_core_sql_exec(const char *sql)
const char * switch_lookup_timezone(const char *tz_name)
switch_status_t switch_core_codec_init_with_bitrate(switch_codec_t *codec, const char *codec_name, const char *fmtp, const char *modname, uint32_t rate, int ms, int channels, uint32_t bitrate, uint32_t flags, const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool)
uint32_t switch_core_session_hupall_matching_var_ans(_In_ const char *var_name, _In_ const char *var_val, _In_ switch_call_cause_t cause, switch_hup_type_t type)
Hangup all sessions which match a specific channel variable.
int switch_core_add_state_handler(_In_ const switch_state_handler_table_t *state_handler)
Add a global state handler.
void *(SWITCH_THREAD_FUNC * switch_thread_start_t)(switch_thread_t *, void *)
unsigned int switch_core_session_running(_In_ switch_core_session_t *session)
determine if the session's state machine is running
switch_status_t switch_core_session_write_video_frame(_In_ switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id)
Write a video frame to a session.
void switch_core_session_run(_In_ switch_core_session_t *session)
Start the session's state machine.
uint32_t switch_core_default_dtmf_duration(uint32_t duration)
switch_digit_action_target_t switch_ivr_dmachine_get_target(switch_ivr_dmachine_t *dmachine)
uint32_t switch_core_session_limit(_In_ uint32_t new_limit)
Set/Get Session Limit.
switch_status_t switch_core_session_event_send(_In_z_ const char *uuid_str, _Inout_ switch_event_t **event)
Queue an event on another session using its uuid.
switch_status_t switch_core_asr_check_results(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
Check an asr handle for results.
switch_status_t switch_core_session_pass_indication(_In_ switch_core_session_t *session, _In_ switch_core_session_message_types_t indication)
pass an indication message on a session
void switch_time_set_monotonic(switch_bool_t enable)
const char * switch_core_get_event_channel_key_separator(void)
switch_thread_rwlock_t * rwlock
switch_size_t pointer_reply_size
switch_status_t
Common return values.
switch_memory_pool_t * pool
switch_codec_t * switch_core_session_get_effective_write_codec(_In_ switch_core_session_t *session)
Retrieve the effevtive write codec from a given session.
switch_status_t switch_core_session_queue_private_event(_In_ switch_core_session_t *session, _Inout_ switch_event_t **event, switch_bool_t priority)
Queue a private event on a given session.
switch_status_t switch_core_session_read_lock_hangup(_In_ switch_core_session_t *session)
Acquire a read lock on the session.
const cJSON *const target
uint32_t switch_core_media_bug_patch_video(switch_core_session_t *orig_session, switch_frame_t *frame)
const switch_state_handler_table_t * switch_core_get_state_handler(_In_ int index)
Access a state handler.
switch_status_t switch_core_session_dequeue_event(_In_ switch_core_session_t *session, _Out_ switch_event_t **event, switch_bool_t force)
DE-Queue an event on a given session.
switch_status_t switch_core_session_set_private_class(_In_ switch_core_session_t *session, _In_ void *private_info, _In_ switch_pvt_class_t index)
Add private user data to a session.
void switch_core_session_write_lock(_In_ switch_core_session_t *session)
Acquire a write lock on the session.
switch_status_t switch_core_session_write_encoded_video_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id)
switch_cache_db_handle_type_t switch_cache_db_get_type(switch_cache_db_handle_t *dbh)
void switch_core_session_lock_codec_write(_In_ switch_core_session_t *session)
const char * switch_core_get_hostname(void)
struct switch_device_record_s * parent
switch_status_t switch_core_directory_next_pair(switch_directory_handle_t *dh, char **var, char **val)
Obtain the next name/value pair in the current record.
void switch_cache_db_dismiss_db_handle(switch_cache_db_handle_t **dbh)
Returns the handle to the pool, immediately available for other threads to use.
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_session_receive_event(_In_ switch_core_session_t *session, _Inout_ switch_event_t **event)
Send an event to a session translating it to it's native message format.
int switch_cache_db_affected_rows(switch_cache_db_handle_t *dbh)
Get the affected rows of the last performed query.
struct sqlite3 switch_core_db_t
switch_bool_t switch_cache_db_test_reactive_ex(switch_cache_db_handle_t *db, const char *test_sql, const char *drop_sql, const char *reactive_sql, const char *row_size_limited_reactive_sql)
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)
void switch_core_memory_pool_set_data(switch_memory_pool_t *pool, const char *key, void *data)
switch_loadable_module_interface_t * switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name)
_Ret_ void * switch_core_perform_session_alloc(_In_ switch_core_session_t *session, _In_ switch_size_t memory, const char *file, const char *func, int line)
switch_status_t switch_core_hash_init_case(_Out_ switch_hash_t **hash, switch_bool_t case_sensitive)
Initialize a hash table.
void switch_time_calibrate_clock(void)
switch_ivr_dmachine_t * switch_core_session_get_dmachine(switch_core_session_t *session, switch_digit_action_target_t target)
struct dtls_fp_s dtls_fingerprint_t
uint32_t switch_core_session_event_count(_In_ switch_core_session_t *session)
Indicate the number of waiting events on a session.
int(* switch_core_db_event_callback_func_t)(void *pArg, switch_event_t *event)
void * switch_core_hash_delete_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ switch_mutex_t *mutex)
Delete data from a hash based on desired key.
int(* switch_core_db_err_callback_func_t)(void *pArg, const char *errmsg)
switch_status_t switch_core_speech_open(_In_ switch_speech_handle_t *sh, const char *module_name, const char *voice_name, _In_ unsigned int rate, _In_ unsigned int interval, _In_ unsigned int channels, switch_speech_flag_t *flags, _In_opt_ switch_memory_pool_t *pool)
Open a speech handle.
switch_cache_db_database_interface_options_t database_interface_options
switch_bool_t switch_core_ready_outbound(void)
Determines if the core is ready to place outbound calls.
void switch_core_recovery_flush(const char *technology, const char *profile_name)
switch_status_t switch_core_asr_resume(switch_asr_handle_t *ah)
Resume detection on an asr handle.
uint32_t switch_core_session_private_event_count(_In_ switch_core_session_t *session)
Indicate the number of waiting private events on a session.
void switch_core_media_bug_resume(switch_core_session_t *session)
Resume a media bug on the session.
switch_status_t switch_core_session_dequeue_message(_In_ switch_core_session_t *session, _Out_ switch_core_session_message_t **message)
DE-Queue an message on a given session.
switch_status_t _switch_core_session_request_video_refresh(switch_core_session_t *session, int force, const char *file, const char *func, int line)
switch_time_t switch_mono_micro_time_now(void)
void switch_cache_db_status(switch_stream_handle_t *stream)
Provides some feedback as to the status of the db connection pool.
switch_status_t switch_sql_queue_manager_push(switch_sql_queue_manager_t *qm, const char *sql, uint32_t pos, switch_bool_t dup)
switch_status_t switch_core_session_send_dtmf_string(switch_core_session_t *session, const char *dtmf_string)
Send DTMF to a session.
switch_status_t(* switch_core_video_thread_callback_func_t)(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
switch_status_t switch_core_session_wake_session_thread(_In_ switch_core_session_t *session)
switch_signal_t
Signals to send to channels.
struct device_uuid_node_s * uuid_list
switch_app_log_t * switch_core_session_get_app_log(_In_ switch_core_session_t *session)
void switch_time_set_use_system_time(switch_bool_t enable)
void switch_core_media_bug_set_read_demux_frame(_In_ switch_media_bug_t *bug, _In_ switch_frame_t *frame)
uint32_t switch_port_flag_t
char * switch_core_perform_session_strdup(_In_ switch_core_session_t *session, _In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
switch_status_t switch_sql_queue_manager_stop(switch_sql_queue_manager_t *qm)
switch_cache_db_handle_type_t switch_core_dbtype(void)
void switch_core_memory_pool_tag(switch_memory_pool_t *pool, const char *tag)
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.
switch_status_t switch_cache_db_create_schema(switch_cache_db_handle_t *dbh, char *sql, char **err)
Executes the create schema sql.
void switch_time_set_cond_yield(switch_bool_t enable)
char * switch_say_file_handle_get_path(switch_say_file_handle_t *sh)
const char * switch_core_mime_ext2type(const char *ext)
void switch_core_session_soft_unlock(switch_core_session_t *session)
time_t switch_epoch_time_now(time_t *t)
Get the current epoch time.
switch_status_t switch_core_session_set_write_codec(_In_ switch_core_session_t *session, switch_codec_t *codec)
Assign the write codec to a given session.
switch_bool_t switch_check_network_list_ip_token(const char *ip_str, const char *list_name, const char **token)
switch_status_t switch_sql_queue_manager_start(switch_sql_queue_manager_t *qm)
A generic object to pass as a thread's session object to allow mutiple arguements and a pool...
void * switch_core_perform_permanent_alloc(_In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
switch_status_t switch_core_chat_deliver(const char *dest_proto, switch_event_t **message_event)
void switch_cache_db_database_interface_flush_handles(switch_database_interface_t *database_interface)
switch_status_t switch_core_asr_enable_grammar(switch_asr_handle_t *ah, const char *name)
Enable a grammar from an asr handle.
switch_status_t switch_core_perform_new_memory_pool(_Out_ switch_memory_pool_t **pool, _In_z_ const char *file, _In_z_ const char *func, _In_ int line)
void(* switch_media_bug_exec_cb_t)(switch_media_bug_t *bug, void *user_data)
const char * switch_core_session_get_text_buffer(switch_core_session_t *session)
switch_status_t switch_core_session_try_reset(switch_core_session_t *session, switch_bool_t flush_dtmf, switch_bool_t reset_read_codec)
Reset the buffers and resampler on a session, fail if can not lock codec mutexes. ...
switch_bool_t switch_cache_db_test_reactive(switch_cache_db_handle_t *db, const char *test_sql, const char *drop_sql, const char *reactive_sql)
Performs test_sql and if it fails performs drop_sql and reactive_sql.
void switch_core_gen_encoded_silence(unsigned char *data, const switch_codec_implementation_t *read_impl, switch_size_t len)
char * switch_say_file_handle_get_variable(switch_say_file_handle_t *sh, const char *var)
switch_status_t switch_core_management_exec(char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen)
Execute a management operation.
void switch_core_session_unset_read_codec(_In_ switch_core_session_t *session)
void switch_sql_queue_manager_execute_sql_callback_err(switch_sql_queue_manager_t *qm, const char *sql, switch_core_db_callback_func_t callback, switch_core_db_err_callback_func_t err_callback, void *pdata)
A table of settings and callbacks that define a paticular implementation of a codec.
void(* switch_device_state_function_t)(switch_core_session_t *session, switch_channel_callstate_t callstate, switch_device_record_t *drec)
unsigned int switch_core_session_started(_In_ switch_core_session_t *session)
void switch_core_session_unlock_codec_write(_In_ switch_core_session_t *session)
switch_hold_record_t * hold_record
uint32_t switch_media_bug_flag_t
switch_frame_t * switch_core_media_bug_get_native_write_frame(switch_media_bug_t *bug)
switch_device_stats_t last_stats
FILE * switch_core_get_console(void)
Get the output console.
struct fspr_pool_t switch_memory_pool_t
uint32_t switch_core_media_bug_test_flag(_In_ switch_media_bug_t *bug, _In_ uint32_t flag)
Test for the existance of a flag on an media bug.
void switch_load_network_lists(switch_bool_t reload)
switch_status_t switch_core_session_queue_signal_data(switch_core_session_t *session, void *signal_data)
void switch_core_set_signal_handlers(void)
void switch_sql_queue_manager_resume(switch_sql_queue_manager_t *qm)
int32_t switch_core_set_process_privileges(void)
Switch on the privilege awareness for the process and request required privileges.
switch_time_t last_call_time
switch_bool_t switch_core_check_dtls_pem(const char *file)
switch_bool_t switch_core_hash_empty(switch_hash_t *hash)
tells if a hash is empty
const char * switch_core_banner(void)
switch_status_t switch_core_session_get_video_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
void switch_core_memory_reclaim(void)
switch_status_t switch_time_exp_tz_name(const char *tz, switch_time_exp_t *tm, switch_time_t thetime)
int switch_core_gen_certs(const char *prefix)
switch_status_t switch_core_media_bug_exec_all(switch_core_session_t *orig_session, const char *function, switch_media_bug_exec_cb_t cb, void *user_data)
const char * switch_version_revision_human(void)
int32_t switch_core_session_ctl(switch_session_ctl_t cmd, void *val)
send a control message to the core
switch_log_level_t switch_core_session_get_loglevel(switch_core_session_t *session)
Get the log level for a session.
void * switch_core_hash_delete_wrlock(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ switch_thread_rwlock_t *rwlock)
Delete data from a hash based on desired key.
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 ...
struct fspr_thread_t switch_thread_t
int switch_core_recovery_recover(const char *technology, const char *profile_name)
switch_status_t switch_core_media_bug_close(_Inout_ switch_media_bug_t **bug, switch_bool_t destroy)
Close and destroy a media bug.
switch_status_t switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *name)
Unload a grammar from an asr handle.
const char * switch_version_micro(void)
switch_database_interface_t * database_interface
switch_status_t switch_core_session_set_loglevel(switch_core_session_t *session, switch_log_level_t loglevel)
Sets the log level for a session.
struct device_uuid_node_s switch_device_node_t
switch_core_db_t * switch_core_db_open_file(const char *filename)
Open a core db (SQLite) file.
struct switch_device_record_s switch_device_record_t
struct fspr_thread_rwlock_t switch_thread_rwlock_t
void switch_core_asr_text_param(switch_asr_handle_t *ah, char *param, const char *val)
Set a text parameter on an asr handle.
int32_t switch_core_sps_peak_fivemin(void)
switch_bool_t switch_core_ready_inbound(void)
Determines if the core is ready to take inbound calls.
char * switch_say_file_handle_detach_path(switch_say_file_handle_t *sh)
switch_status_t switch_cache_db_execute_sql_callback_err(switch_cache_db_handle_t *dbh, const char *sql, switch_core_db_callback_func_t callback, switch_core_db_err_callback_func_t err_callback, void *pdata, char **err)
Executes the sql and uses callback for row-by-row processing.
Abstract interface to a database module.
switch_bool_t switch_core_ready(void)
Determines if the core is ready to take calls.
uint32_t switch_default_rate(const char *name, uint32_t number)
void * switch_core_hash_find_rdlock(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_thread_rwlock_t *rwlock)
Retrieve data from a given hash.
switch_status_t switch_core_session_set_write_impl(switch_core_session_t *session, const switch_codec_implementation_t *impp)
int32_t switch_core_sessions_peak(void)
void switch_core_measure_time(switch_time_t total_ms, switch_core_time_duration_t *duration)
Breakdown a number of milliseconds into various time spec.
switch_bool_t switch_core_session_in_thread(switch_core_session_t *session)
switch_memory_pool_t * switch_core_session_get_pool(_In_ switch_core_session_t *session)
Retrieve the memory pool from a session.
switch_status_t switch_core_check_core_db_dsn(void)
Returns error if no suitable database interface found to serve core db dsn.
void switch_core_session_unlock_codec_read(_In_ switch_core_session_t *session)
switch_log_level_t
Log Level Enumeration.
void switch_core_session_destroy_state(switch_core_session_t *session)
void switch_core_screen_size(int *x, int *y)
switch_management_action_t
The abstraction of a loadable module.
const char * switch_version_revision(void)
char * switch_core_get_variable_dup(_In_z_ const char *varname)
struct switch_app_log * next
void * switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, switch_module_interface_name_t iname)
switch_status_t switch_core_codec_control(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)
send control data using a codec handle
switch_status_t switch_core_port_allocator_new(_In_ const char *ip, _In_ switch_port_t start, _In_ switch_port_t end, _In_ switch_port_flag_t flags, _Out_ switch_core_port_allocator_t **new_allocator)
Initilize the port allocator.
switch_status_t switch_core_session_set_real_read_codec(_In_ switch_core_session_t *session, switch_codec_t *codec)
Assign the original read codec to a given session. This is the read codec used by an endpoint...
switch_status_t switch_core_session_thread_launch(_In_ switch_core_session_t *session)
Launch the session thread (state machine) on a given session.
switch_status_t switch_core_timer_sync(switch_timer_t *timer)
switch_time_t switch_time_ref(void)
switch_status_t switch_thread_pool_launch_thread(switch_thread_data_t **tdp)
void switch_core_session_launch_thread(_In_ switch_core_session_t *session, _In_ void *(*func)(switch_thread_t *, void *), _In_opt_ void *obj)
Launch a thread designed to exist within the scope of a given session.
uint32_t switch_core_session_stack_count(switch_core_session_t *session, int x)
#define SWITCH_BEGIN_EXTERN_C
switch_status_t switch_core_set_console(const char *console)
Set the output console to the desired file.
void switch_say_file(switch_say_file_handle_t *sh, const char *fmt,...)
switch_jb_t * switch_core_session_get_jb(switch_core_session_t *session, switch_media_type_t type)
switch_hash_index_t * switch_core_hash_first_iter(_In_ switch_hash_t *hash, switch_hash_index_t *hi)
Gets the first element of a hashtable.