FreeSWITCH API Documentation
1.7.0
|
Go to the source code of this file.
Data Structures | |
struct | switch_event_node |
A node to store binded events. More... | |
struct | switch_event_subclass |
A registered custom event subclass. More... | |
struct | switch_event_channel_sub_node_s |
struct | switch_event_channel_sub_node_head_s |
struct | event_channel_data_t |
struct | alias_node_s |
struct | la_node_s |
struct | switch_live_array_s |
Macros | |
#define | DISPATCH_QUEUE_LEN 10000 |
#define | MAX_DISPATCH_VAL 64 |
#define | ALLOC(size) malloc(size) |
#define | DUP(str) my_dup(str) |
#define | FREE(ptr) switch_safe_free(ptr) |
#define | SWITCH_SERIALIZED_EVENT_MAP "S(iiisss)A(S(ss))" |
#define | resize(l) |
Typedefs | |
typedef struct switch_event_channel_sub_node_s | switch_event_channel_sub_node_t |
typedef struct switch_event_channel_sub_node_head_s | switch_event_channel_sub_node_head_t |
typedef struct alias_node_s | alias_node_t |
typedef struct la_node_s | la_node_t |
#define ALLOC | ( | size | ) | malloc(size) |
Definition at line 120 of file switch_event.c.
Referenced by new_header(), and switch_event_create_subclass_detailed().
#define DISPATCH_QUEUE_LEN 10000 |
Definition at line 42 of file switch_event.c.
Referenced by check_dispatch(), switch_event_channel_broadcast(), and switch_event_queue_dispatch_event().
#define DUP | ( | str | ) | my_dup(str) |
Definition at line 123 of file switch_event.c.
Referenced by new_header(), switch_event_add_header_string(), switch_event_base_add_header(), switch_event_bind_removable(), switch_event_create_subclass_detailed(), switch_event_dup(), switch_event_rename_header(), switch_event_reserve_subclass_detailed(), switch_event_set_body(), and switch_event_set_subclass_name().
#define FREE | ( | ptr | ) | switch_safe_free(ptr) |
Definition at line 126 of file switch_event.c.
Referenced by switch_event_base_add_header(), switch_event_del_header_val(), switch_event_destroy(), switch_event_free_subclass_detailed(), switch_event_rename_header(), switch_event_shutdown(), switch_event_unbind(), and switch_event_unbind_callback().
#define MAX_DISPATCH_VAL 64 |
Definition at line 80 of file switch_event.c.
Referenced by switch_event_dispatch_thread().
#define resize | ( | l | ) |
Definition at line 2185 of file switch_event.c.
Referenced by switch_event_expand_headers_check().
#define SWITCH_SERIALIZED_EVENT_MAP "S(iiisss)A(S(ss))" |
Definition at line 1396 of file switch_event.c.
Referenced by switch_event_binary_deserialize(), and switch_event_binary_serialize().
typedef struct alias_node_s alias_node_t |
typedef struct switch_event_channel_sub_node_s switch_event_channel_sub_node_t |
|
static |
Definition at line 2841 of file switch_event.c.
References event_channel_manager, switch_event_channel_sub_node_s::func, switch_event_channel_sub_node_s::id, switch_event_channel_sub_node_s::next, switch_event_channel_sub_node_head_s::node, switch_core_hash_find(), switch_thread_rwlock_rdlock(), and switch_thread_rwlock_unlock().
Referenced by ecd_deliver().
|
static |
Definition at line 1833 of file switch_event.c.
References memset(), switch_assert, switch_url_encode(), switch_xml_add_child_d, and switch_xml_set_txt_d.
Referenced by switch_event_xmlize().
|
static |
Definition at line 604 of file switch_event.c.
References BLOCK, DISPATCH_QUEUE_LEN, EVENT_DISPATCH_QUEUE, MAX_DISPATCH, switch_cond_next(), switch_event_launch_dispatch_threads(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_create(), THREAD_COUNT, and THRUNTIME_POOL.
Referenced by switch_event_fire_detailed(), switch_event_init(), and switch_event_launch_dispatch_threads().
|
static |
Definition at line 2864 of file switch_event.c.
References cJSON_Delete(), event_channel_data_t::event_channel, event_channel_data_t::json, event_channel_data_t::key, and switch_safe_free.
Referenced by ecd_deliver(), switch_event_channel_broadcast(), and switch_event_channel_deliver_thread().
|
static |
Definition at line 2879 of file switch_event.c.
References _switch_event_channel_broadcast(), destroy_ecd(), event_channel_data_t::event_channel, event_channel_data_t::id, event_channel_data_t::json, event_channel_data_t::key, and SWITCH_EVENT_CHANNEL_GLOBAL.
Referenced by switch_event_channel_deliver_thread().
|
static |
Definition at line 3107 of file switch_event.c.
References switch_live_array_s::aliases, switch_live_array_s::channel_id, cJSON_CreateString(), cJSON_Duplicate(), cJSON_GetObjectItem(), cJSON_ReplaceItemInObject(), alias_node_s::event_channel, switch_live_array_s::event_channel, switch_live_array_s::mutex, alias_node_s::name, alias_node_s::next, switch_event_channel_broadcast(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_live_array_add(), switch_live_array_clear(), switch_live_array_del(), and switch_live_array_visible().
|
static |
|
static |
Definition at line 899 of file switch_event.c.
References ALLOC, DUP, memset(), switch_event_header::name, switch_assert, switch_queue_trypop(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_event_base_add_header().
switch_status_t switch_event_add_body | ( | switch_event_t * | event, |
const char * | fmt, | ||
... | |||
) |
Definition at line 1208 of file switch_event.c.
References switch_safe_free, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, and switch_vasprintf().
Referenced by switch_event_create_json().
switch_status_t switch_event_add_header | ( | switch_event_t * | event, |
switch_stack_t | stack, | ||
const char * | header_name, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 1160 of file switch_event.c.
References switch_event_base_add_header(), SWITCH_STATUS_MEMERR, and switch_vasprintf().
Referenced by switch_event_create_pres_in_detailed(), and switch_event_prep_for_delivery_detailed().
|
static |
Definition at line 968 of file switch_event.c.
References switch_event_header::array, DUP, EF_UNIQ_HEADERS, FREE, switch_event_header::hash, switch_event_header::idx, switch_event::last_header, switch_event_header::name, new_header(), switch_event_header::next, switch_assert, switch_ci_hashfunc_default(), switch_event_add_array(), switch_event_del_header, switch_event_get_header_ptr(), switch_event_set_body(), switch_safe_free, switch_snprintf(), SWITCH_STACK_BOTTOM, SWITCH_STACK_PUSH, SWITCH_STACK_TOP, SWITCH_STACK_UNSHIFT, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_event_header::value, and zstr.
Referenced by switch_event_add_header(), and switch_event_add_header_string().
|
static |
Definition at line 2900 of file switch_event.c.
References destroy_ecd(), ecd_deliver(), EVENT_CHANNEL_DISPATCH_THREAD_COUNT, EVENT_CHANNEL_DISPATCH_THREAD_STARTING, EVENT_QUEUE_MUTEX, SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_os_yield(), switch_queue_pop(), switch_queue_trypop(), SWITCH_STATUS_SUCCESS, SYSTEM_RUNNING, and THREAD_COUNT.
Referenced by switch_event_channel_broadcast().
|
static |
Definition at line 2776 of file switch_event.c.
References switch_event_channel_sub_node_head_s::event_channel, event_channel_manager, switch_event_channel_sub_node_s::func, switch_event_channel_sub_node_s::head, switch_event_channel_sub_node_s::id, switch_event_channel_sub_node_s::next, switch_event_channel_sub_node_head_s::node, switch_core_hash_find(), switch_core_hash_insert, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_unlock(), switch_thread_rwlock_wrlock(), switch_zmalloc, and switch_event_channel_sub_node_head_s::tail.
Referenced by switch_event_channel_bind().
|
static |
Definition at line 2745 of file switch_event.c.
References event_channel_manager, switch_core_hash_find(), switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_event_channel_unsub_head(), switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
Referenced by switch_event_channel_unbind().
|
static |
Definition at line 2679 of file switch_event.c.
References switch_event_channel_sub_node_head_s::event_channel, switch_event_channel_sub_node_s::func, switch_event_channel_sub_node_s::head, switch_event_channel_sub_node_s::next, switch_event_channel_sub_node_head_s::node, SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, switch_log_printf(), and switch_event_channel_sub_node_head_s::tail.
Referenced by switch_event_channel_unsub_channel(), and unsub_all_switch_event_channel().
switch_status_t switch_event_create_pres_in_detailed | ( | char * | file, |
char * | func, | ||
int | line, | ||
const char * | proto, | ||
const char * | login, | ||
const char * | from, | ||
const char * | from_domain, | ||
const char * | status, | ||
const char * | event_type, | ||
const char * | alt_event_type, | ||
int | event_count, | ||
const char * | unique_id, | ||
const char * | channel_state, | ||
const char * | answer_state, | ||
const char * | call_direction | ||
) |
Definition at line 2157 of file switch_event.c.
References switch_event_add_header(), switch_event_add_header_string(), switch_event_create_subclass, switch_event_fire_detailed(), SWITCH_EVENT_PRESENCE_IN, SWITCH_EVENT_SUBCLASS_ANY, SWITCH_STACK_TOP, SWITCH_STATUS_MEMERR, and SWITCH_STATUS_SUCCESS.
|
static |
Definition at line 264 of file switch_event.c.
References switch_event_deliver().
Referenced by switch_event_deliver_thread_pool().
|
static |
Definition at line 273 of file switch_event.c.
References switch_thread_data_s::alloc, switch_thread_data_s::func, switch_thread_data_s::obj, switch_thread_data_s::pool, switch_assert, switch_event_deliver_thread(), and switch_thread_pool_launch_thread().
Referenced by switch_event_fire_detailed().
|
static |
Definition at line 291 of file switch_event.c.
References DISPATCH_THREAD_COUNT, EVENT_DISPATCH_QUEUE_RUNNING, EVENT_DISPATCH_QUEUE_THREADS, EVENT_QUEUE_MUTEX, MAX_DISPATCH_VAL, SWITCH_CHANNEL_LOG, switch_event_deliver(), SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_os_yield(), switch_queue_pop(), SWITCH_STATUS_SUCCESS, SYSTEM_RUNNING, and THREAD_COUNT.
Referenced by switch_event_launch_dispatch_threads().
|
static |
Definition at line 350 of file switch_event.c.
References DISPATCH_QUEUE_LEN, DISPATCH_THREAD_COUNT, EVENT_DISPATCH_QUEUE, EVENT_QUEUE_MUTEX, MAX_DISPATCH, PENDING, SOFT_MAX_DISPATCH, switch_event_launch_dispatch_threads(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_push(), switch_queue_size(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and SYSTEM_RUNNING.
Referenced by switch_event_fire_detailed().
switch_xml_t switch_event_xmlize | ( | switch_event_t * | event, |
const char * | fmt, | ||
... | |||
) |
Definition at line 1852 of file switch_event.c.
References add_xml_header(), switch_event_header::array, switch_event_header::idx, switch_event_header::name, switch_event_header::next, switch_snprintf(), switch_xml_add_child_d, switch_xml_new(), switch_xml_set_txt_d, switch_event_header::value, and zstr.
|
static |
Definition at line 225 of file switch_event.c.
References switch_event_node::event_id, switch_event::event_id, switch_event_node::subclass_name, switch_event::subclass_name, SWITCH_EVENT_ALL, and switch_event_get_header.
Referenced by switch_event_deliver().
|
static |
Definition at line 2716 of file switch_event.c.
References switch_event_channel_sub_node_head_s::event_channel, event_channel_manager, switch_core_hash_delete(), switch_core_hash_first_iter(), switch_core_hash_this(), switch_event_channel_unsub_head(), switch_event_destroy(), switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
Referenced by switch_event_shutdown().
|
static |
Definition at line 87 of file switch_event.c.
Referenced by check_dispatch(), switch_event_bind_removable(), switch_event_fire_detailed(), switch_event_init(), switch_event_name(), switch_event_unbind(), switch_event_unbind_callback(), and switch_name_event().
|
static |
Definition at line 96 of file switch_event.c.
|
static |
Definition at line 98 of file switch_event.c.
Referenced by switch_event_dispatch_thread(), switch_event_queue_dispatch_event(), and switch_event_shutdown().
|
static |
Definition at line 94 of file switch_event.c.
Referenced by switch_event_channel_broadcast(), and switch_event_shutdown().
|
static |
Definition at line 99 of file switch_event.c.
Referenced by switch_event_channel_broadcast(), and switch_event_channel_deliver_thread().
|
static |
Definition at line 100 of file switch_event.c.
Referenced by switch_event_channel_broadcast(), and switch_event_channel_deliver_thread().
struct { ... } event_channel_manager |
Referenced by _switch_event_channel_broadcast(), switch_event_channel_bind(), switch_event_channel_permission_clear(), switch_event_channel_permission_modify(), switch_event_channel_permission_verify(), switch_event_channel_sub_channel(), switch_event_channel_unsub_channel(), switch_event_init(), switch_event_shutdown(), switch_live_array_add_alias(), switch_live_array_clear_alias(), switch_live_array_create(), switch_live_array_destroy(), and unsub_all_switch_event_channel().
|
static |
Definition at line 93 of file switch_event.c.
Referenced by check_dispatch(), switch_event_launch_dispatch_threads(), switch_event_queue_dispatch_event(), and switch_event_shutdown().
|
static |
Definition at line 92 of file switch_event.c.
Referenced by switch_event_dispatch_thread(), and switch_event_launch_dispatch_threads().
|
static |
Definition at line 91 of file switch_event.c.
Referenced by switch_event_dispatch_thread(), switch_event_launch_dispatch_threads(), and switch_event_shutdown().
|
static |
Definition at line 132 of file switch_event.c.
Referenced by switch_event_name(), and switch_name_event().
|
static |
Definition at line 85 of file switch_event.c.
|
static |
Definition at line 95 of file switch_event.c.
Referenced by switch_event_channel_broadcast(), switch_event_channel_deliver_thread(), switch_event_dispatch_thread(), switch_event_fire_detailed(), switch_event_init(), switch_event_prep_for_delivery_detailed(), switch_event_queue_dispatch_event(), and switch_event_shutdown().
|
static |
Definition at line 102 of file switch_event.c.
Referenced by switch_event_prep_for_delivery_detailed().
|
static |
Definition at line 83 of file switch_event.c.
Referenced by switch_event_init(), and switch_event_prep_for_delivery_detailed().
|
static |
Definition at line 84 of file switch_event.c.
Referenced by switch_event_init(), and switch_event_prep_for_delivery_detailed().
switch_hash_t* hash |
Definition at line 74 of file switch_event.c.
Referenced by get_handle(), switch_ci_hashfunc_default(), switch_event_del_header_val(), switch_event_get_header_ptr(), switch_event_rename_header(), switch_hash_default(), switch_hash_default_ci(), switch_hashtable_insert_destructor(), switch_hashtable_remove(), switch_hashtable_search(), and switch_scheduler_del_task_group().
Definition at line 72 of file switch_event.c.
switch_hash_t* lahash |
Definition at line 76 of file switch_event.c.
switch_mutex_t* lamutex |
Definition at line 77 of file switch_event.c.
|
static |
Definition at line 81 of file switch_event.c.
Referenced by check_dispatch(), switch_event_channel_broadcast(), switch_event_init(), switch_event_launch_dispatch_threads(), and switch_event_queue_dispatch_event().
|
static |
Definition at line 348 of file switch_event.c.
Referenced by switch_event_queue_dispatch_event().
switch_hash_t* perm_hash |
Definition at line 75 of file switch_event.c.
|
static |
Definition at line 88 of file switch_event.c.
Referenced by switch_event_init().
|
static |
Definition at line 89 of file switch_event.c.
Referenced by switch_event_bind_removable(), switch_event_fire_detailed(), switch_event_free_subclass_detailed(), switch_event_init(), switch_event_launch_dispatch_threads(), switch_event_name(), switch_event_reserve_subclass_detailed(), and switch_name_event().
switch_thread_rwlock_t* rwlock |
Definition at line 73 of file switch_event.c.
|
static |
Definition at line 86 of file switch_event.c.
Referenced by switch_event_bind_removable(), switch_event_deliver(), switch_event_free_subclass_detailed(), switch_event_init(), switch_event_unbind(), and switch_event_unbind_callback().
|
static |
Definition at line 82 of file switch_event.c.
Referenced by switch_event_launch_dispatch_threads(), and switch_event_queue_dispatch_event().
|
static |
Definition at line 101 of file switch_event.c.
Referenced by switch_event_channel_broadcast(), switch_event_channel_deliver_thread(), switch_event_deliver(), switch_event_dispatch_thread(), switch_event_fire_detailed(), switch_event_init(), switch_event_queue_dispatch_event(), switch_event_running(), and switch_event_shutdown().
|
static |
Definition at line 97 of file switch_event.c.
Referenced by check_dispatch(), switch_event_channel_deliver_thread(), switch_event_dispatch_thread(), and switch_event_shutdown().
|
static |
Definition at line 90 of file switch_event.c.
Referenced by check_dispatch(), switch_event_channel_broadcast(), and switch_event_init().