FreeSWITCH API Documentation
1.7.0
|
Go to the source code of this file.
Data Structures | |
struct | str_node |
struct | switch_thread_pool_node_s |
Macros | |
#define | DEBUG_THREAD_POOL |
#define | check_media(session) |
#define | SWITCH_PREFIX_DIR "." |
Typedefs | |
typedef struct switch_thread_pool_node_s | switch_thread_pool_node_t |
Variables | |
struct switch_session_manager | session_manager |
static const char * | message_names [] |
#define check_media | ( | session | ) |
Definition at line 1213 of file switch_core_session.c.
Referenced by switch_core_session_dequeue_private_event(), switch_core_session_flush_private_events(), and switch_core_session_private_event_count().
#define DEBUG_THREAD_POOL |
Definition at line 40 of file switch_core_session.c.
#define SWITCH_PREFIX_DIR "." |
Definition at line 2403 of file switch_core_session.c.
typedef struct switch_thread_pool_node_s switch_thread_pool_node_t |
|
static |
Definition at line 1749 of file switch_core_session.c.
References switch_session_manager::busy, switch_session_manager::cond, switch_session_manager::mutex, pool, switch_thread_pool_node_s::pool, switch_session_manager::running, session_manager, SWITCH_CHANNEL_LOG, switch_core_alloc, switch_core_destroy_memory_pool, switch_core_new_memory_pool, switch_core_session_thread_pool_worker(), SWITCH_LOG_CRIT, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_PRI_LOW, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_thread_cond_signal(), switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_detach_set(), switch_threadattr_priority_set(), switch_threadattr_stacksize_set(), thread, and thread_launch_failure().
Referenced by switch_core_session_thread_pool_launch(), and switch_thread_pool_launch_thread().
|
static |
Definition at line 1953 of file switch_core_session.c.
References zstr.
Referenced by switch_core_session_request_xml().
int switch_core_session_add_stream | ( | switch_core_session_t * | session, |
void * | private_info | ||
) |
Definition at line 477 of file switch_core_session.c.
void switch_core_session_debug_pool | ( | switch_stream_handle_t * | stream | ) |
Definition at line 2927 of file switch_core_session.c.
References switch_session_manager::busy, switch_session_manager::running, and session_manager.
switch_status_t switch_core_session_dequeue_event | ( | switch_core_session_t * | session, |
switch_event_t ** | event, | ||
switch_bool_t | force | ||
) |
Definition at line 1175 of file switch_core_session.c.
References CF_DIVERT_EVENTS, switch_assert, switch_channel_test_flag(), switch_queue_trypop(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_session_dequeue_message | ( | switch_core_session_t * | session, |
switch_core_session_message_t ** | message | ||
) |
Definition at line 1018 of file switch_core_session.c.
References switch_assert, switch_core_session_queue_message(), switch_epoch_time_now(), switch_queue_trypop(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_session_dequeue_private_event | ( | switch_core_session_t * | session, |
switch_event_t ** | event | ||
) |
Definition at line 1244 of file switch_core_session.c.
References CF_EVENT_LOCK, CF_EVENT_LOCK_PRI, check_media, switch_channel_test_flag(), switch_core_session_get_channel(), switch_queue_size(), switch_queue_trypop(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
uint32_t switch_core_session_event_count | ( | switch_core_session_t * | session | ) |
switch_status_t switch_core_session_event_send | ( | const char * | uuid_str, |
switch_event_t ** | event | ||
) |
Definition at line 433 of file switch_core_session.c.
References switch_core_session::channel, runtime, switch_runtime::session_hash_mutex, session_manager, switch_session_manager::session_table, switch_channel_up_nosig, switch_core_hash_find(), switch_core_session_queue_event(), switch_core_session_read_lock(), switch_core_session_rwunlock(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_session_exec | ( | switch_core_session_t * | session, |
const switch_application_interface_t * | application_interface, | ||
const char * | arg | ||
) |
Definition at line 2662 of file switch_core_session.c.
References switch_app_log::app, switch_app_log::arg, CF_BREAK, switch_core_session_message::from, switch_core_session_message::message_id, switch_app_log::next, SCF_DIALPLAN_TIMESTAMPS, switch_app_log::stamp, switch_core_session_message::string_array_arg, switch_assert, switch_channel_clear_flag(), switch_channel_event_set_data(), switch_channel_expand_variables, switch_channel_get_name(), switch_channel_get_variable, switch_channel_presence, SWITCH_CHANNEL_SESSION_LOG, SWITCH_CHANNEL_SESSION_LOG_CLEAN, switch_channel_set_scope_variables(), switch_channel_set_variable, switch_channel_set_variable_var_check(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_receive_message, switch_core_session_strdup, switch_core_test_flag(), SWITCH_CURRENT_APPLICATION_DATA_VARIABLE, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, SWITCH_CURRENT_APPLICATION_VARIABLE, SWITCH_DISABLE_APP_LOG_VARIABLE, switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_EXECUTE, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE, switch_event_create, switch_event_create_brackets(), switch_event_fire, SWITCH_FALSE, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC, SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE, switch_mprintf(), switch_safe_free, SWITCH_STACK_BOTTOM, SWITCH_STATUS_SUCCESS, switch_str_nil, switch_time_now(), SWITCH_TRUE, switch_true(), SWITCH_UUID_FORMATTED_LENGTH, switch_uuid_str(), and zstr.
Referenced by switch_core_session_execute_application_get_flags().
switch_status_t switch_core_session_execute_application_get_flags | ( | switch_core_session_t * | session, |
const char * | app, | ||
const char * | arg, | ||
int32_t * | flags | ||
) |
Definition at line 2561 of file switch_core_session.c.
References switch_application_interface::application_function, CF_PROXY_MODE, CF_VIDEO, switch_application_interface::flags, SAF_SUPPORT_NOMEDIA, SAF_ZOMBIE_EXEC, SMF_NONE, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, switch_channel_direction(), switch_channel_down_nosig, switch_channel_get_name(), switch_channel_hangup, switch_channel_media_ready, switch_channel_media_up, switch_channel_pre_answer, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_cond_next(), switch_core_media_gen_key_frame, switch_core_session_exec(), switch_core_session_execute_application_async(), switch_core_session_request_video_refresh(), switch_goto_status, switch_ivr_media(), switch_loadable_module_get_application_interface(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_STATUS_FALSE, SWITCH_STATUS_IGNORE, SWITCH_STATUS_SUCCESS, switch_str_nil, switch_test_flag, and UNPROTECT_INTERFACE.
switch_status_t switch_core_session_execute_exten | ( | switch_core_session_t * | session, |
const char * | exten, | ||
const char * | dialplan, | ||
const char * | context | ||
) |
Definition at line 2809 of file switch_core_session.c.
References switch_caller_application::application_data, switch_caller_application::application_name, switch_caller_profile::caller_extension, switch_caller_extension::children, switch_caller_profile::context, switch_caller_extension::current_application, switch_caller_profile::destination_number, switch_caller_profile::dialplan, switch_dialplan_interface::hunt_function, switch_caller_profile::next, switch_caller_application::next, switch_caller_profile::pool, switch_caller_profile_clone(), switch_channel_get_caller_profile(), switch_channel_get_name(), switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_hunt_caller_profile(), switch_core_session_alloc, switch_core_session_execute_application, switch_core_session_get_channel(), switch_core_session_strdup, switch_core_strdup, switch_loadable_module_get_dialplan_interface(), SWITCH_LOG_ERROR, SWITCH_LOG_NOTICE, switch_log_printf(), SWITCH_MAX_STACKS, switch_separate_string(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_str_nil, switch_caller_profile::times, UNPROTECT_INTERFACE, and zstr.
switch_status_t switch_core_session_flush_message | ( | switch_core_session_t * | session | ) |
Definition at line 1039 of file switch_core_session.c.
References switch_assert, switch_core_session_free_message(), switch_ivr_process_indications(), switch_queue_trypop(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_reset().
switch_app_log_t* switch_core_session_get_app_log | ( | switch_core_session_t * | session | ) |
Definition at line 2484 of file switch_core_session.c.
switch_channel_t* switch_core_session_get_channel | ( | switch_core_session_t * | session | ) |
Definition at line 1355 of file switch_core_session.c.
References switch_assert.
Referenced by switch_core_session_dequeue_private_event(), switch_core_session_exec(), switch_core_session_execute_exten(), switch_core_session_hupall_matching_var_ans(), switch_core_session_outgoing_channel(), switch_core_session_pass_indication(), switch_core_session_private_event_count(), switch_core_session_request_xml(), and switch_core_session_reset().
switch_size_t switch_core_session_get_id | ( | switch_core_session_t * | session | ) |
Definition at line 2365 of file switch_core_session.c.
void* switch_core_session_get_private_class | ( | switch_core_session_t * | session, |
switch_pvt_class_t | index | ||
) |
Definition at line 454 of file switch_core_session.c.
References switch_assert, and SWITCH_CORE_SESSION_MAX_PRIVATES.
void* switch_core_session_get_stream | ( | switch_core_session_t * | session, |
int | index | ||
) |
Definition at line 483 of file switch_core_session.c.
int switch_core_session_get_stream_count | ( | switch_core_session_t * | session | ) |
Definition at line 489 of file switch_core_session.c.
char* switch_core_session_get_uuid | ( | switch_core_session_t * | session | ) |
Definition at line 2422 of file switch_core_session.c.
Referenced by switch_core_session_outgoing_channel(), switch_core_session_perform_destroy(), switch_core_session_perform_force_locate(), switch_core_session_perform_receive_message(), and switch_core_session_sched_heartbeat().
void switch_core_session_hupall | ( | switch_call_cause_t | cause | ) |
Definition at line 351 of file switch_core_session.c.
References switch_core_session::channel, str_node::next, pool, runtime, switch_runtime::session_hash_mutex, session_manager, switch_session_manager::session_table, switch_channel_hangup, switch_core_alloc, switch_core_destroy_memory_pool, switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_core_new_memory_pool, switch_core_session_locate, switch_core_session_read_lock(), switch_core_session_rwunlock(), switch_core_strdup, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, and switch_core_session::uuid_str.
uint32_t switch_core_session_hupall_matching_var_ans | ( | const char * | var_name, |
const char * | var_val, | ||
switch_call_cause_t | cause, | ||
switch_hup_type_t | type | ||
) |
Definition at line 210 of file switch_core_session.c.
References CF_ANSWERED, switch_core_session::channel, str_node::next, pool, runtime, switch_runtime::session_hash_mutex, session_manager, switch_session_manager::session_table, SHT_ANSWERED, SHT_UNANSWERED, switch_channel_get_variable, switch_channel_hangup, switch_channel_test_flag(), switch_channel_up_nosig, switch_core_alloc, switch_core_destroy_memory_pool, switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_core_new_memory_pool, switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_read_lock(), switch_core_session_rwunlock(), switch_core_strdup, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, and switch_core_session::uuid_str.
switch_bool_t switch_core_session_in_thread | ( | switch_core_session_t * | session | ) |
Definition at line 1614 of file switch_core_session.c.
References SWITCH_FALSE, switch_thread_equal(), switch_thread_self(), and SWITCH_TRUE.
Referenced by switch_channel_perform_answer(), switch_channel_set_direction(), switch_channel_state_change_pending(), switch_ivr_3p_nomedia(), switch_ivr_nomedia(), and switch_ivr_parse_signal_data().
void switch_core_session_init | ( | switch_memory_pool_t * | pool | ) |
Definition at line 2462 of file switch_core_session.c.
References switch_session_manager::cond, switch_session_manager::memory_pool, memset(), switch_session_manager::mutex, pool, switch_session_manager::session_id, switch_session_manager::session_limit, session_manager, switch_session_manager::session_table, switch_core_hash_init, SWITCH_MUTEX_DEFAULT, switch_mutex_init(), switch_queue_create(), switch_thread_cond_create(), and switch_session_manager::thread_queue.
Referenced by switch_core_init().
void switch_core_session_launch_thread | ( | switch_core_session_t * | session, |
switch_thread_start_t | func, | ||
void * | obj | ||
) |
Definition at line 1882 of file switch_core_session.c.
References apr_threadattr_t::pool, SWITCH_CHANNEL_SESSION_LOG, SWITCH_LOG_CRIT, switch_log_printf(), SWITCH_STATUS_SUCCESS, switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_detach_set(), switch_threadattr_stacksize_set(), thread, and thread_launch_failure().
uint32_t switch_core_session_limit | ( | uint32_t | new_limit | ) |
Definition at line 2429 of file switch_core_session.c.
References switch_session_manager::session_limit, and session_manager.
Referenced by thread_launch_failure().
switch_status_t switch_core_session_message_send | ( | const char * | uuid_str, |
switch_core_session_message_t * | message | ||
) |
Definition at line 413 of file switch_core_session.c.
References switch_core_session::channel, runtime, switch_runtime::session_hash_mutex, session_manager, switch_session_manager::session_table, switch_channel_up_nosig, switch_core_hash_find(), switch_core_session_read_lock(), switch_core_session_receive_message, switch_core_session_rwunlock(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_call_cause_t switch_core_session_outgoing_channel | ( | switch_core_session_t * | session, |
switch_event_t * | var_event, | ||
const char * | endpoint_name, | ||
switch_caller_profile_t * | caller_profile, | ||
switch_core_session_t ** | new_session, | ||
switch_memory_pool_t ** | pool, | ||
switch_originate_flag_t | flags, | ||
switch_call_cause_t * | cancel_cause | ||
) |
Definition at line 494 of file switch_core_session.c.
References switch_caller_profile::ani, switch_caller_profile::aniii, switch_caller_profile::caller_id_name, switch_caller_profile::caller_id_number, CC_BYPASS_MEDIA, CC_PROXY_MEDIA, CF_PROXY_MEDIA, CF_PROXY_MODE, CF_VIDEO, CF_ZRTP_PASSTHRU_REQ, ep, switch_codec::implementation, switch_endpoint_interface::io_routines, switch_io_event_hook_outgoing_channel::next, switch_io_event_hook_outgoing_channel::outgoing_channel, switch_io_routines::outgoing_channel, SOF_NO_EFFECTIVE_ANI, SOF_NO_EFFECTIVE_ANIII, SOF_NO_EFFECTIVE_CID_NAME, SOF_NO_EFFECTIVE_CID_NUM, switch_assert, switch_caller_profile_clone(), SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL, SWITCH_CAUSE_SUCCESS, switch_channel_cause2str(), switch_channel_clear_flag(), switch_channel_event_set_data(), switch_channel_get_caller_profile(), switch_channel_get_name(), switch_channel_get_variable, switch_channel_pass_sdp(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_origination_caller_profile(), switch_channel_set_originator_caller_profile(), switch_channel_set_variable, switch_channel_test_cap(), switch_channel_test_flag(), switch_codec2str, switch_core_codec_ready(), switch_core_session_get_channel(), switch_core_session_get_read_codec(), switch_core_session_get_uuid(), switch_core_session_get_video_read_codec(), switch_core_session_set_uuid(), switch_core_session_sprintf(), switch_core_session_strdup, SWITCH_EVENT_CHANNEL_OUTGOING, switch_event_create, switch_event_del_header, switch_event_fire, switch_event_get_header, switch_loadable_module_get_endpoint_interface(), SWITCH_LOG_CRIT, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MAX_FORWARDS_VARIABLE, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE, SWITCH_ORIGINATOR_CODEC_VARIABLE, SWITCH_ORIGINATOR_VARIABLE, SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE, SWITCH_PROCESS_CDR_VARIABLE, SWITCH_R_SDP_VARIABLE, SWITCH_SIGNAL_BOND_VARIABLE, switch_snprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_true(), UNPROTECT_INTERFACE, and zstr.
switch_status_t switch_core_session_pass_indication | ( | switch_core_session_t * | session, |
switch_core_session_message_types_t | indication | ||
) |
Definition at line 940 of file switch_core_session.c.
References switch_core_session_message::from, switch_core_session_message::message_id, switch_channel_get_partner_uuid(), switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_receive_message, switch_core_session_rwunlock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
void switch_core_session_perform_destroy | ( | switch_core_session_t ** | session, |
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Definition at line 1452 of file switch_core_session.c.
References pool, runtime, SCF_SYNC_CLOCK_REQUESTED, switch_session_manager::session_count, switch_runtime::session_hash_mutex, session_manager, switch_session_manager::session_table, SSF_DESTROYABLE, switch_buffer_destroy(), switch_channel_event_set_data(), switch_channel_get_name(), switch_channel_get_state(), SWITCH_CHANNEL_ID_LOG, switch_channel_state_name(), switch_channel_uninit(), switch_clear_flag, switch_core_destroy_memory_pool, switch_core_hash_delete(), switch_core_media_bug_remove_all, switch_core_session_destroy_state(), switch_core_session_flush_private_events(), switch_core_session_get_uuid(), switch_core_session_reset(), switch_core_session_running(), SWITCH_EVENT_CHANNEL_DESTROY, switch_event_create, switch_event_fire, switch_ivr_clear_speech_cache(), switch_ivr_deactivate_unicast(), switch_ivr_dmachine_destroy(), SWITCH_LOG_ERROR, SWITCH_LOG_NOTICE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_scheduler_del_task_group(), SWITCH_STATUS_SUCCESS, switch_test_flag, switch_time_sync(), SWITCH_TRUE, and UNPROTECT_INTERFACE.
switch_status_t switch_core_session_perform_receive_message | ( | switch_core_session_t * | session, |
switch_core_session_message_t * | message, | ||
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Definition at line 773 of file switch_core_session.c.
References CF_CONFIRM_BLIND_TRANSFER, CF_EARLY_MEDIA, CF_PROXY_OFF, CF_VIDEO_BREAK, switch_core_session_message::from, switch_core_session_message::message_id, message_names, switch_io_event_hook_receive_message::next, switch_core_session_message::numeric_arg, switch_io_event_hook_receive_message::receive_message, switch_assert, switch_channel_clear_flag(), switch_channel_down_nosig, switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_ID_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_test_flag(), switch_channel_up_nosig, switch_core_media_bug_flush_all(), switch_core_media_receive_message(), switch_core_recovery_track(), switch_core_session_free_message(), switch_core_session_get_uuid(), switch_core_session_kill_channel, switch_core_session_locate, switch_core_session_read_lock_hangup(), switch_core_session_receive_message, switch_core_session_rwunlock(), switch_core_session_strdup, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE, SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_MESSAGE_INDICATE_ANSWER, SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE, SWITCH_MESSAGE_INDICATE_BRIDGE, SWITCH_MESSAGE_INDICATE_BROADCAST, SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS, SWITCH_MESSAGE_INDICATE_DEFLECT, SWITCH_MESSAGE_INDICATE_DISPLAY, SWITCH_MESSAGE_INDICATE_HOLD, SWITCH_MESSAGE_INDICATE_MEDIA, SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT, SWITCH_MESSAGE_INDICATE_NOMEDIA, SWITCH_MESSAGE_INDICATE_PROGRESS, SWITCH_MESSAGE_INDICATE_REDIRECT, SWITCH_MESSAGE_INDICATE_RESPOND, SWITCH_MESSAGE_INDICATE_RINGING, SWITCH_MESSAGE_INDICATE_SIGNAL_DATA, SWITCH_MESSAGE_INDICATE_TRANSFER, SWITCH_MESSAGE_INDICATE_UNBRIDGE, SWITCH_MESSAGE_INDICATE_UNHOLD, SWITCH_MESSAGE_INVALID, SWITCH_MESSAGE_REDIRECT_AUDIO, switch_separate_string(), SWITCH_SIG_BREAK, SWITCH_STATUS_SUCCESS, switch_true(), and zstr.
uint32_t switch_core_session_private_event_count | ( | switch_core_session_t * | session | ) |
Definition at line 1221 of file switch_core_session.c.
References CF_EVENT_LOCK, CF_EVENT_LOCK_PRI, check_media, switch_channel_test_flag(), switch_core_session_get_channel(), and switch_queue_size().
switch_status_t switch_core_session_queue_event | ( | switch_core_session_t * | session, |
switch_event_t ** | event | ||
) |
Definition at line 1133 of file switch_core_session.c.
References switch_assert, switch_core_session_wake_session_thread(), switch_queue_trypush(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_event_send().
switch_status_t switch_core_session_queue_indication | ( | switch_core_session_t * | session, |
switch_core_session_message_types_t | indication | ||
) |
Definition at line 960 of file switch_core_session.c.
References switch_core_session_message::from, memset(), switch_core_session_message::message_id, SCSMF_DYNAMIC, switch_core_session_queue_message(), switch_set_flag, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_session_queue_message | ( | switch_core_session_t * | session, |
switch_core_session_message_t * | message | ||
) |
Definition at line 976 of file switch_core_session.c.
References switch_assert, switch_core_session_kill_channel, switch_core_session_wake_session_thread(), switch_queue_trypush(), SWITCH_SIG_BREAK, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_dequeue_message(), and switch_core_session_queue_indication().
switch_status_t switch_core_session_queue_private_event | ( | switch_core_session_t * | session, |
switch_event_t ** | event, | ||
switch_bool_t | priority | ||
) |
Definition at line 1191 of file switch_core_session.c.
References switch_assert, switch_core_session_kill_channel, SWITCH_EVENT_PRIVATE_COMMAND, switch_queue_trypush(), SWITCH_SIG_BREAK, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_execute_application_async().
switch_status_t switch_core_session_receive_event | ( | switch_core_session_t * | session, |
switch_event_t ** | event | ||
) |
Definition at line 1095 of file switch_core_session.c.
References switch_io_event_hook_receive_event::next, switch_io_event_hook_receive_event::receive_event, switch_assert, switch_channel_up_nosig, switch_core_session_kill_channel, switch_core_session_read_lock(), switch_core_session_rwunlock(), switch_event_destroy(), SWITCH_SIG_BREAK, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_core_session_t* switch_core_session_request_by_name | ( | const char * | endpoint_name, |
switch_call_direction_t | direction, | ||
switch_memory_pool_t ** | pool | ||
) |
Definition at line 2384 of file switch_core_session.c.
References SOF_NONE, SWITCH_CHANNEL_LOG, switch_core_session_request, switch_loadable_module_get_endpoint_interface(), SWITCH_LOG_ERROR, switch_log_printf(), and UNPROTECT_INTERFACE.
switch_core_session_t* switch_core_session_request_uuid | ( | switch_endpoint_interface_t * | endpoint_interface, |
switch_call_direction_t | direction, | ||
switch_originate_flag_t | originate_flags, | ||
switch_memory_pool_t ** | pool, | ||
const char * | use_uuid | ||
) |
Definition at line 2218 of file switch_core_session.c.
References switch_frame::buflen, switch_core_session::bug_rwlock, CF_OUTBOUND, switch_core_session::channel, switch_core_session::codec_read_mutex, switch_core_session::codec_write_mutex, switch_core_session::cond, CS_NEW, switch_frame::data, switch_core_session::enc_read_buf, switch_core_session::enc_read_frame, switch_core_session::enc_write_buf, switch_core_session::enc_write_frame, switch_core_session::endpoint_interface, switch_core_session::event_queue, switch_core_session::frame_read_mutex, switch_core_session::id, switch_core_session::io_rwlock, switch_core_session::message_queue, switch_runtime::min_idle_time, switch_core_session::mutex, pool, switch_core_session::pool, switch_core_session::private_event_queue, switch_core_session::private_event_queue_pri, switch_runtime::profile_time, PROTECT_INTERFACE, switch_core_session::raw_read_buf, switch_core_session::raw_read_frame, switch_core_session::raw_write_buf, switch_core_session::raw_write_frame, switch_core_session::resample_mutex, runtime, switch_core_session::rwlock, switch_session_manager::session_count, switch_runtime::session_hash_mutex, switch_session_manager::session_id, switch_session_manager::session_limit, session_manager, switch_session_manager::session_table, switch_runtime::sessions_peak, switch_runtime::sessions_peak_fivemin, switch_core_session::signal_data_queue, SOF_NO_LIMITS, switch_runtime::sps, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_alloc(), switch_channel_init(), SWITCH_CHANNEL_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_set_variable_printf(), switch_core_alloc, switch_core_hash_find(), switch_core_hash_insert, switch_core_memory_pool_set_data(), switch_core_new_memory_pool, switch_core_ready(), switch_core_ready_inbound(), switch_core_ready_outbound(), SWITCH_EVENT_QUEUE_LEN, SWITCH_LOG_CRIT, switch_log_printf(), SWITCH_MESSAGE_QUEUE_LEN, switch_mutex_init(), switch_mutex_lock(), SWITCH_MUTEX_NESTED, switch_mutex_unlock(), switch_queue_create(), switch_set_string, SWITCH_STATUS_SUCCESS, switch_thread_cond_create(), switch_thread_rwlock_create(), switch_uuid_format(), switch_uuid_get(), switch_runtime::throttle_mutex, UNPROTECT_INTERFACE, switch_core_session::uuid_str, switch_core_session::video_codec_read_mutex, and switch_core_session::video_codec_write_mutex.
Referenced by switch_core_session_request_xml().
void switch_core_session_reset | ( | switch_core_session_t * | session, |
switch_bool_t | flush_dtmf, | ||
switch_bool_t | reset_read_codec | ||
) |
Definition at line 1303 of file switch_core_session.c.
References CF_BREAK, SSF_WARN_TRANSCODE, switch_buffer_destroy(), switch_channel_clear_flag(), switch_channel_flush_dtmf(), switch_channel_has_dtmf(), switch_clear_flag, switch_core_codec_destroy(), switch_core_codec_ready(), switch_core_session_flush_message(), switch_core_session_get_channel(), switch_core_session_set_read_codec(), switch_ivr_deactivate_unicast(), switch_mutex_lock(), switch_mutex_unlock(), switch_resample_destroy(), and switch_safe_free.
Referenced by switch_core_session_perform_destroy().
unsigned int switch_core_session_running | ( | switch_core_session_t * | session | ) |
Definition at line 1422 of file switch_core_session.c.
References SSF_THREAD_RUNNING, and switch_test_flag.
Referenced by switch_core_session_perform_destroy().
switch_status_t switch_core_session_set_private_class | ( | switch_core_session_t * | session, |
void * | private_info, | ||
switch_pvt_class_t | index | ||
) |
Definition at line 465 of file switch_core_session.c.
References switch_assert, SWITCH_CORE_SESSION_MAX_PRIVATES, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_session_set_uuid | ( | switch_core_session_t * | session, |
const char * | use_uuid | ||
) |
Definition at line 1897 of file switch_core_session.c.
References switch_core_session_message::from, switch_core_session_message::message_id, switch_caller_profile::pool, runtime, switch_runtime::session_hash_mutex, session_manager, switch_session_manager::session_table, switch_core_session_message::string_array_arg, switch_assert, switch_channel_event_set_data(), switch_channel_get_caller_profile(), switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_core_hash_delete(), switch_core_hash_find(), switch_core_hash_insert, switch_core_session_receive_message, switch_core_strdup, switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_UUID, switch_event_create, switch_event_fire, SWITCH_LOG_CRIT, switch_log_printf(), SWITCH_MESSAGE_INDICATE_UUID_CHANGE, switch_mutex_lock(), switch_mutex_unlock(), switch_set_string, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_caller_profile::uuid.
Referenced by switch_core_session_outgoing_channel().
void switch_core_session_signal_state_change | ( | switch_core_session_t * | session | ) |
Definition at line 1401 of file switch_core_session.c.
References switch_io_event_hook_state_change::next, switch_io_event_hook_state_change::state_change, switch_core_session_kill_channel, switch_core_session_wake_session_thread(), SWITCH_SIG_BREAK, and SWITCH_STATUS_SUCCESS.
unsigned int switch_core_session_started | ( | switch_core_session_t * | session | ) |
Definition at line 1427 of file switch_core_session.c.
References SSF_THREAD_STARTED, and switch_test_flag.
|
static |
Definition at line 1619 of file switch_core_session.c.
References switch_core_session::channel, switch_core_session::id, switch_core_session::soft_lock, SSF_DESTROYABLE, SSF_DESTROYED, switch_assert, switch_channel_event_set_data(), switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_core_media_bug_remove_all, switch_core_memory_pool_tag(), switch_core_session_destroy, switch_core_session_get_pool(), switch_core_session_run(), switch_core_session_rwunlock(), switch_core_session_strdup, switch_core_session_write_lock(), switch_event_create, switch_event_destroy(), SWITCH_EVENT_GENERAL, switch_event_serialize(), SWITCH_FALSE, SWITCH_LOG_DEBUG, SWITCH_LOG_NOTICE, switch_log_printf(), switch_set_flag, SWITCH_SIZE_T_FMT, SWITCH_STATUS_SUCCESS, switch_thread_self(), switch_true(), switch_yield, switch_core_session::thread, thread, and switch_core_session::thread_id.
Referenced by switch_core_session_thread_launch(), and switch_core_session_thread_pool_launch().
switch_status_t switch_core_session_thread_launch | ( | switch_core_session_t * | session | ) |
Definition at line 1834 of file switch_core_session.c.
References apr_threadattr_t::pool, runtime, SCF_SESSION_THREAD_POOL, SSF_THREAD_RUNNING, SSF_THREAD_STARTED, SWITCH_CHANNEL_SESSION_LOG, switch_clear_flag, switch_core_session_thread(), switch_core_session_thread_pool_launch(), SWITCH_LOG_CRIT, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_set_flag, SWITCH_STATUS_FALSE, SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_detach_set(), switch_threadattr_stacksize_set(), thread, and thread_launch_failure().
|
static |
Definition at line 1676 of file switch_core_session.c.
References switch_thread_data_s::alloc, switch_session_manager::busy, switch_session_manager::cond, switch_thread_data_s::func, switch_session_manager::mutex, switch_thread_data_s::obj, pool, switch_thread_data_s::pool, switch_thread_pool_node_s::pool, switch_session_manager::running, session_manager, SWITCH_CHANNEL_LOG, switch_core_destroy_memory_pool, SWITCH_LOG_DEBUG10, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_pop_timeout(), switch_status_is_timeup(), SWITCH_STATUS_SUCCESS, switch_thread_cond_signal(), and switch_session_manager::thread_queue.
Referenced by check_queue().
void switch_core_session_uninit | ( | void | ) |
Definition at line 2474 of file switch_core_session.c.
References switch_session_manager::cond, switch_session_manager::mutex, switch_session_manager::running, session_manager, switch_session_manager::session_table, switch_core_hash_destroy(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_term(), switch_thread_cond_timedwait(), and switch_session_manager::thread_queue.
Referenced by switch_core_destroy().
switch_status_t switch_core_session_wake_session_thread | ( | switch_core_session_t * | session | ) |
Definition at line 1366 of file switch_core_session.c.
References switch_channel_state_thread_trylock(), switch_channel_state_thread_unlock(), switch_cond_next(), switch_mutex_trylock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, and switch_thread_cond_signal().
Referenced by switch_core_session_queue_event(), switch_core_session_queue_message(), switch_core_session_queue_signal_data(), and switch_core_session_signal_state_change().
uint32_t switch_core_sessions_per_second | ( | uint32_t | new_limit | ) |
Definition at line 2453 of file switch_core_session.c.
References runtime, and switch_runtime::sps_total.
SWITCH_STANDARD_SCHED_FUNC | ( | sch_heartbeat_callback | ) |
Definition at line 1526 of file switch_core_session.c.
References switch_core_session::channel, switch_core_session_message::message_id, switch_core_session_message::numeric_arg, switch_channel_event_set_data(), switch_core_session_locate, switch_core_session_receive_message, switch_core_session_rwunlock(), switch_epoch_time_now(), switch_event_create, switch_event_fire, SWITCH_EVENT_SESSION_HEARTBEAT, SWITCH_MESSAGE_HEARTBEAT_EVENT, and switch_core_session::track_duration.
|
static |
Definition at line 1726 of file switch_core_session.c.
References switch_session_manager::mutex, session_manager, SWITCH_CHANNEL_LOG, switch_core_session_count(), switch_core_session_limit(), SWITCH_LOG_CRIT, switch_log_printf(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by check_queue(), switch_core_session_launch_thread(), and switch_core_session_thread_launch().
|
static |
Definition at line 1943 of file switch_core_session.c.
References switch_xml_child(), and switch_xml::txt.
Referenced by switch_core_session_request_xml().
|
static |
Definition at line 713 of file switch_core_session.c.
Referenced by switch_core_session_perform_receive_message().
struct switch_session_manager session_manager |
Definition at line 42 of file switch_core_session.c.
Referenced by check_queue(), switch_core_session_count(), switch_core_session_debug_pool(), switch_core_session_event_send(), switch_core_session_findall(), switch_core_session_findall_matching_var(), switch_core_session_hupall(), switch_core_session_hupall_endpoint(), switch_core_session_hupall_matching_var_ans(), switch_core_session_id(), switch_core_session_id_dec(), switch_core_session_init(), switch_core_session_limit(), switch_core_session_message_send(), switch_core_session_perform_destroy(), switch_core_session_perform_force_locate(), switch_core_session_perform_locate(), switch_core_session_request_uuid(), switch_core_session_set_uuid(), switch_core_session_sync_clock(), switch_core_session_thread_pool_launch(), switch_core_session_thread_pool_worker(), switch_core_session_uninit(), SWITCH_MODULE_RUNTIME_FUNCTION(), switch_thread_pool_launch_thread(), and thread_launch_failure().