Asterisk - The Open Source Telephony Project
18.5.0
|
Private Bridging API. More...
Go to the source code of this file.
Functions | |
struct ast_bridge * | bridge_alloc (size_t size, const struct ast_bridge_methods *v_table) |
struct ast_bridge * | bridge_base_init (struct ast_bridge *self, uint32_t capabilities, unsigned int flags, const char *creator, const char *name, const char *id) |
Initialize the base class of the bridge. More... | |
void | bridge_dissolve (struct ast_bridge *bridge, int cause) |
void | bridge_do_merge (struct ast_bridge *dst_bridge, struct ast_bridge *src_bridge, struct ast_bridge_channel **kick_me, unsigned int num_kick, unsigned int optimized) |
int | bridge_do_move (struct ast_bridge *dst_bridge, struct ast_bridge_channel *bridge_channel, int attempt_recovery, unsigned int optimized) |
struct ast_bridge_channel * | bridge_find_channel (struct ast_bridge *bridge, struct ast_channel *chan) |
void | bridge_merge_inhibit_nolock (struct ast_bridge *bridge, int request) |
void | bridge_reconfigured (struct ast_bridge *bridge, unsigned int colp_update) |
struct ast_bridge * | bridge_register (struct ast_bridge *bridge) |
Register the new bridge with the system. More... | |
Private Bridging API.
Functions in this file are intended to be used by the Bridging API, bridge mixing technologies, and bridge sub-classes. Users of bridges that do not fit those three categories should not use the API defined in this file.
See Also:
Definition in file bridge_internal.h.
struct ast_bridge* bridge_alloc | ( | size_t | size, |
const struct ast_bridge_methods * | v_table | ||
) |
Definition at line 724 of file bridge.c.
References ao2_alloc, ao2_cleanup, ast_assert, ast_log, AST_MEDIA_TYPE_END, ast_string_field_init, AST_VECTOR_INIT, bridge_manager_request::bridge, ast_bridge_methods::destroy, destroy_bridge(), ast_bridge_methods::dissolving, ast_bridge_methods::get_merge_priority, LOG_ERROR, ast_bridge::media_types, ast_bridge_methods::name, ast_bridge_methods::notify_masquerade, NULL, ast_bridge_methods::pull, ast_bridge_methods::push, and ast_bridge::v_table.
Referenced by ast_bridge_base_new(), ast_bridge_basic_new(), bridge_agent_hold_new(), bridge_parking_new(), and bridge_stasis_new().
struct ast_bridge* bridge_base_init | ( | struct ast_bridge * | self, |
uint32_t | capabilities, | ||
unsigned int | flags, | ||
const char * | creator, | ||
const char * | name, | ||
const char * | id | ||
) |
Initialize the base class of the bridge.
self | Bridge to operate upon. (Tolerates a NULL pointer) |
capabilities | The capabilities that we require to be used on the bridge |
flags | Flags that will alter the behavior of the bridge |
creator | Entity that created the bridge (optional) |
name | Name given to the bridge by its creator (optional, requires named creator) |
id | Unique ID given to the bridge by its creator (optional) |
self | on success |
NULL | on failure, self is already destroyed |
Example usage:
This creates a no frills two party bridge that will be destroyed once one of the channels hangs up.
Definition at line 760 of file bridge.c.
References ao2_ref, AST_BRIDGE_FLAG_INVISIBLE, ast_bridge_topic(), ast_debug, ast_log, ast_set_flag, ast_string_field_set, ast_strlen_zero, ast_tvnow(), ast_uuid_generate_str(), AST_UUID_STR_LEN, bridge_topics_init(), find_best_technology(), LOG_WARNING, NULL, and ast_bridge::uniqueid.
Referenced by ast_bridge_base_new(), ast_bridge_basic_new(), bridge_agent_hold_new(), bridge_parking_new(), and bridge_stasis_new().
void bridge_dissolve | ( | struct ast_bridge * | bridge, |
int | cause | ||
) |
Definition at line 319 of file bridge.c.
References ast_bridge_channel_leave_bridge(), ast_bridge_queue_action(), ast_cause2str(), AST_CAUSE_NORMAL_CLEARING, ast_debug, AST_FRAME_BRIDGE_ACTION, AST_LIST_TRAVERSE, BRIDGE_CHANNEL_ACTION_DEFERRED_DISSOLVING, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, ast_bridge::cause, ast_bridge::channels, ast_bridge::dissolved, ast_frame::frametype, and ast_bridge::uniqueid.
Referenced by ast_bridge_destroy(), bridge_channel_dissolve_check(), bridge_dissolve_check_stolen(), and bridge_reconfigured().
void bridge_do_merge | ( | struct ast_bridge * | dst_bridge, |
struct ast_bridge * | src_bridge, | ||
struct ast_bridge_channel ** | kick_me, | ||
unsigned int | num_kick, | ||
unsigned int | optimized | ||
) |
Definition at line 2096 of file bridge.c.
References AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE, ast_bridge_channel_leave_bridge(), ast_bridge_channel_leave_bridge_nolock(), ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_bridge_features_remove(), AST_BRIDGE_HOOK_REMOVE_ON_PULL, ast_bridge_publish_merge(), AST_CAUSE_NORMAL_CLEARING, ast_debug, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_test_flag, ast_bridge_channel::bridge, bridge_channel_change_bridge(), bridge_channel_internal_pull(), bridge_channel_internal_push(), bridge_channel_moving(), BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, BRIDGE_CHANNEL_STATE_WAIT, bridge_reconfigured(), ast_bridge::cause, ast_bridge::channels, ast_bridge_features::feature_flags, ast_bridge_channel::features, ast_bridge_channel::state, and ast_bridge::uniqueid.
Referenced by bridge_merge(), bridge_merge_locked(), try_merge_optimize_out(), and two_bridge_attended_transfer().
int bridge_do_move | ( | struct ast_bridge * | dst_bridge, |
struct ast_bridge_channel * | bridge_channel, | ||
int | attempt_recovery, | ||
unsigned int | optimized | ||
) |
Definition at line 2362 of file bridge.c.
References ao2_ref, ast_bridge_channel_leave_bridge(), ast_bridge_features_remove(), AST_BRIDGE_HOOK_REMOVE_ON_PULL, ast_channel_name(), ast_debug, ast_bridge_channel::bridge, bridge_channel_change_bridge(), bridge_channel_internal_pull(), bridge_channel_internal_push(), bridge_channel_internal_push_full(), bridge_channel_moving(), bridge_channel_settle_owed_events(), BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, BRIDGE_CHANNEL_STATE_WAIT, bridge_reconfigured(), ast_bridge::cause, ast_bridge_channel::chan, ast_bridge_channel::features, ast_bridge_channel::in_bridge, NULL, ast_bridge_channel::state, ast_bridge_channel::swap, and ast_bridge::uniqueid.
Referenced by bridge_move(), bridge_move_locked(), bridge_swap_attended_transfer(), and try_swap_optimize_out().
struct ast_bridge_channel* bridge_find_channel | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Definition at line 1469 of file bridge.c.
References AST_LIST_TRAVERSE, ast_bridge_channel::chan, and ast_bridge::channels.
Referenced by ast_bridge_add_channel(), ast_bridge_join(), ast_bridge_kick(), ast_bridge_notify_masquerade(), ast_bridge_remove(), ast_bridge_suspend(), ast_bridge_unsuspend(), bridge_channel_internal_push_full(), bridge_impart_internal(), bridge_merge(), bridge_merge_locked(), bridge_move_locked(), and play_uri().
void bridge_merge_inhibit_nolock | ( | struct ast_bridge * | bridge, |
int | request | ||
) |
Definition at line 3052 of file bridge.c.
References ast_assert, ast_bridge::inhibit_merge, and request().
Referenced by ast_bridge_channel_merge_inhibit(), and ast_bridge_merge_inhibit().
void bridge_reconfigured | ( | struct ast_bridge * | bridge, |
unsigned int | colp_update | ||
) |
Definition at line 1443 of file bridge.c.
References AST_BRIDGE_FLAG_SMART, ast_bridge_publish_state(), ast_test_flag, bridge_complete_join(), bridge_dissolve(), bridge_reconfigured_connected_line_update(), check_bridge_play_sounds(), ast_bridge::dissolved, ast_bridge::feature_flags, ast_bridge::reconfigured, set_bridge_peer_vars(), and smart_bridge_operation().
Referenced by ast_bridge_notify_masquerade(), bridge_channel_handle_control(), bridge_channel_internal_join(), bridge_channel_wait(), bridge_do_merge(), and bridge_do_move().
struct ast_bridge* bridge_register | ( | struct ast_bridge * | bridge | ) |
Register the new bridge with the system.
bridge | What to register. (Tolerates a NULL pointer) |
bridge | on success. |
NULL | on error. |
Definition at line 709 of file bridge.c.
References ao2_link, ast_bridge_destroy(), ast_bridge_lock, ast_bridge_publish_state(), ast_bridge_unlock, bridge_manager_request::bridge, ast_bridge::construction_completed, and NULL.
Referenced by ast_bridge_base_new(), ast_bridge_basic_new(), bridge_agent_hold_new(), bridge_parking_new(), and bridge_stasis_new().