RTS API Documentation
1.10.11
|
Data Structures | |
struct | switch_event_header |
An event Header. More... | |
struct | switch_event |
Representation of an event. More... | |
struct | switch_serial_event_s |
struct | switch_serial_event_header_s |
Macros | |
#define | SWITCH_EVENT_SUBCLASS_ANY NULL |
#define | switch_event_create_subclass(_e, _eid, _sn) switch_event_create_subclass_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, _e, _eid, _sn) |
#define | switch_event_get_header(_e, _h) switch_event_get_header_idx(_e, _h, -1) |
#define | switch_event_get_header_nil(e, h) switch_str_nil(switch_event_get_header(e,h)) |
#define | switch_event_del_header(_e, _h) switch_event_del_header_val(_e, _h, NULL) |
#define | switch_event_safe_destroy(_event) if (_event) switch_event_destroy(&_event) |
#define | switch_event_prep_for_delivery(_event) switch_event_prep_for_delivery_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, _event) |
#define | switch_event_expand_headers(_event, _in) switch_event_expand_headers_check(_event, _in, NULL, NULL, 0) |
#define | switch_event_create_pres_in(event) |
#define | switch_event_reserve_subclass(subclass_name) switch_event_reserve_subclass_detailed(__FILE__, subclass_name) |
Reserve a subclass assuming the owner string is the current filename. More... | |
#define | switch_event_free_subclass(subclass_name) switch_event_free_subclass_detailed(__FILE__, subclass_name) |
#define | switch_event_create(event, id) switch_event_create_subclass(event, id, SWITCH_EVENT_SUBCLASS_ANY) |
Create a new event assuming it will not be custom event and therefore hiding the unused parameters. More... | |
#define | switch_event_fire(event) switch_event_fire_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, event, NULL) |
Fire an event filling in most of the arguements with obvious values. More... | |
#define | switch_event_fire_data(event, data) switch_event_fire_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, event, data) |
Fire an event filling in most of the arguements with obvious values and allowing user_data to be sent. More... | |
#define | NO_EVENT_CHANNEL_ID 0 |
#define | SWITCH_EVENT_CHANNEL_GLOBAL "__global__" |
Typedefs | |
typedef struct switch_serial_event_s | switch_serial_event_t |
typedef struct switch_serial_event_header_s | switch_serial_event_header_t |
typedef void(* | switch_live_array_command_handler_t) (switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data) |
Enumerations | |
enum | switch_event_flag_t { EF_UNIQ_HEADERS = (1 << 0), EF_NO_CHAT_EXEC = (1 << 1), EF_DEFAULT_ALLOW = (1 << 2) } |
#define NO_EVENT_CHANNEL_ID 0 |
Definition at line 439 of file switch_event.h.
#define SWITCH_EVENT_CHANNEL_GLOBAL "__global__" |
Definition at line 440 of file switch_event.h.
Referenced by ecd_deliver().
#define switch_event_create | ( | event, | |
id | |||
) | switch_event_create_subclass(event, id, SWITCH_EVENT_SUBCLASS_ANY) |
Create a new event assuming it will not be custom event and therefore hiding the unused parameters.
event | a NULL pointer on which to create the event |
id | the event id enumeration of the desired event |
Definition at line 384 of file switch_event.h.
Referenced by check_ip(), generate_on_dtmf(), handle_SIGHUP(), hanguphook(), process_device_hup(), record_callback(), rtp_common_write(), send_heartbeat(), send_record_stop_event(), signal_bridge_on_hangup(), signal_bridge_on_hibernate(), speech_thread(), switch_api_execute(), switch_channel_check_device_state(), switch_channel_clear_device_record(), switch_channel_dequeue_dtmf(), switch_channel_flip_cid(), switch_channel_get_variables(), switch_channel_get_variables_prefix(), switch_channel_mark_hold(), switch_channel_perform_hangup(), switch_channel_perform_mark_answered(), switch_channel_perform_mark_pre_answered(), switch_channel_perform_mark_ring_ready_value(), switch_channel_perform_presence(), switch_channel_perform_set_callstate(), switch_channel_perform_set_running_state(), switch_console_printf(), switch_core_chat_send_args(), switch_core_destroy(), switch_core_init_and_modload(), switch_core_media_bug_add(), switch_core_media_bug_destroy(), switch_core_media_read_frame(), switch_core_media_sdp_map(), switch_core_session_ctl(), switch_core_session_exec(), switch_core_session_execute_application_async(), switch_core_session_hupall_matching_var_ans(), switch_core_session_outgoing_channel(), switch_core_session_perform_destroy(), switch_core_session_read_frame(), switch_core_session_read_text_frame(), switch_core_session_reporting_state(), switch_core_session_run(), switch_core_session_set_read_codec(), switch_core_session_set_real_read_codec(), switch_core_session_set_uuid(), switch_core_session_set_video_read_codec(), switch_core_session_set_video_write_codec(), switch_core_session_set_write_codec(), switch_core_session_thread(), switch_event_binary_deserialize(), switch_event_create_array_pair(), switch_event_create_json(), switch_event_create_plain(), switch_event_import_xml(), switch_http_parse_header(), switch_ivr_broadcast(), switch_ivr_check_presence_mapping(), switch_ivr_hold(), switch_ivr_multi_threaded_bridge(), switch_ivr_park(), switch_ivr_phrase_macro_event(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_say(), switch_ivr_say_string(), switch_ivr_signal_bridge(), switch_ivr_unhold(), switch_load_network_lists(), switch_loadable_module_process(), switch_loadable_module_unprocess(), switch_log_meta_vprintf(), switch_msrp_msg_create(), switch_nat_add_mapping_internal(), switch_nat_del_mapping(), switch_nat_multicast_runtime(), switch_odbc_handle_disconnect(), switch_rtp_add_crypto_key(), switch_scheduler_add_task_ex(), switch_scheduler_execute(), switch_send_rtcp_event(), SWITCH_STANDARD_SCHED_FUNC(), switch_xml_locate_domain(), switch_xml_locate_group(), switch_xml_locate_user(), switch_xml_open_root(), task_thread_loop(), text_callback(), tone_detect_callback(), and uuid_bridge_on_soft_execute().
#define switch_event_create_pres_in | ( | event | ) |
Definition at line 364 of file switch_event.h.
#define switch_event_create_subclass | ( | _e, | |
_eid, | |||
_sn | |||
) | switch_event_create_subclass_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, _e, _eid, _sn) |
Definition at line 153 of file switch_event.h.
Referenced by Event::Event(), ivr_send_event(), switch_core_hash_delete_multi(), switch_event_create_pres_in_detailed(), switch_event_dup(), switch_event_dup_reply(), and switch_limit_fire_event().
#define switch_event_del_header | ( | _e, | |
_h | |||
) | switch_event_del_header_val(_e, _h, NULL) |
Definition at line 212 of file switch_event.h.
Referenced by Event::delHeader(), switch_channel_add_variable_var_check(), switch_channel_process_export(), switch_channel_set_log_tag(), switch_channel_set_variable_printf(), switch_channel_set_variable_strip_quotes_var_check(), switch_channel_set_variable_var_check(), switch_core_session_outgoing_channel(), switch_core_set_var_conditional(), switch_core_set_variable(), switch_event_base_add_header(), switch_event_channel_permission_modify(), switch_event_create_json(), switch_event_set_subclass_name(), and switch_ivr_originate().
#define switch_event_expand_headers | ( | _event, | |
_in | |||
) | switch_event_expand_headers_check(_event, _in, NULL, NULL, 0) |
Definition at line 355 of file switch_event.h.
Referenced by api_hook(), switch_core_execute_chat_app(), and switch_ivr_phrase_macro_event().
#define switch_event_fire | ( | event | ) | switch_event_fire_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, event, NULL) |
Fire an event filling in most of the arguements with obvious values.
event | the event to send (will be nulled on success) |
Definition at line 413 of file switch_event.h.
Referenced by check_ip(), do_chat_send(), Event::fire(), generate_on_dtmf(), handle_SIGHUP(), hanguphook(), ivr_send_event(), record_callback(), rtp_common_write(), send_heartbeat(), send_record_stop_event(), signal_bridge_on_hangup(), signal_bridge_on_hibernate(), speech_thread(), switch_api_execute(), switch_channel_check_device_state(), switch_channel_clear_device_record(), switch_channel_dequeue_dtmf(), switch_channel_flip_cid(), switch_channel_mark_hold(), switch_channel_perform_hangup(), switch_channel_perform_mark_answered(), switch_channel_perform_mark_pre_answered(), switch_channel_perform_mark_ring_ready_value(), switch_channel_perform_presence(), switch_channel_perform_set_callstate(), switch_channel_perform_set_running_state(), switch_console_printf(), switch_core_destroy(), switch_core_init_and_modload(), switch_core_media_bug_add(), switch_core_media_bug_destroy(), switch_core_media_read_frame(), switch_core_session_ctl(), switch_core_session_exec(), switch_core_session_outgoing_channel(), switch_core_session_perform_destroy(), switch_core_session_read_frame(), switch_core_session_read_text_frame(), switch_core_session_reporting_state(), switch_core_session_run(), switch_core_session_set_read_codec(), switch_core_session_set_real_read_codec(), switch_core_session_set_uuid(), switch_core_session_set_video_read_codec(), switch_core_session_set_video_write_codec(), switch_core_session_set_write_codec(), switch_ivr_hold(), switch_ivr_multi_threaded_bridge(), switch_ivr_park(), switch_ivr_parse_next_event(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_signal_bridge(), switch_ivr_unhold(), switch_limit_fire_event(), switch_loadable_module_init(), switch_loadable_module_process(), switch_loadable_module_unprocess(), switch_log_meta_vprintf(), switch_nat_add_mapping_internal(), switch_nat_del_mapping(), switch_nat_multicast_runtime(), switch_odbc_handle_disconnect(), switch_rtp_add_crypto_key(), switch_scheduler_task_thread(), switch_send_rtcp_event(), SWITCH_STANDARD_SCHED_FUNC(), switch_xml_open_root(), text_callback(), tone_detect_callback(), and uuid_bridge_on_soft_execute().
#define switch_event_fire_data | ( | event, | |
data | |||
) | switch_event_fire_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, event, data) |
Fire an event filling in most of the arguements with obvious values and allowing user_data to be sent.
event | the event to send (will be nulled on success) |
data | user data to send to the event handlers |
Definition at line 422 of file switch_event.h.
#define switch_event_free_subclass | ( | subclass_name | ) | switch_event_free_subclass_detailed(__FILE__, subclass_name) |
Definition at line 376 of file switch_event.h.
#define switch_event_get_header | ( | _e, | |
_h | |||
) | switch_event_get_header_idx(_e, _h, -1) |
Definition at line 172 of file switch_event.h.
Referenced by Event::chat_send(), core_event_handler(), do_chat_send(), find_user_in_tag(), generate_m(), get_recording_var(), Event::getHeader(), parse_presence_data_cols(), play_and_detect_input_callback(), record_callback(), record_helper_post_process(), send_record_stop_event(), switch_channel_event_set_extended_data(), switch_channel_get_scope_variables(), switch_collect_input_callback(), switch_core_get_variable(), switch_core_get_variable_dup(), switch_core_get_variable_pdup(), switch_core_media_gen_local_sdp(), switch_core_perform_file_open(), switch_core_session_outgoing_channel(), switch_core_set_var_conditional(), switch_core_set_variable(), switch_dial_leg_get_var(), switch_event_channel_permission_verify(), switch_event_check_permission_list(), switch_events_match(), switch_ivr_eavesdrop_session(), switch_ivr_originate(), switch_ivr_parse_event(), switch_ivr_record_file_event(), switch_ivr_record_session_event(), switch_json_add_presence_data_cols(), switch_msrp_msg_get_header(), switch_say_file_handle_get_variable(), and switch_xml_config_parse_event().
#define switch_event_get_header_nil | ( | e, | |
h | |||
) | switch_str_nil(switch_event_get_header(e,h)) |
Definition at line 174 of file switch_event.h.
Referenced by core_event_handler(), and parse_presence_data_cols().
#define switch_event_prep_for_delivery | ( | _event | ) | switch_event_prep_for_delivery_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, _event) |
Definition at line 243 of file switch_event.h.
Referenced by switch_ivr_parse_next_event().
#define switch_event_reserve_subclass | ( | subclass_name | ) | switch_event_reserve_subclass_detailed(__FILE__, subclass_name) |
Reserve a subclass assuming the owner string is the current filename.
subclass_name | the subclass name to reserve |
Definition at line 375 of file switch_event.h.
Referenced by switch_limit_init().
#define switch_event_safe_destroy | ( | _event | ) | if (_event) switch_event_destroy(&_event) |
Definition at line 219 of file switch_event.h.
Referenced by record_helper_destroy().
#define SWITCH_EVENT_SUBCLASS_ANY NULL |
Definition at line 128 of file switch_event.h.
Referenced by switch_core_sqldb_start(), and switch_event_create_pres_in_detailed().
typedef void(* switch_live_array_command_handler_t) (switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data) |
Definition at line 437 of file switch_event.h.
typedef struct switch_serial_event_header_s switch_serial_event_header_t |
typedef struct switch_serial_event_s switch_serial_event_t |
enum switch_event_flag_t |
Enumerator | |
---|---|
EF_UNIQ_HEADERS | |
EF_NO_CHAT_EXEC | |
EF_DEFAULT_ALLOW |
Definition at line 119 of file switch_event.h.
int switch_event_add_array | ( | switch_event_t * | event, |
const char * | var, | ||
const char * | val | ||
) |
Definition at line 962 of file switch_event.c.
References memset(), switch_assert, switch_event_add_header_string(), switch_separate_string_string(), and SWITCH_STACK_PUSH.
Referenced by switch_event_base_add_header().
switch_status_t switch_event_add_body | ( | switch_event_t * | event, |
const char * | fmt, | ||
... | |||
) |
Add a body to an event.
event | the event to add to body to |
fmt | optional body of the event (varargs see standard sprintf family) |
Referenced by Event::addBody(), speech_thread(), switch_core_chat_send_args(), switch_core_session_read_text_frame(), switch_core_session_reporting_state(), and text_callback().
switch_status_t switch_event_add_header | ( | switch_event_t * | event, |
switch_stack_t | stack, | ||
const char * | header_name, | ||
const char * | fmt, | ||
... | |||
) |
Add a header to an event.
event | the event to add the header to |
stack | the stack sense (stack it on the top or on the bottom) |
header_name | the name of the header to add |
fmt | the value of the header (varargs see standard sprintf family) |
Referenced by check_ip(), generate_on_dtmf(), handle_SIGHUP(), send_heartbeat(), switch_caller_profile_event_set_data(), switch_channel_check_device_state(), switch_channel_dequeue_dtmf(), switch_channel_event_set_basic_data(), switch_channel_perform_presence(), switch_channel_perform_set_callstate(), switch_console_printf(), switch_core_destroy(), switch_core_init_and_modload(), switch_core_media_bug_add(), switch_core_media_bug_destroy(), switch_core_session_ctl(), switch_core_session_set_read_codec(), switch_core_session_set_real_read_codec(), switch_core_session_set_video_read_codec(), switch_core_session_set_video_write_codec(), switch_core_session_set_write_codec(), switch_ivr_broadcast(), switch_limit_fire_event(), switch_log_meta_vprintf(), switch_nat_add_mapping_internal(), switch_nat_del_mapping(), switch_odbc_handle_disconnect(), switch_rtp_add_crypto_key(), switch_scheduler_add_task_ex(), switch_scheduler_execute(), and task_thread_loop().
switch_status_t switch_event_add_header_string | ( | switch_event_t * | event, |
switch_stack_t | stack, | ||
const char * | header_name, | ||
const char * | data | ||
) |
Add a string header to an event.
event | the event to add the header to |
stack | the stack sense (stack it on the top or on the bottom) |
header_name | the name of the header to add |
data | the value of the header |
Definition at line 1247 of file switch_event.c.
References DUP, switch_event_base_add_header(), and SWITCH_STATUS_GENERR.
Referenced by Event::addHeader(), check_ip(), do_chat_send(), generate_on_dtmf(), ivr_send_event(), merge_recording_variables(), record_callback(), send_record_stop_event(), signal_bridge_on_hangup(), signal_bridge_on_hibernate(), speech_thread(), switch_api_execute(), switch_caller_profile_event_set_data(), switch_channel_add_variable_var_check(), switch_channel_check_device_state(), switch_channel_clear_device_record(), switch_channel_event_set_basic_data(), switch_channel_event_set_extended_data(), switch_channel_flip_cid(), switch_channel_get_scope_variables(), switch_channel_get_variables_prefix(), switch_channel_perform_presence(), switch_channel_perform_set_callstate(), switch_channel_process_export(), switch_channel_set_log_tag(), switch_channel_set_variable_strip_quotes_var_check(), switch_channel_set_variable_var_check(), switch_console_printf(), switch_core_chat_deliver(), switch_core_chat_send(), switch_core_chat_send_args(), switch_core_hash_delete_multi(), switch_core_media_read_frame(), switch_core_media_sdp_map(), switch_core_session_exec(), switch_core_session_execute_application_async(), switch_core_session_hupall_matching_var_ans(), switch_core_session_reporting_state(), switch_core_session_set_read_codec(), switch_core_session_set_real_read_codec(), switch_core_session_set_uuid(), switch_core_session_set_video_read_codec(), switch_core_session_set_video_write_codec(), switch_core_session_set_write_codec(), switch_core_set_variable(), switch_dial_handle_add_global_var(), switch_dial_handle_add_leg_var(), switch_dial_handle_list_add_global_var(), switch_event_add_array(), switch_event_add_presence_data_cols(), switch_event_binary_deserialize(), switch_event_channel_permission_modify(), switch_event_create_array_pair(), switch_event_create_brackets(), switch_event_create_json(), switch_event_create_pres_in_detailed(), switch_event_create_subclass_detailed(), switch_event_dup(), switch_event_dup_reply(), switch_event_import_xml(), switch_event_merge(), switch_event_prep_for_delivery_detailed(), switch_event_set_priority(), switch_event_set_subclass_name(), switch_http_parse_header(), switch_http_parse_qs(), switch_ivr_broadcast(), switch_ivr_check_presence_mapping(), switch_ivr_create_message_reply(), switch_ivr_enterprise_originate(), switch_ivr_multi_threaded_bridge(), switch_ivr_originate(), switch_ivr_phrase_macro_event(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_say(), switch_ivr_say_string(), switch_ivr_signal_bridge(), switch_limit_fire_event(), switch_load_network_lists(), switch_loadable_module_process(), switch_loadable_module_unprocess(), switch_log_meta_vprintf(), switch_log_node_to_json(), switch_msrp_msg_add_header(), switch_nat_add_mapping_internal(), switch_nat_del_mapping(), switch_nat_multicast_runtime(), switch_regex_set_event_header_callback(), switch_rtp_add_crypto_key(), switch_scheduler_add_task_ex(), switch_scheduler_execute(), switch_send_rtcp_event(), switch_xml_locate_domain(), switch_xml_locate_group(), switch_xml_locate_language(), switch_xml_locate_user(), task_thread_loop(), tone_detect_callback(), and uuid_bridge_on_soft_execute().
switch_status_t switch_event_add_header_string_nodup | ( | switch_event_t * | event, |
switch_stack_t | stack, | ||
const char * | header_name, | ||
const char * | data | ||
) |
Definition at line 1239 of file switch_event.c.
References switch_event_base_add_header(), and SWITCH_STATUS_GENERR.
Referenced by switch_core_set_var_conditional().
void switch_event_add_presence_data_cols | ( | switch_channel_t * | channel, |
switch_event_t * | event, | ||
const char * | prefix | ||
) |
Definition at line 2694 of file switch_event.c.
References switch_channel_get_variable, switch_event_add_header_string(), switch_safe_free, switch_snprintf(), switch_split, and SWITCH_STACK_BOTTOM.
Referenced by signal_bridge_on_hangup(), signal_bridge_on_hibernate(), switch_channel_event_set_basic_data(), and switch_ivr_multi_threaded_bridge().
switch_status_t switch_event_binary_deserialize | ( | switch_event_t ** | eventp, |
void ** | data, | ||
switch_size_t | len, | ||
switch_bool_t | duplicate | ||
) |
Render a string representation of an event suitable for printing or network transport.
event | the event to render |
str | a string pointer to point at the allocated data |
encode | url encode the headers |
Definition at line 1430 of file switch_event.c.
References switch_serial_event_s::body, switch_serial_event_s::event_id, switch_serial_event_s::flags, switch_serial_event_header_s::name, switch_serial_event_s::owner, switch_serial_event_s::priority, switch_serial_event_s::subclass_name, switch_assert, switch_event_add_header_string(), SWITCH_EVENT_CLONE, switch_event_create, SWITCH_SERIALIZED_EVENT_MAP, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_serial_event_header_s::value.
switch_status_t switch_event_binary_serialize | ( | switch_event_t * | event, |
void ** | data, | ||
switch_size_t * | len | ||
) |
Definition at line 1482 of file switch_event.c.
References switch_serial_event_s::body, switch_serial_event_s::event_id, switch_serial_event_s::flags, switch_event::headers, switch_event_header::idx, switch_event_header::name, switch_serial_event_header_s::name, switch_event_header::next, switch_serial_event_s::owner, switch_serial_event_s::priority, switch_serial_event_s::subclass_name, SWITCH_SERIALIZED_EVENT_MAP, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_event_header::value, and switch_serial_event_header_s::value.
switch_status_t switch_event_bind | ( | const char * | id, |
switch_event_types_t | event, | ||
const char * | subclass_name, | ||
switch_event_callback_t | callback, | ||
void * | user_data | ||
) |
Bind an event callback to a specific event.
id | an identifier token of the binder |
event | the event enumeration to bind to |
subclass_name | the event subclass to bind to in the case if SWITCH_EVENT_CUSTOM |
callback | the callback functon to bind |
user_data | optional user specific data to pass whenever the callback is invoked |
Definition at line 2127 of file switch_event.c.
References switch_event_bind_removable().
Referenced by switch_core_sqldb_start().
switch_status_t switch_event_bind_removable | ( | const char * | id, |
switch_event_types_t | event, | ||
const char * | subclass_name, | ||
switch_event_callback_t | callback, | ||
void * | user_data, | ||
switch_event_node_t ** | node | ||
) |
Bind an event callback to a specific event.
id | an identifier token of the binder |
event | the event enumeration to bind to |
subclass_name | the event subclass to bind to in the case if SWITCH_EVENT_CUSTOM |
callback | the callback functon to bind |
user_data | optional user specific data to pass whenever the callback is invoked |
node | bind handle to later remove the binding. |
Definition at line 2060 of file switch_event.c.
References switch_event_subclass::bind, BLOCK, switch_event_node::callback, CUSTOM_HASH_MUTEX, DUP, switch_event_node::event_id, switch_event_node::id, switch_event_node::next, RUNTIME_POOL, RWLOCK, switch_event_node::subclass_name, switch_assert, SWITCH_CHANNEL_LOG, switch_core_hash_find(), SWITCH_EVENT_ALL, switch_event_reserve_subclass_detailed(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_unlock(), switch_thread_rwlock_wrlock(), switch_zmalloc, and switch_event_node::user_data.
Referenced by EventConsumer::bind(), switch_event_bind(), and SWITCH_MODULE_LOAD_FUNCTION().
char* switch_event_build_param_string | ( | switch_event_t * | event, |
const char * | prefix, | ||
switch_hash_t * | vars_map | ||
) |
Definition at line 2550 of file switch_event.c.
References switch_stream_handle::data, switch_event::headers, switch_event_header::name, switch_event_header::next, switch_assert, switch_core_hash_find(), switch_safe_free, SWITCH_STANDARD_STREAM, switch_url_encode(), switch_event_header::value, switch_stream_handle::write_function, and zstr.
switch_status_t switch_event_channel_bind | ( | const char * | event_channel, |
switch_event_channel_func_t | func, | ||
switch_event_channel_id_t * | id, | ||
void * | user_data | ||
) |
Definition at line 3129 of file switch_event.c.
References event_channel_manager, switch_assert, switch_event_channel_sub_channel(), SWITCH_STATUS_SUCCESS, switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
switch_status_t switch_event_channel_broadcast | ( | const char * | event_channel, |
cJSON ** | json, | ||
const char * | key, | ||
switch_event_channel_id_t | id | ||
) |
Definition at line 3049 of file switch_event.c.
References switch_thread_data_s::alloc, destroy_ecd(), DISPATCH_QUEUE_LEN, event_channel_data_t::event_channel, EVENT_CHANNEL_DISPATCH_QUEUE, EVENT_CHANNEL_DISPATCH_THREAD_COUNT, EVENT_CHANNEL_DISPATCH_THREAD_STARTING, EVENT_QUEUE_MUTEX, switch_thread_data_s::func, switch_event_node::id, event_channel_data_t::id, event_channel_data_t::json, event_channel_data_t::key, MAX_DISPATCH, switch_thread_data_s::obj, switch_thread_data_s::pool, switch_assert, SWITCH_CHANNEL_LOG, switch_event_channel_deliver_thread(), SWITCH_LOG_CRIT, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_create(), switch_queue_trypush(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_pool_launch_thread(), switch_zmalloc, SYSTEM_RUNNING, and THRUNTIME_POOL.
Referenced by la_broadcast(), and switch_live_array_bootstrap().
switch_status_t switch_event_channel_deliver | ( | const char * | event_channel, |
cJSON ** | json, | ||
const char * | key, | ||
switch_event_channel_id_t | id | ||
) |
Definition at line 3107 of file switch_event.c.
References ecd_deliver(), event_channel_data_t::event_channel, switch_event_node::id, event_channel_data_t::id, event_channel_data_t::json, event_channel_data_t::key, SWITCH_STATUS_SUCCESS, and switch_zmalloc.
void switch_event_channel_permission_clear | ( | const char * | cookie | ) |
Definition at line 3184 of file switch_event.c.
References event_channel_manager, switch_core_hash_delete(), switch_core_hash_find(), switch_event_destroy(), switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
void switch_event_channel_permission_modify | ( | const char * | cookie, |
const char * | event_channel, | ||
switch_bool_t | set | ||
) |
Definition at line 3160 of file switch_event.c.
References event_channel_manager, switch_core_hash_find(), switch_core_hash_insert, switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_DATA, switch_event_create_plain(), switch_event_del_header, SWITCH_STACK_BOTTOM, switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
switch_bool_t switch_event_channel_permission_verify | ( | const char * | cookie, |
const char * | event_channel | ||
) |
Definition at line 3146 of file switch_event.c.
References event_channel_manager, switch_core_hash_find(), switch_event_get_header, SWITCH_FALSE, switch_thread_rwlock_rdlock(), switch_thread_rwlock_unlock(), and switch_true().
uint32_t switch_event_channel_unbind | ( | const char * | event_channel, |
switch_event_channel_func_t | func, | ||
void * | user_data | ||
) |
Definition at line 3124 of file switch_event.c.
References switch_event_channel_unsub_channel().
int switch_event_check_permission_list | ( | switch_event_t * | list, |
const char * | name | ||
) |
Definition at line 2635 of file switch_event.c.
References EF_DEFAULT_ALLOW, switch_event::headers, switch_event_get_header, and switch_test_flag.
Referenced by switch_channel_expand_variables_check(), and switch_event_expand_headers_check().
switch_status_t switch_event_create_array_pair | ( | switch_event_t ** | event, |
char ** | names, | ||
char ** | vals, | ||
int | len | ||
) |
Definition at line 1642 of file switch_event.c.
References name, switch_event_add_header_string(), SWITCH_EVENT_CLONE, switch_event_create, SWITCH_STACK_BOTTOM, SWITCH_STATUS_SUCCESS, switch_str_nil, and zstr.
Referenced by helper_callback().
switch_status_t switch_event_create_brackets | ( | char * | data, |
char | a, | ||
char | b, | ||
char | c, | ||
switch_event_t ** | event, | ||
char ** | new_data, | ||
switch_bool_t | dup | ||
) |
Definition at line 1664 of file switch_event.c.
References EF_UNIQ_HEADERS, switch_event::flags, switch_event_node::next, SWITCH_CHANNEL_LOG, switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_DATA, switch_event_create_plain(), switch_find_end_paren(), SWITCH_LOG_DEBUG1, switch_log_printf(), switch_separate_string(), SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_strchr_strict().
Referenced by switch_core_perform_file_open(), switch_core_session_exec(), switch_ivr_enterprise_originate(), switch_ivr_originate(), and switch_log_node_to_json().
switch_status_t switch_event_create_json | ( | switch_event_t ** | event, |
const char * | json | ||
) |
Definition at line 1767 of file switch_event.c.
References cJSON::child, cJSON_Array, cJSON_String, switch_event::event_id, item, name, cJSON::next, cJSON::string, switch_event_add_body(), switch_event_add_header_string(), SWITCH_EVENT_CLONE, switch_event_create, switch_event_del_header, switch_name_event(), SWITCH_STACK_BOTTOM, SWITCH_STACK_PUSH, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_VA_NONE, cJSON::type, value, and cJSON::valuestring.
Referenced by Event::Event().
|
inlinestatic |
Definition at line 386 of file switch_event.h.
References EF_UNIQ_HEADERS, switch_event_node::event_id, SWITCH_DECLARE, SWITCH_EVENT_CHANNEL_DATA, SWITCH_EVENT_CLONE, switch_event_create, switch_event_deliver(), SWITCH_EVENT_REQUEST_PARAMS, and SWITCH_STATUS_SUCCESS.
Referenced by switch_channel_alloc(), switch_channel_get_scope_variables(), switch_channel_set_log_tag(), switch_core_init(), switch_core_unset_variables(), switch_dial_handle_add_global_var(), switch_dial_handle_add_leg_var(), switch_dial_handle_list_add_global_var(), switch_event_channel_permission_modify(), switch_event_create_brackets(), switch_ivr_enterprise_originate(), switch_ivr_originate(), switch_ivr_uuid_bridge(), and switch_log_node_to_json().
switch_status_t switch_event_create_pres_in_detailed | ( | _In_z_ char * | file, |
_In_z_ char * | func, | ||
_In_ int | line, | ||
_In_z_ const char * | proto, | ||
_In_z_ const char * | login, | ||
_In_z_ const char * | from, | ||
_In_z_ const char * | from_domain, | ||
_In_z_ const char * | status, | ||
_In_z_ const char * | event_type, | ||
_In_z_ const char * | alt_event_type, | ||
_In_ int | event_count, | ||
_In_z_ const char * | unique_id, | ||
_In_z_ const char * | channel_state, | ||
_In_z_ const char * | answer_state, | ||
_In_z_ const char * | call_direction | ||
) |
switch_status_t switch_event_create_subclass_detailed | ( | const char * | file, |
const char * | func, | ||
int | line, | ||
switch_event_t ** | event, | ||
switch_event_types_t | event_id, | ||
const char * | subclass_name | ||
) |
Create an event.
event | a NULL pointer on which to create the event |
event_id | the event id enumeration of the desired event |
subclass_name | the subclass name for custom event (only valid when event_id is SWITCH_EVENT_CUSTOM) |
Definition at line 747 of file switch_event.c.
References ALLOC, DUP, EF_UNIQ_HEADERS, switch_event_node::event_id, memset(), switch_assert, switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_DATA, SWITCH_EVENT_CLONE, SWITCH_EVENT_CUSTOM, SWITCH_EVENT_MESSAGE, switch_event_prep_for_delivery_detailed(), SWITCH_EVENT_REQUEST_PARAMS, switch_queue_trypop(), SWITCH_STACK_BOTTOM, SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_event_del_header_val | ( | switch_event_t * | event, |
const char * | header_name, | ||
const char * | val | ||
) |
Definition at line 872 of file switch_event.c.
References free_header(), switch_event_header::hash, hash, switch_event::last_header, switch_event_header::name, switch_event_header::next, switch_assert, switch_ci_hashfunc_default(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_event_header::value, and zstr.
void switch_event_deliver | ( | switch_event_t ** | event | ) |
Deliver an event to all of the registered event listeners.
event | the event to send (will be nulled) |
Definition at line 400 of file switch_event.c.
References switch_event_node::callback, switch_event_node::next, RWLOCK, SWITCH_EVENT_ALL, switch_event_destroy(), switch_events_match(), switch_thread_rwlock_rdlock(), switch_thread_rwlock_unlock(), SYSTEM_RUNNING, and switch_event_node::user_data.
Referenced by switch_event_create_plain(), switch_event_deliver_thread(), and switch_event_dispatch_thread().
void switch_event_destroy | ( | switch_event_t ** | event | ) |
Destroy an event.
event | pointer to the pointer to event to destroy |
Definition at line 1289 of file switch_event.c.
References switch_event::body, FREE, free_header(), switch_event::headers, switch_event_header::next, switch_event::subclass_name, switch_queue_trypush(), and SWITCH_STATUS_SUCCESS.
Referenced by asr_set_json_text_params(), audio_bridge_thread(), chat_process_event(), EventConsumer::cleanup(), Event::Event(), event_handler(), Event::fire(), CoreSession::flushEvents(), helper_callback(), speech_thread(), switch_channel_api_on(), switch_channel_clear_device_record(), switch_channel_del_variable_prefix(), switch_channel_execute_on(), switch_channel_set_scope_variables(), switch_channel_uninit(), switch_core_destroy(), switch_core_file_close(), switch_core_hash_delete_multi(), switch_core_media_gen_local_sdp(), switch_core_perform_file_open(), switch_core_session_flush_private_events(), switch_core_session_hupall_matching_var_ans(), switch_core_session_perform_destroy(), switch_core_session_receive_event(), switch_core_session_thread(), switch_core_unset_variables(), switch_dial_handle_destroy(), switch_dial_handle_list_destroy(), switch_event_channel_permission_clear(), switch_event_deliver(), switch_event_fire_detailed(), switch_event_shutdown(), switch_http_free_request(), switch_ivr_check_presence_mapping(), switch_ivr_collect_digits_callback(), switch_ivr_eavesdrop_session(), switch_ivr_enterprise_originate(), switch_ivr_gentones(), switch_ivr_originate(), switch_ivr_park(), switch_ivr_phrase_macro_event(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_say(), switch_ivr_say_string(), switch_ivr_session_echo(), switch_ivr_sleep(), switch_ivr_speak_text_handle(), switch_ivr_transfer_variable(), switch_ivr_uuid_bridge(), switch_load_network_lists(), switch_log_node_free(), switch_log_node_to_json(), switch_msrp_msg_destroy(), switch_say_file_handle_destroy(), switch_scheduler_task_thread(), switch_xml_config_parse(), switch_xml_locate_domain(), switch_xml_locate_group(), switch_xml_locate_user(), switch_xml_open_root(), and unsub_all_switch_event_channel().
switch_status_t switch_event_dup | ( | switch_event_t ** | event, |
switch_event_t * | todup | ||
) |
Duplicate an event.
event | a NULL pointer on which to duplicate the event |
todup | an event to duplicate |
Definition at line 1334 of file switch_event.c.
References switch_event_header::array, switch_event::bind_user_data, switch_event::body, DUP, switch_event::event_id, switch_event::event_user_data, switch_event::flags, switch_event::headers, switch_event_header::idx, switch_event::key, switch_event_header::name, switch_event_header::next, switch_event::subclass_name, switch_event_add_header_string(), SWITCH_EVENT_CLONE, switch_event_create_subclass, SWITCH_STACK_BOTTOM, SWITCH_STACK_PUSH, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, and switch_event_header::value.
Referenced by do_chat_send(), event_handler(), Event::fire(), CoreSession::sendEvent(), speech_thread(), switch_channel_get_log_tags(), switch_channel_get_variables(), switch_core_chat_send(), switch_core_get_variables(), switch_core_session_read_text_frame(), switch_dial_handle_dup(), switch_ivr_enterprise_originate(), switch_ivr_originate(), switch_ivr_record_session_event(), switch_log_node_dup(), switch_log_node_to_json(), switch_msrp_msg_dup(), text_callback(), and tone_detect_callback().
switch_status_t switch_event_dup_reply | ( | switch_event_t ** | event, |
switch_event_t * | todup | ||
) |
Definition at line 1371 of file switch_event.c.
References switch_event_header::array, switch_event::bind_user_data, switch_event::body, switch_event::event_id, switch_event::event_user_data, switch_event::flags, switch_event::headers, switch_event_header::idx, switch_event::key, switch_event_header::name, name, switch_event_header::next, switch_event::subclass_name, switch_event_add_header_string(), SWITCH_EVENT_CLONE, switch_event_create_subclass, switch_snprintf(), SWITCH_STACK_BOTTOM, SWITCH_STACK_PUSH, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, value, and switch_event_header::value.
Referenced by switch_ivr_create_message_reply().
char* switch_event_expand_headers_check | ( | switch_event_t * | event, |
const char * | in, | ||
switch_event_t * | var_list, | ||
switch_event_t * | api_list, | ||
uint32_t | recur | ||
) |
Definition at line 2251 of file switch_event.c.
References switch_stream_handle::data, end_of_p, in, memset(), resize, SCF_API_EXPANSION, switch_api_execute(), switch_assert, switch_core_get_variable_dup(), switch_core_test_flag(), switch_event_check_permission_list(), switch_event_get_header_idx(), switch_safe_free, SWITCH_STANDARD_STREAM, SWITCH_STATUS_SUCCESS, switch_string_has_escaped_data(), switch_string_var_check_const(), and zstr.
switch_status_t switch_event_fire_detailed | ( | const char * | file, |
const char * | func, | ||
int | line, | ||
switch_event_t ** | event, | ||
void * | user_data | ||
) |
Fire an event with full arguement list.
file | the calling file |
func | the calling function |
line | the calling line number |
event | the event to send (will be nulled on success) |
user_data | optional private data to pass to the event handlers |
Definition at line 2006 of file switch_event.c.
References BLOCK, check_dispatch(), EVENT_QUEUE_MUTEX, switch_runtime::events_use_dispatch, runtime, RUNTIME_POOL, switch_assert, switch_event_deliver_thread_pool(), switch_event_destroy(), switch_event_queue_dispatch_event(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SYSTEM_RUNNING, and switch_event_node::user_data.
Referenced by switch_event_create_pres_in_detailed().
switch_status_t switch_event_free_subclass_detailed | ( | const char * | owner, |
const char * | subclass_name | ||
) |
Definition at line 454 of file switch_event.c.
References switch_event_subclass::bind, CUSTOM_HASH_MUTEX, FREE, switch_event_subclass::name, switch_event_subclass::owner, RUNTIME_POOL, RWLOCK, switch_assert, SWITCH_CHANNEL_LOG, switch_core_hash_delete(), switch_core_hash_find(), SWITCH_LOG_NOTICE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
char* switch_event_get_body | ( | switch_event_t * | event | ) |
Retrieve the body value from an event.
event | the event to read the body from |
Definition at line 867 of file switch_event.c.
References switch_event::body.
Referenced by Event::getBody(), play_and_detect_input_callback(), switch_collect_input_callback(), and switch_ivr_parse_event().
switch_status_t switch_event_get_custom_events | ( | switch_console_callback_match_t ** | matches | ) |
Definition at line 2040 of file switch_event.c.
References CUSTOM_HASH_MUTEX, switch_console_push_match(), switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
_Ret_opt_z_ char* switch_event_get_header_idx | ( | switch_event_t * | event, |
const char * | header_name, | ||
int | idx | ||
) |
Definition at line 846 of file switch_event.c.
References switch_event_header::array, switch_event_get_header_ptr(), and switch_event_header::value.
Referenced by switch_channel_get_variable_dup(), and switch_event_expand_headers_check().
switch_event_header_t* switch_event_get_header_ptr | ( | switch_event_t * | event, |
const char * | header_name | ||
) |
Retrieve a header value from an event.
event | the event to read the header from |
header_name | the name of the header to read |
Definition at line 825 of file switch_event.c.
References switch_event_header::hash, hash, switch_event::headers, switch_event_header::name, switch_event_header::next, switch_assert, and switch_ci_hashfunc_default().
Referenced by switch_event_base_add_header(), and switch_event_get_header_idx().
switch_status_t switch_event_init | ( | switch_memory_pool_t * | pool | ) |
Start the eventing system.
pool | the memory pool to use for the event system (creates a new one if NULL) |
Definition at line 692 of file switch_event.c.
References BLOCK, check_dispatch(), CUSTOM_HASH_MUTEX, event_channel_manager, EVENT_QUEUE_MUTEX, guess_ip_v4, guess_ip_v6, MAX_DISPATCH, pool, POOL_LOCK, RUNTIME_POOL, RWLOCK, SCF_MINIMAL, switch_assert, SWITCH_CHANNEL_LOG, switch_core_cpu_count(), switch_core_hash_init, switch_core_test_flag(), switch_find_local_ip(), SWITCH_LOG_INFO, switch_log_printf(), switch_mutex_init(), switch_mutex_lock(), SWITCH_MUTEX_NESTED, switch_mutex_unlock(), switch_queue_create(), SWITCH_STATUS_SUCCESS, switch_thread_rwlock_create(), SYSTEM_RUNNING, and THRUNTIME_POOL.
Referenced by switch_core_init().
void switch_event_launch_dispatch_threads | ( | uint32_t | max | ) |
Definition at line 653 of file switch_event.c.
References check_dispatch(), EVENT_DISPATCH_QUEUE_RUNNING, EVENT_DISPATCH_QUEUE_THREADS, index, MAX_DISPATCH, pool, RUNTIME_POOL, SOFT_MAX_DISPATCH, SWITCH_CHANNEL_LOG, switch_event_dispatch_thread(), switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_PRI_REALTIME, switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_priority_set(), switch_threadattr_stacksize_set(), and switch_yield.
Referenced by check_dispatch(), switch_event_queue_dispatch_event(), and switch_load_core_config().
void switch_event_merge | ( | switch_event_t * | event, |
switch_event_t * | tomerge | ||
) |
Definition at line 1315 of file switch_event.c.
References switch_event_header::array, switch_event::headers, switch_event_header::idx, switch_event_header::name, switch_event_header::next, switch_assert, switch_event_add_header_string(), SWITCH_STACK_BOTTOM, SWITCH_STACK_PUSH, and switch_event_header::value.
Referenced by asr_set_json_text_params(), Event::merge(), speech_thread(), switch_channel_execute_on(), switch_ivr_enterprise_originate(), switch_ivr_originate(), and switch_ivr_play_file().
const char* switch_event_name | ( | switch_event_types_t | event | ) |
Render the name of an event id enumeration.
event | the event id to render the name of |
Definition at line 430 of file switch_event.c.
References BLOCK, EVENT_NAMES, RUNTIME_POOL, and switch_assert.
Referenced by Event::getType(), switch_event_prep_for_delivery_detailed(), switch_event_unbind(), and switch_event_unbind_callback().
void switch_event_prep_for_delivery_detailed | ( | const char * | file, |
const char * | func, | ||
int | line, | ||
switch_event_t * | event | ||
) |
Definition at line 1972 of file switch_event.c.
References switch_event::event_id, EVENT_QUEUE_MUTEX, EVENT_SEQUENCE_NR, guess_ip_v4, guess_ip_v6, switch_core_get_hostname(), switch_core_get_switchname(), switch_core_get_uuid(), switch_cut_path(), switch_event_add_header(), switch_event_add_header_string(), switch_event_name(), switch_micro_time_now(), switch_mutex_lock(), switch_mutex_unlock(), switch_rfc822_date(), SWITCH_STACK_BOTTOM, switch_strftime_nocheck(), switch_time_exp_lt(), and SWITCH_UINT64_T_FMT.
Referenced by switch_event_create_subclass_detailed().
switch_status_t switch_event_rename_header | ( | switch_event_t * | event, |
const char * | header_name, | ||
const char * | new_header_name | ||
) |
Definition at line 796 of file switch_event.c.
References DUP, FREE, switch_event_header::hash, hash, switch_event::headers, switch_event_header::name, switch_event_header::next, switch_assert, switch_ci_hashfunc_default(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_event_reserve_subclass_detailed | ( | const char * | owner, |
const char * | subclass_name | ||
) |
Reserve a subclass name for private use with a custom event.
owner | the owner of the event name |
subclass_name | the name to reserve |
Definition at line 485 of file switch_event.c.
References switch_event_subclass::bind, CUSTOM_HASH_MUTEX, DUP, switch_event_subclass::name, switch_event_subclass::owner, RUNTIME_POOL, switch_assert, switch_core_hash_find(), switch_core_hash_insert, switch_goto_status, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, and switch_zmalloc.
Referenced by switch_event_bind_removable().
switch_xml_t switch_status_t switch_event_running | ( | void | ) |
Determine if the event system has been initialized.
Definition at line 425 of file switch_event.c.
References SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and SYSTEM_RUNNING.
Referenced by switch_console_printf(), and switch_log_meta_vprintf().
switch_status_t switch_event_serialize | ( | switch_event_t * | event, |
char ** | str, | ||
switch_bool_t | encode | ||
) |
Definition at line 1527 of file switch_event.c.
References switch_event_header::array, switch_event::body, buf, switch_event::headers, switch_event_header::idx, switch_event_header::name, switch_event_header::next, switch_safe_free, switch_snprintf(), SWITCH_STATUS_SUCCESS, switch_url_encode(), and switch_event_header::value.
Referenced by Event::serialize(), switch_core_session_thread(), and switch_ivr_originate().
switch_status_t switch_event_serialize_json | ( | switch_event_t * | event, |
char ** | str | ||
) |
Definition at line 1856 of file switch_event.c.
References switch_event_serialize_json_obj(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by Event::serialize().
switch_status_t switch_event_serialize_json_obj | ( | switch_event_t * | event, |
cJSON ** | json | ||
) |
Definition at line 1818 of file switch_event.c.
References switch_event_header::array, switch_event::body, switch_event::headers, switch_event_header::idx, switch_event_header::name, switch_event_header::next, switch_snprintf(), SWITCH_STATUS_SUCCESS, and switch_event_header::value.
Referenced by switch_event_serialize_json().
switch_status_t switch_status_t switch_event_set_body | ( | switch_event_t * | event, |
const char * | body | ||
) |
Definition at line 1255 of file switch_event.c.
References switch_event::body, DUP, switch_safe_free, and SWITCH_STATUS_SUCCESS.
Referenced by switch_event_base_add_header().
switch_status_t switch_event_set_priority | ( | switch_event_t * | event, |
switch_priority_t | priority | ||
) |
Set the priority of an event.
event | the event to set the priority on |
priority | the event priority |
Definition at line 789 of file switch_event.c.
References switch_event_add_header_string(), switch_priority_name(), SWITCH_STACK_TOP, and SWITCH_STATUS_SUCCESS.
Referenced by Event::setPriority().
switch_status_t switch_status_t switch_event_set_subclass_name | ( | switch_event_t * | event, |
const char * | subclass_name | ||
) |
Definition at line 1227 of file switch_event.c.
References DUP, switch_event::subclass_name, switch_event_add_header_string(), switch_event_del_header, switch_safe_free, SWITCH_STACK_BOTTOM, SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_event_shutdown | ( | void | ) |
Stop the eventing system.
Definition at line 549 of file switch_event.c.
References DISPATCH_THREAD_COUNT, event_channel_manager, EVENT_DISPATCH_QUEUE_THREADS, EVENT_QUEUE_MUTEX, switch_runtime::events_use_dispatch, FREE, MAX_DISPATCH, switch_event_subclass::name, switch_event_subclass::owner, runtime, SCF_MINIMAL, SWITCH_CHANNEL_LOG, switch_core_hash_destroy(), switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_core_memory_reclaim_events(), switch_core_test_flag(), switch_event_destroy(), SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_interrupt_all(), switch_queue_trypop(), switch_queue_trypush(), SWITCH_STATUS_SUCCESS, switch_thread_join(), switch_yield, SYSTEM_RUNNING, THREAD_COUNT, and unsub_all_switch_event_channel().
Referenced by switch_core_destroy().
switch_status_t switch_event_unbind | ( | switch_event_node_t ** | node | ) |
Unbind a bound event consumer.
node | node to unbind |
Definition at line 2175 of file switch_event.c.
References BLOCK, switch_event_node::event_id, FREE, switch_event_node::id, switch_event_node::next, RWLOCK, switch_event_node::subclass_name, SWITCH_CHANNEL_LOG, switch_event_name(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
Referenced by EventConsumer::cleanup(), and SWITCH_MODULE_SHUTDOWN_FUNCTION().
switch_status_t switch_event_unbind_callback | ( | switch_event_callback_t | callback | ) |
Definition at line 2134 of file switch_event.c.
References BLOCK, switch_event_node::callback, switch_event_node::event_id, FREE, switch_event_node::id, switch_event_node::next, RWLOCK, switch_event_node::subclass_name, SWITCH_CHANNEL_LOG, SWITCH_EVENT_ALL, switch_event_name(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
Referenced by switch_core_sqldb_stop().
switch_xml_t switch_event_xmlize | ( | switch_event_t * | event, |
const char * | fmt, | ||
... | |||
) |
Render a XML representation of an event suitable for printing or network transport.
event | the event to render |
fmt | optional body of the event (varargs see standard sprintf family) |
Referenced by Event::serialize().
void switch_json_add_presence_data_cols | ( | switch_event_t * | event, |
cJSON * | json, | ||
const char * | prefix | ||
) |
Definition at line 2664 of file switch_event.c.
References json_add_child_string(), switch_event_get_header, switch_safe_free, switch_snprintf(), and switch_split.
switch_status_t switch_live_array_add | ( | switch_live_array_t * | la, |
const char * | name, | ||
int | index, | ||
cJSON ** | obj, | ||
switch_bool_t | destroy | ||
) |
Definition at line 3629 of file switch_event.c.
References cJSON_GetObjectCstr(), switch_live_array_s::event_channel, switch_live_array_s::hash, switch_live_array_s::head, json_add_child_obj(), la_broadcast(), switch_live_array_s::mutex, la_node_s::name, switch_live_array_s::name, la_node_s::next, la_node_s::obj, la_node_s::pos, switch_live_array_s::pos, switch_live_array_s::serno, switch_core_hash_find(), switch_core_hash_insert, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, switch_zmalloc, and switch_live_array_s::tail.
switch_bool_t switch_live_array_add_alias | ( | switch_live_array_t * | la, |
const char * | event_channel, | ||
const char * | name | ||
) |
Definition at line 3459 of file switch_event.c.
References switch_live_array_s::aliases, alias_node_s::event_channel, event_channel_manager, alias_node_s::key, switch_live_array_s::mutex, alias_node_s::name, alias_node_s::next, switch_live_array_s::pool, switch_core_alloc, switch_core_hash_insert, switch_core_sprintf(), switch_core_strdup, SWITCH_FALSE, switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_TRUE.
switch_status_t switch_live_array_bootstrap | ( | switch_live_array_t * | la, |
const char * | sessid, | ||
switch_event_channel_id_t | channel_id | ||
) |
Definition at line 3312 of file switch_event.c.
References switch_live_array_s::event_channel, switch_live_array_s::head, json_add_child_array(), json_add_child_obj(), switch_live_array_s::mutex, la_node_s::name, switch_live_array_s::name, la_node_s::next, la_node_s::obj, switch_live_array_s::serno, switch_event_channel_broadcast(), SWITCH_FALSE, switch_live_array_visible(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_live_array_s::visible.
Referenced by switch_live_array_parse_json().
switch_status_t switch_live_array_clear | ( | switch_live_array_t * | la | ) |
Definition at line 3278 of file switch_event.c.
References cur, switch_live_array_s::event_channel, switch_live_array_s::head, json_add_child_obj(), la_broadcast(), switch_live_array_s::mutex, la_node_s::name, switch_live_array_s::name, la_node_s::next, la_node_s::obj, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, and switch_live_array_s::tail.
Referenced by switch_live_array_destroy().
switch_bool_t switch_live_array_clear_alias | ( | switch_live_array_t * | la, |
const char * | event_channel, | ||
const char * | name | ||
) |
Definition at line 3427 of file switch_event.c.
References switch_live_array_s::aliases, alias_node_s::event_channel, event_channel_manager, switch_live_array_s::mutex, alias_node_s::name, alias_node_s::next, switch_core_hash_delete(), SWITCH_FALSE, switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_TRUE.
switch_status_t switch_live_array_create | ( | const char * | event_channel, |
const char * | name, | ||
switch_event_channel_id_t | channel_id, | ||
switch_live_array_t ** | live_arrayP | ||
) |
Definition at line 3497 of file switch_event.c.
References switch_live_array_s::channel_id, switch_live_array_s::event_channel, event_channel_manager, switch_live_array_s::hash, key, switch_live_array_s::key, switch_live_array_s::mutex, switch_live_array_s::name, switch_live_array_s::new, pool, switch_live_array_s::pool, switch_live_array_s::refs, switch_live_array_s::serno, switch_core_alloc, switch_core_hash_find(), switch_core_hash_init, switch_core_hash_insert, switch_core_new_memory_pool, switch_core_sprintf(), switch_core_strdup, SWITCH_FALSE, switch_mutex_init(), switch_mutex_lock(), SWITCH_MUTEX_NESTED, switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_live_array_s::visible.
Referenced by switch_live_array_parse_json().
switch_status_t switch_live_array_del | ( | switch_live_array_t * | la, |
const char * | name | ||
) |
Definition at line 3581 of file switch_event.c.
References cur, switch_live_array_s::event_channel, switch_live_array_s::hash, switch_live_array_s::head, json_add_child_obj(), la_broadcast(), switch_live_array_s::mutex, la_node_s::name, switch_live_array_s::name, la_node_s::next, la_node_s::obj, la_node_s::pos, switch_live_array_s::pos, switch_live_array_s::serno, switch_core_hash_delete(), switch_core_hash_find(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and switch_live_array_s::tail.
switch_status_t switch_live_array_destroy | ( | switch_live_array_t ** | live_arrayP | ) |
Definition at line 3384 of file switch_event.c.
References switch_live_array_s::aliases, event_channel_manager, switch_live_array_s::hash, alias_node_s::key, switch_live_array_s::key, switch_live_array_s::mutex, alias_node_s::next, pool, switch_live_array_s::pool, switch_live_array_s::refs, switch_core_destroy_memory_pool, switch_core_hash_delete(), switch_core_hash_destroy(), switch_live_array_clear(), switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_live_array_parse_json().
cJSON* switch_live_array_get | ( | switch_live_array_t * | la, |
const char * | name | ||
) |
Definition at line 3540 of file switch_event.c.
References switch_live_array_s::hash, switch_live_array_s::mutex, la_node_s::obj, switch_core_hash_find(), switch_mutex_lock(), and switch_mutex_unlock().
cJSON* switch_live_array_get_idx | ( | switch_live_array_t * | la, |
int | idx | ||
) |
Definition at line 3554 of file switch_event.c.
References switch_live_array_s::head, switch_live_array_s::mutex, la_node_s::next, la_node_s::obj, la_node_s::pos, switch_mutex_lock(), and switch_mutex_unlock().
switch_bool_t switch_live_array_isnew | ( | switch_live_array_t * | la | ) |
void switch_live_array_lock | ( | switch_live_array_t * | la | ) |
Definition at line 3571 of file switch_event.c.
References switch_live_array_s::mutex, and switch_mutex_lock().
void switch_live_array_parse_json | ( | cJSON * | json, |
switch_event_channel_id_t | channel_id | ||
) |
Definition at line 3738 of file switch_event.c.
References cJSON_GetObjectCstr(), switch_live_array_s::command_handler, name, switch_live_array_bootstrap(), switch_live_array_create(), switch_live_array_destroy(), SWITCH_STATUS_SUCCESS, and switch_live_array_s::user_data.
void switch_live_array_set_command_handler | ( | switch_live_array_t * | la, |
switch_live_array_command_handler_t | command_handler | ||
) |
Definition at line 3731 of file switch_event.c.
References switch_live_array_s::command_handler, and switch_assert.
void switch_live_array_set_user_data | ( | switch_live_array_t * | la, |
void * | user_data | ||
) |
Definition at line 3725 of file switch_event.c.
References switch_assert, switch_event_node::user_data, and switch_live_array_s::user_data.
void switch_live_array_unlock | ( | switch_live_array_t * | la | ) |
Definition at line 3576 of file switch_event.c.
References switch_live_array_s::mutex, and switch_mutex_unlock().
switch_status_t switch_live_array_visible | ( | switch_live_array_t * | la, |
switch_bool_t | visible, | ||
switch_bool_t | force | ||
) |
Definition at line 3254 of file switch_event.c.
References switch_live_array_s::event_channel, json_add_child_obj(), la_broadcast(), switch_live_array_s::mutex, switch_live_array_s::serno, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and switch_live_array_s::visible.
Referenced by switch_live_array_bootstrap().
switch_status_t switch_name_event | ( | const char * | name, |
switch_event_types_t * | type | ||
) |
return the event id that matches a given event name
name | the name of the event |
type | the event id to return |
Definition at line 438 of file switch_event.c.
References BLOCK, EVENT_NAMES, RUNTIME_POOL, switch_assert, SWITCH_EVENT_ALL, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by EventConsumer::bind(), Event::Event(), and switch_event_create_json().