Asterisk - The Open Source Telephony Project
18.5.0
|
Bridging API. More...
#include "asterisk/bridge_features.h"
#include "asterisk/bridge_channel.h"
#include "asterisk/bridge_roles.h"
#include "asterisk/dsp.h"
#include "asterisk/uuid.h"
Go to the source code of this file.
Data Structures | |
struct | ast_bridge |
Structure that contains information about a bridge. More... | |
struct | ast_bridge_channels_list |
struct | ast_bridge_methods |
Bridge virtual methods table definition. More... | |
struct | ast_bridge_snapshot |
Structure that contains a snapshot of information about a bridge. More... | |
struct | ast_bridge_softmix |
struct | ast_bridge_video_mode |
Data structure that defines a video source mode. More... | |
struct | ast_bridge_video_sfu_data |
This is used for selective forwarding unit configuration. More... | |
struct | ast_bridge_video_single_src_data |
This is used for both SINGLE_SRC mode to set what channel should be the current single video feed. More... | |
struct | ast_bridge_video_talker_src_data |
This is used for both SINGLE_SRC_TALKER mode to set what channel should be the current single video feed. More... | |
struct | transfer_channel_data |
AO2 object that wraps data for transfer_channel_cb. More... | |
Macros | |
#define | ast_bridge_lock(bridge) _ast_bridge_lock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge) |
Lock the bridge. More... | |
#define | ast_bridge_lock_both(bridge1, bridge2) |
Lock two bridges. More... | |
#define | ast_bridge_trylock(bridge) _ast_bridge_trylock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge) |
Try locking the bridge. More... | |
#define | ast_bridge_unlock(bridge) _ast_bridge_unlock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge) |
Unlock the bridge. More... | |
Typedefs | |
typedef void(* | ast_bridge_destructor_fn) (struct ast_bridge *self) |
Destroy the bridge. More... | |
typedef void(* | ast_bridge_dissolving_fn) (struct ast_bridge *self) |
The bridge is being dissolved. More... | |
typedef int(* | ast_bridge_merge_priority_fn) (struct ast_bridge *self) |
Get the merge priority of this bridge. More... | |
typedef void(* | ast_bridge_notify_masquerade_fn) (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel) |
Notify the bridge that this channel was just masqueraded. More... | |
typedef void(* | ast_bridge_pull_channel_fn) (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel) |
Pull this channel from the bridge. More... | |
typedef int(* | ast_bridge_push_channel_fn) (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap) |
Push this channel into the bridge. More... | |
typedef void(* | transfer_channel_cb) (struct ast_channel *chan, struct transfer_channel_data *user_data, enum ast_transfer_type transfer_type) |
Callback function type called during blind transfers. More... | |
Functions | |
static void | _ast_bridge_lock (struct ast_bridge *bridge, const char *file, const char *function, int line, const char *var) |
static int | _ast_bridge_trylock (struct ast_bridge *bridge, const char *file, const char *function, int line, const char *var) |
static void | _ast_bridge_unlock (struct ast_bridge *bridge, const char *file, const char *function, int line, const char *var) |
struct ast_bridge * | ast_bridge_base_new (uint32_t capabilities, unsigned int flags, const char *creator, const char *name, const char *id) |
Create a new base class bridge. More... | |
int | ast_bridge_depart (struct ast_channel *chan) |
Depart a channel from a bridge. More... | |
int | ast_bridge_destroy (struct ast_bridge *bridge, int cause) |
Destroy a bridge. More... | |
void | ast_bridge_features_remove (struct ast_bridge_features *features, enum ast_bridge_hook_remove_flags flags) |
Remove marked bridge channel feature hooks. More... | |
struct ast_bridge * | ast_bridge_find_by_id (const char *bridge_id) |
Find bridge by id. More... | |
int | ast_bridge_impart (struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, enum ast_bridge_impart_flags flags) attribute_warn_unused_result |
Impart a channel to a bridge (non-blocking) More... | |
int | ast_bridge_is_video_src (struct ast_bridge *bridge, struct ast_channel *chan) |
Determine if a channel is a video src for the bridge. More... | |
int | ast_bridge_join (struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, struct ast_bridge_tech_optimizations *tech_args, enum ast_bridge_join_flags flags) |
Join a channel to a bridge (blocking) More... | |
int | ast_bridge_kick (struct ast_bridge *bridge, struct ast_channel *chan) |
Kick a channel from a bridge. More... | |
int | ast_bridge_merge (struct ast_bridge *dst_bridge, struct ast_bridge *src_bridge, int merge_best_direction, struct ast_channel **kick_me, unsigned int num_kick) |
Merge two bridges together. More... | |
void | ast_bridge_merge_inhibit (struct ast_bridge *bridge, int request) |
Adjust the bridge merge inhibit request count. More... | |
int | ast_bridge_move (struct ast_bridge *dst_bridge, struct ast_bridge *src_bridge, struct ast_channel *chan, struct ast_channel *swap, int attempt_recovery) |
Move a channel from one bridge to another. More... | |
void | ast_bridge_notify_masquerade (struct ast_channel *chan) |
Notify bridging that this channel was just masqueraded. More... | |
int | ast_bridge_number_video_src (struct ast_bridge *bridge) |
Returns the number of video sources currently active in the bridge. More... | |
struct ast_channel * | ast_bridge_peer (struct ast_bridge *bridge, struct ast_channel *chan) |
Get the channel's bridge peer only if the bridge is two-party. More... | |
struct ast_channel * | ast_bridge_peer_nolock (struct ast_bridge *bridge, struct ast_channel *chan) |
Get the channel's bridge peer only if the bridge is two-party. More... | |
struct ao2_container * | ast_bridge_peers (struct ast_bridge *bridge) |
Get a container of all channels in the bridge. More... | |
struct ao2_container * | ast_bridge_peers_nolock (struct ast_bridge *bridge) |
Get a container of all channels in the bridge. More... | |
int | ast_bridge_queue_action (struct ast_bridge *bridge, struct ast_frame *action) |
Put an action onto the specified bridge. More... | |
int | ast_bridge_queue_everyone_else (struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame) |
Queue the given frame to everyone else. More... | |
int | ast_bridge_remove (struct ast_bridge *bridge, struct ast_channel *chan) |
Remove a channel from a bridge. More... | |
void | ast_bridge_remove_video_src (struct ast_bridge *bridge, struct ast_channel *chan) |
remove a channel as a source of video for the bridge. More... | |
void | ast_bridge_set_binaural_active (struct ast_bridge *bridge, unsigned int binaural_active) |
Activates the use of binaural signals in a conference bridge. More... | |
void | ast_bridge_set_internal_sample_rate (struct ast_bridge *bridge, unsigned int sample_rate) |
Adjust the internal mixing sample rate of a bridge used during multimix mode. More... | |
void | ast_bridge_set_maximum_sample_rate (struct ast_bridge *bridge, unsigned int sample_rate) |
Adjust the maximum mixing sample rate of a bridge used during multimix mode. More... | |
void | ast_bridge_set_mixing_interval (struct ast_bridge *bridge, unsigned int mixing_interval) |
Adjust the internal mixing interval of a bridge used during multimix mode. More... | |
void | ast_bridge_set_remb_estimated_bitrate (struct ast_bridge *bridge, float estimated_bitrate) |
Force the REMB report estimated bitrate to a specific max value. More... | |
void | ast_bridge_set_remb_send_interval (struct ast_bridge *bridge, unsigned int remb_send_interval) |
Set the interval at which a combined REMB frame will be sent to video sources. More... | |
void | ast_bridge_set_send_sdp_label (struct ast_bridge *bridge, unsigned int send_sdp_label) |
Controls whether to send a "label" attribute in each stream in an SDP. More... | |
void | ast_bridge_set_sfu_video_mode (struct ast_bridge *bridge) |
Set the bridge to be a selective forwarding unit. More... | |
void | ast_bridge_set_single_src_video_mode (struct ast_bridge *bridge, struct ast_channel *video_src_chan) |
Set a bridge to feed a single video source to all participants. More... | |
void | ast_bridge_set_talker_src_video_mode (struct ast_bridge *bridge) |
Set the bridge to pick the strongest talker supporting video as the single source video feed. More... | |
void | ast_bridge_set_transfer_variables (struct ast_channel *chan, const char *value, int is_attended) |
Set the relevant transfer variables for a single channel. More... | |
void | ast_bridge_set_video_update_discard (struct ast_bridge *bridge, unsigned int video_update_discard) |
Set the amount of time to discard subsequent video updates after a video update has been sent. More... | |
int | ast_bridge_suspend (struct ast_bridge *bridge, struct ast_channel *chan) |
Suspend a channel temporarily from a bridge. More... | |
struct ast_bridge * | ast_bridge_transfer_acquire_bridge (struct ast_channel *chan) |
Acquire the channel's bridge for transfer purposes. More... | |
enum ast_transfer_result | ast_bridge_transfer_attended (struct ast_channel *to_transferee, struct ast_channel *to_transfer_target) |
Attended transfer. More... | |
enum ast_transfer_result | ast_bridge_transfer_blind (int is_external, struct ast_channel *transferer, const char *exten, const char *context, transfer_channel_cb new_channel_cb, void *user_data) |
Blind transfer target to the extension and context provided. More... | |
int | ast_bridge_unreal_optimize_out (struct ast_channel *chan, struct ast_channel *peer, struct ast_unreal_pvt *pvt) |
Check and optimize out the unreal channels between bridges. More... | |
int | ast_bridge_unsuspend (struct ast_bridge *bridge, struct ast_channel *chan) |
Unsuspend a channel from a bridge. More... | |
void | ast_bridge_update_talker_src_video_mode (struct ast_bridge *bridge, struct ast_channel *chan, int talker_energy, int is_keyfame) |
Update information about talker energy for talker src video mode. More... | |
void | ast_bridge_vars_set (struct ast_channel *chan, const char *name, const char *pvtid) |
Sets BRIDGECHANNEL and BRIDGEPVTCALLID for a channel. More... | |
const char * | ast_bridge_video_mode_to_string (enum ast_bridge_video_mode_type video_mode) |
Converts an enum representation of a bridge video mode to string. More... | |
struct ao2_container * | ast_bridges (void) |
Returns the global bridges container. More... | |
enum ast_bridge_optimization | ast_bridges_allow_optimization (struct ast_bridge *chan_bridge, struct ast_bridge *peer_bridge) |
Determine if bridges allow for optimization to occur betweem them. More... | |
void | ast_brige_set_remb_behavior (struct ast_bridge *bridge, enum ast_bridge_video_sfu_remb_behavior behavior) |
Set the REMB report generation behavior on a bridge. More... | |
Variables | |
struct ast_bridge_methods | ast_bridge_base_v_table |
Bridge base class virtual method table. More... | |
#define ast_bridge_lock | ( | bridge | ) | _ast_bridge_lock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge) |
Lock the bridge.
bridge | Bridge to lock |
Definition at line 480 of file bridge.h.
Referenced by ast_ari_bridges_clear_video_source(), ast_ari_bridges_create(), ast_ari_bridges_create_with_id(), ast_bridge_basic_set_flags(), ast_bridge_channel_lock_bridge(), ast_bridge_destroy(), ast_bridge_get_snapshot(), ast_bridge_get_snapshot_by_uniqueid(), ast_bridge_is_video_src(), ast_bridge_join(), ast_bridge_kick(), ast_bridge_merge_inhibit(), ast_bridge_number_video_src(), ast_bridge_peer(), ast_bridge_peers(), ast_bridge_remove(), ast_bridge_remove_video_src(), ast_bridge_set_binaural_active(), ast_bridge_set_internal_sample_rate(), ast_bridge_set_maximum_sample_rate(), ast_bridge_set_mixing_interval(), ast_bridge_set_remb_estimated_bitrate(), ast_bridge_set_remb_send_interval(), ast_bridge_set_send_sdp_label(), ast_bridge_set_sfu_video_mode(), ast_bridge_set_single_src_video_mode(), ast_bridge_set_talker_src_video_mode(), ast_bridge_set_video_update_discard(), ast_bridge_suspend(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_bridge_unsuspend(), ast_bridge_update_talker_src_video_mode(), ast_brige_set_remb_behavior(), AST_TEST_DEFINE(), ast_unreal_channel_push_to_bridge(), bridge_action_bridge(), bridge_basic_change_personality(), bridge_channel_internal_join(), bridge_channel_snapshot_pair_init(), bridge_impart_internal(), bridge_manager_service(), bridge_queue_action_nodup(), bridge_register(), bridge_set_video_source_cb(), complete_bridge_participant(), conf_moh_start(), conf_moh_stop(), destroy_bridge(), handle_bridge_kick_channel(), native_rtp_framehook(), play_uri(), send_conf_stasis(), send_conf_stasis_snapshots(), softmix_mixing_loop(), and softmix_mixing_thread().
#define ast_bridge_lock_both | ( | bridge1, | |
bridge2 | |||
) |
Lock two bridges.
Definition at line 500 of file bridge.h.
Referenced by ast_bridge_add_channel(), ast_bridge_merge(), ast_bridge_move(), ast_bridge_transfer_attended(), bridge_merge(), and bridge_move().
#define ast_bridge_trylock | ( | bridge | ) | _ast_bridge_trylock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge) |
Try locking the bridge.
bridge | Bridge to try locking |
0 | on success. |
non-zero | on error. |
Definition at line 467 of file bridge.h.
Referenced by optimize_lock_chan_stack(), and optimize_lock_peer_stack().
#define ast_bridge_unlock | ( | bridge | ) | _ast_bridge_unlock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge) |
Unlock the bridge.
bridge | Bridge to unlock |
Definition at line 493 of file bridge.h.
Referenced by action_toggle_binaural(), agent_alert(), ast_ari_bridges_clear_video_source(), ast_ari_bridges_create(), ast_ari_bridges_create_with_id(), ast_bridge_add_channel(), ast_bridge_basic_set_flags(), ast_bridge_channel_feature_digit(), ast_bridge_channel_lock_bridge(), ast_bridge_channel_merge_inhibit(), ast_bridge_destroy(), ast_bridge_get_snapshot(), ast_bridge_get_snapshot_by_uniqueid(), ast_bridge_is_video_src(), ast_bridge_join(), ast_bridge_kick(), ast_bridge_merge(), ast_bridge_merge_inhibit(), ast_bridge_move(), ast_bridge_notify_masquerade(), ast_bridge_number_video_src(), ast_bridge_peer(), ast_bridge_peers(), ast_bridge_remove(), ast_bridge_remove_video_src(), ast_bridge_set_binaural_active(), ast_bridge_set_internal_sample_rate(), ast_bridge_set_maximum_sample_rate(), ast_bridge_set_mixing_interval(), ast_bridge_set_remb_estimated_bitrate(), ast_bridge_set_remb_send_interval(), ast_bridge_set_send_sdp_label(), ast_bridge_set_sfu_video_mode(), ast_bridge_set_single_src_video_mode(), ast_bridge_set_talker_src_video_mode(), ast_bridge_set_video_update_discard(), ast_bridge_suspend(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_bridge_unreal_optimize_out(), ast_bridge_unsuspend(), ast_bridge_update_talker_src_video_mode(), ast_brige_set_remb_behavior(), AST_TEST_DEFINE(), ast_unreal_channel_push_to_bridge(), attended_transfer_bridge(), basic_hangup_hook(), bridge_action_bridge(), bridge_basic_change_personality(), bridge_channel_handle_control(), bridge_channel_internal_join(), bridge_channel_snapshot_pair_init(), bridge_channel_suspend(), bridge_channel_unsuspend(), bridge_channel_wait(), bridge_channel_write_frame(), bridge_handle_trip(), bridge_impart_internal(), bridge_manager_service(), bridge_merge(), bridge_move(), bridge_queue_action_nodup(), bridge_register(), bridge_set_video_source_cb(), check_binaural_position_change(), complete_bridge_participant(), conf_moh_start(), conf_moh_stop(), deferred_action(), destroy_bridge(), feature_automixmonitor(), feature_automonitor(), handle_bridge_kick_channel(), native_rtp_framehook(), optimize_lock_chan_stack(), optimize_lock_peer_stack(), parking_blind_transfer_park(), play_uri(), send_conf_stasis(), send_conf_stasis_snapshots(), softmix_mixing_loop(), and softmix_mixing_thread().
typedef void(* ast_bridge_destructor_fn) (struct ast_bridge *self) |
typedef void(* ast_bridge_dissolving_fn) (struct ast_bridge *self) |
typedef int(* ast_bridge_merge_priority_fn) (struct ast_bridge *self) |
typedef void(* ast_bridge_notify_masquerade_fn) (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel) |
Notify the bridge that this channel was just masqueraded.
self | Bridge to operate upon. |
bridge_channel | Bridge channel that was masqueraded. |
A masquerade just happened to this channel. The bridge needs to re-evaluate this a channel in the bridge.
typedef void(* ast_bridge_pull_channel_fn) (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel) |
Pull this channel from the bridge.
self | Bridge to operate upon. |
bridge_channel | Bridge channel to pull. |
Remove any channel hooks controlled by the bridge. Release any resources held by bridge_channel->bridge_pvt and release bridge_channel->bridge_pvt.
typedef int(* ast_bridge_push_channel_fn) (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap) |
Push this channel into the bridge.
self | Bridge to operate upon. |
bridge_channel | Bridge channel to push. |
swap | Bridge channel to swap places with if not NULL. |
Setup any channel hooks controlled by the bridge. Allocate bridge_channel->bridge_pvt and initialize any resources put in bridge_channel->bridge_pvt if needed. If there is a swap channel, use it as a guide to setting up the bridge_channel.
0 | on success. |
-1 | on failure. The channel did not get pushed. |
typedef void(* transfer_channel_cb) (struct ast_channel *chan, struct transfer_channel_data *user_data, enum ast_transfer_type transfer_type) |
Callback function type called during blind transfers.
A caller of ast_bridge_transfer_blind() may wish to set data on the channel that ends up running dialplan. For instance, it may be useful to set channel variables on the channel.
chan | The involved channel |
user_data | User-provided data needed in the callback |
transfer_type | The type of transfer being completed |
Capabilities for a bridge technology.
Definition at line 84 of file bridge.h.
Enumerator | |
---|---|
AST_BRIDGE_IMPART_CHAN_MASK | Field describing what the caller can do with the channel after it is imparted. |
AST_BRIDGE_IMPART_CHAN_DEPARTABLE | The caller wants to reclaim the channel using ast_bridge_depart(). |
AST_BRIDGE_IMPART_CHAN_INDEPENDENT | The caller is passing channel control entirely to the bridging system. |
AST_BRIDGE_IMPART_INHIBIT_JOIN_COLP | The initial bridge join does not cause a COLP exchange. |
Enumerator | |
---|---|
AST_BRIDGE_JOIN_PASS_REFERENCE | The bridge reference is being passed by the caller. |
AST_BRIDGE_JOIN_INHIBIT_JOIN_COLP | The initial bridge join does not cause a COLP exchange. |
Definition at line 547 of file bridge.h.
Tells, if optimization is allowed, how the optimization would be performed.
Definition at line 891 of file bridge.h.
Video source modes.
REMB report behaviors.
Definition at line 131 of file bridge.h.
enum ast_transfer_result |
Definition at line 1115 of file bridge.h.
enum ast_transfer_type |
Enumerator | |
---|---|
AST_BRIDGE_TRANSFER_SINGLE_PARTY | Transfer of a single party |
AST_BRIDGE_TRANSFER_MULTI_PARTY | Transfer of multiple parties |
Definition at line 1126 of file bridge.h.
|
inlinestatic |
Definition at line 481 of file bridge.h.
References __ao2_lock(), and AO2_LOCK_REQ_MUTEX.
|
inlinestatic |
Definition at line 468 of file bridge.h.
References __ao2_trylock(), and AO2_LOCK_REQ_MUTEX.
|
inlinestatic |
Definition at line 494 of file bridge.h.
References __ao2_unlock().
struct ast_bridge* ast_bridge_base_new | ( | uint32_t | capabilities, |
unsigned int | flags, | ||
const char * | creator, | ||
const char * | name, | ||
const char * | id | ||
) |
Create a new base class bridge.
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) |
a | pointer to a new bridge on success |
NULL | on failure |
Example usage:
This creates a no frills two party bridge that will be destroyed once one of the channels hangs up.
Definition at line 960 of file bridge.c.
References bridge_manager_request::bridge, bridge_alloc(), bridge_base_init(), and bridge_register().
Referenced by AST_TEST_DEFINE(), get_wait_bridge_wrapper(), and join_conference_bridge().
int ast_bridge_depart | ( | struct ast_channel * | chan | ) |
Depart a channel from a bridge.
chan | Channel to depart |
0 | on success |
-1 | on failure |
Example usage:
This removes the channel pointed to by the chan pointer from any bridge it may be in and gives control to the calling thread. This does not hang up the channel.
Definition at line 1952 of file bridge.c.
References ao2_ref, ast_assert, ast_bridge_channel_leave_bridge(), AST_CAUSE_NORMAL_CLEARING, ast_channel_internal_bridge_channel(), ast_channel_internal_bridge_channel_set(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, ast_log, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, ast_bridge_channel::chan, ast_bridge_channel::depart_wait, LOG_ERROR, NULL, SCOPE_TRACE, and ast_bridge_channel::thread.
Referenced by app_control_continue(), AST_TEST_DEFINE(), control_swap_channel_in_bridge(), depart_channel(), and stasis_app_exec().
int ast_bridge_destroy | ( | struct ast_bridge * | bridge, |
int | cause | ||
) |
Destroy a bridge.
bridge | Bridge to destroy |
cause | Cause of bridge being destroyed. (If cause <= 0 then use AST_CAUSE_NORMAL_CLEARING) |
0 | on success |
-1 | on failure |
Example usage:
This destroys a bridge that was previously created.
Definition at line 970 of file bridge.c.
References ao2_ref, ast_bridge_lock, ast_bridge_unlock, ast_debug, bridge_dissolve(), and ast_bridge::uniqueid.
Referenced by action_bridge(), agent_connect_caller(), agent_logout(), agent_pvt_destructor(), agent_request_exec(), agent_run(), ast_bridge_call_with_flags(), attended_transfer_properties_shutdown(), bridge_create_common(), bridge_exec(), bridge_register(), caller_abort_agent(), destroy_conference_bridge(), fail_enter(), handle_bridge_destroy_specific(), manager_bridge_destroy(), parked_call_app_exec(), parking_lot_destructor(), safe_bridge_destroy(), stasis_app_bridge_destroy(), stasis_app_control_shutdown(), unload_module(), wait_bridge_wrapper_alloc(), and wait_bridge_wrapper_destructor().
void ast_bridge_features_remove | ( | struct ast_bridge_features * | features, |
enum ast_bridge_hook_remove_flags | flags | ||
) |
Remove marked bridge channel feature hooks.
features | Bridge features structure |
flags | Determinator for whether hook is removed. |
Definition at line 3568 of file bridge.c.
References ast_bridge_features::dtmf_hooks, hooks_remove_container(), hooks_remove_heap(), ast_bridge_features::interval_hooks, and ast_bridge_features::other_hooks.
Referenced by bridge_base_pull(), bridge_channel_internal_join(), bridge_do_merge(), bridge_do_move(), and remove_hooks_on_personality_change().
struct ast_bridge* ast_bridge_find_by_id | ( | const char * | bridge_id | ) |
Find bridge by id.
bridge_id | Bridge identifier |
Definition at line 5070 of file bridge.c.
References ao2_find, and OBJ_SEARCH_KEY.
Referenced by ast_bridge_get_snapshot_by_uniqueid(), complete_bridge_participant(), handle_bridge_destroy_specific(), handle_bridge_kick_channel(), manager_bridge_destroy(), and manager_bridge_kick().
int ast_bridge_impart | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan, | ||
struct ast_channel * | swap, | ||
struct ast_bridge_features * | features, | ||
enum ast_bridge_impart_flags | flags | ||
) |
Impart a channel to a bridge (non-blocking)
bridge | Bridge to impart on |
chan | Channel to impart (The channel reference is stolen if impart successful.) |
swap | Channel to swap out if swapping. NULL if not swapping. |
features | Bridge features structure. |
flags | defined by enum ast_bridge_impart_flags. |
0 | on success |
-1 | on failure (Caller still has ownership of chan) |
Example usage:
This adds a channel pointed to by the chan pointer to the bridge pointed to by the bridge pointer. This function will return immediately and will not wait until the channel is no longer part of the bridge.
If this channel will be replacing another channel the other channel can be specified in the swap parameter. The other channel will be thrown out of the bridge in an atomic fashion.
If channel specific features are enabled, a pointer to the features structure can be specified in the features parameter.
Definition at line 1924 of file bridge.c.
References AST_BRIDGE_AFTER_CB_REASON_IMPART_FAILED, ast_bridge_discard_after_callback(), ast_channel_name(), ast_cond_destroy, ast_cond_init, ast_mutex_destroy, ast_mutex_init, bridge_channel_impart_signal(), bridge_impart_internal(), bridge_channel_impart_cond::cond, bridge_channel_impart_cond::done, bridge_channel_impart_cond::lock, NULL, SCOPE_TRACE, and ast_bridge::uniqueid.
Referenced by add_to_dial_bridge(), ast_bridge_add_channel(), ast_bridge_call_with_flags(), AST_TEST_DEFINE(), ast_unreal_channel_push_to_bridge(), attended_transfer_bridge(), blind_transfer_bridge(), conf_announce_channel_push(), conf_start_record(), control_swap_channel_in_bridge(), feature_attended_transfer(), handle_invite_replaces(), local_call(), parking_blind_transfer_park(), recalling_exit(), refer_incoming_invite_request(), and retransfer_enter().
int ast_bridge_is_video_src | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Determine if a channel is a video src for the bridge.
0 | Not a current video source of the bridge. |
None | 0, is a video source of the bridge, The number returned represents the priority this video stream has on the bridge where 1 is the highest priority. |
Definition at line 3958 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_NONE, AST_BRIDGE_VIDEO_MODE_SFU, AST_BRIDGE_VIDEO_MODE_SINGLE_SRC, AST_BRIDGE_VIDEO_MODE_TALKER_SRC, ast_bridge_video_talker_src_data::chan_old_vsrc, ast_bridge_video_single_src_data::chan_vsrc, ast_bridge_video_talker_src_data::chan_vsrc, ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, ast_bridge_video_mode::single_src_data, ast_bridge::softmix, ast_bridge_video_mode::talker_src_data, and ast_bridge_softmix::video_mode.
Referenced by handle_video_on_exit(), handle_video_on_join(), softmix_bridge_write_video(), and softmix_pass_video_top_priority().
int ast_bridge_join | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan, | ||
struct ast_channel * | swap, | ||
struct ast_bridge_features * | features, | ||
struct ast_bridge_tech_optimizations * | tech_args, | ||
enum ast_bridge_join_flags | flags | ||
) |
Join a channel to a bridge (blocking)
bridge | Bridge to join |
chan | Channel to join |
swap | Channel to swap out if swapping (A channel reference is stolen.) |
features | Bridge features structure |
tech_args | Optional Bridging tech optimization parameters for this channel. |
flags | defined by enum ast_bridge_join_flags. |
0 | if the channel successfully joined the bridge before it exited. |
-1 | if the channel failed to join the bridge |
Example usage:
This adds a channel pointed to by the chan pointer to the bridge pointed to by the bridge pointer. This function will not return until the channel has been removed from the bridge, swapped out for another channel, or has hung up.
If this channel will be replacing another channel the other channel can be specified in the swap parameter. The other channel will be thrown out of the bridge in an atomic fashion.
If channel specific features are enabled a pointer to the features structure can be specified in the features parameter.
Definition at line 1667 of file bridge.c.
References ao2_lock, ao2_ref, ao2_t_cleanup, ao2_unlock, ast_assert, AST_BRIDGE_JOIN_INHIBIT_JOIN_COLP, AST_BRIDGE_JOIN_PASS_REFERENCE, ast_bridge_lock, ast_bridge_run_after_callback(), ast_bridge_setup_after_goto(), ast_bridge_unlock, ast_channel_flags(), ast_channel_internal_bridge_channel_set(), ast_channel_lock, ast_channel_name(), ast_channel_softhangup_internal_flag(), ast_channel_unlock, AST_FLAG_ZOMBIE, AST_SOFTHANGUP_ASYNCGOTO, ast_softhangup_nolock(), ast_test_flag, bridge_channel_impart_signal(), bridge_channel_internal_alloc(), bridge_channel_internal_join(), bridge_find_channel(), ast_bridge_channel::chan, ast_bridge_channel::features, ast_bridge_channel::inhibit_colp, NULL, ast_bridge_methods::push_peek, SCOPE_TRACE, ast_bridge_channel::swap, ast_bridge_channel::tech_args, ast_bridge_channel::thread, ast_bridge::uniqueid, and ast_bridge::v_table.
Referenced by agent_request_exec(), agent_run(), ast_bridge_call_with_flags(), bridge_exec(), bridgeadd_exec(), bridgewait_exec(), confbridge_exec(), park_and_announce_app_exec(), park_app_exec(), and parked_call_app_exec().
int ast_bridge_kick | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Kick a channel from a bridge.
bridge | Bridge that the channel is to be kicked from |
chan | Channel to kick |
0 | on success |
-1 | on failure |
Example usage:
This kicks the channel pointed to by the chan pointer from the bridge pointed to by the bridge pointer and requests that it be hung up. Control over the channel will NOT be given to the calling thread.
Definition at line 2025 of file bridge.c.
References ast_bridge_channel_queue_callback(), ast_bridge_lock, ast_bridge_unlock, bridge_find_channel(), kick_it(), and NULL.
Referenced by handle_bridge_kick_channel(), and manager_bridge_kick().
int ast_bridge_merge | ( | struct ast_bridge * | dst_bridge, |
struct ast_bridge * | src_bridge, | ||
int | merge_best_direction, | ||
struct ast_channel ** | kick_me, | ||
unsigned int | num_kick | ||
) |
Merge two bridges together.
dst_bridge | Destination bridge of merge. |
src_bridge | Source bridge of merge. |
merge_best_direction | TRUE if don't care about which bridge merges into the other. |
kick_me | Array of channels to kick from the bridges. |
num_kick | Number of channels in the kick_me array. |
0 | on success |
-1 | on failure |
Example usage:
This moves the channels in src_bridge into the bridge pointed to by dst_bridge.
Definition at line 2348 of file bridge.c.
References ast_assert, ast_bridge_lock_both, ast_bridge_unlock, and bridge_merge_locked().
void ast_bridge_merge_inhibit | ( | struct ast_bridge * | bridge, |
int | request | ||
) |
Adjust the bridge merge inhibit request count.
bridge | What to operate on. |
request | Inhibit request increment. (Positive to add requests. Negative to remove requests.) |
Definition at line 3061 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, and bridge_merge_inhibit_nolock().
Referenced by attended_transfer_properties_shutdown(), consulting_exit(), and feature_attended_transfer().
int ast_bridge_move | ( | struct ast_bridge * | dst_bridge, |
struct ast_bridge * | src_bridge, | ||
struct ast_channel * | chan, | ||
struct ast_channel * | swap, | ||
int | attempt_recovery | ||
) |
Move a channel from one bridge to another.
dst_bridge | Destination bridge of bridge channel move. |
src_bridge | Source bridge of bridge channel move. |
chan | Channel to move. |
swap | Channel to replace in dst_bridge. |
attempt_recovery | TRUE if failure attempts to push channel back into original bridge. |
0 | on success. |
-1 | on failure. |
Definition at line 2508 of file bridge.c.
References ast_bridge_lock_both, ast_bridge_unlock, and bridge_move_locked().
Referenced by agent_connect_caller(), parked_call_app_exec(), and parking_park_bridge_channel().
void ast_bridge_notify_masquerade | ( | struct ast_channel * | chan | ) |
Notify bridging that this channel was just masqueraded.
chan | Channel just involved in a masquerade |
Definition at line 1482 of file bridge.c.
References ao2_ref, ast_bridge_channel_lock_bridge(), ast_bridge_unlock, ast_channel_get_bridge_channel(), ast_channel_lock, ast_channel_unlock, ast_bridge_channel::bridge, bridge_manager_request::bridge, bridge_find_channel(), bridge_reconfigured(), ast_bridge_methods::notify_masquerade, and ast_bridge::v_table.
Referenced by channel_do_masquerade().
int ast_bridge_number_video_src | ( | struct ast_bridge * | bridge | ) |
Returns the number of video sources currently active in the bridge.
Definition at line 3931 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_NONE, AST_BRIDGE_VIDEO_MODE_SFU, AST_BRIDGE_VIDEO_MODE_SINGLE_SRC, AST_BRIDGE_VIDEO_MODE_TALKER_SRC, ast_bridge_video_talker_src_data::chan_old_vsrc, ast_bridge_video_single_src_data::chan_vsrc, ast_bridge_video_talker_src_data::chan_vsrc, ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, ast_bridge_video_mode::single_src_data, ast_bridge::softmix, ast_bridge_video_mode::talker_src_data, and ast_bridge_softmix::video_mode.
Referenced by softmix_bridge_write_video().
struct ast_channel* ast_bridge_peer | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Get the channel's bridge peer only if the bridge is two-party.
bridge | The bridge |
chan | Channel desiring the bridge peer channel. |
NULL | Channel not in a bridge or the bridge is not two-party. |
non-NULL | Reffed peer channel at time of calling. |
Definition at line 4142 of file bridge.c.
References ast_bridge_lock, ast_bridge_peer_nolock(), and ast_bridge_unlock.
Referenced by ast_attended_transfer_message_create(), ast_bridge_transfer_blind(), ast_channel_bridge_peer(), and get_transfer_parties_transferer_bridge().
struct ast_channel* ast_bridge_peer_nolock | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Get the channel's bridge peer only if the bridge is two-party.
bridge | The bridge which is already locked. |
chan | Channel desiring the bridge peer channel. |
NULL | Channel not in a bridge or the bridge is not two-party. |
non-NULL | Reffed peer channel at time of calling. |
Definition at line 4114 of file bridge.c.
References AST_BRIDGE_CAPABILITY_1TO1MIX, AST_BRIDGE_CAPABILITY_NATIVE, ast_channel_ref, AST_LIST_TRAVERSE, ast_bridge_technology::capabilities, ast_bridge_channel::chan, ast_bridge::channels, ast_bridge_channel::in_bridge, NULL, ast_bridge::num_channels, and ast_bridge::technology.
Referenced by ast_bridge_peer(), feature_automixmonitor(), and feature_automonitor().
struct ao2_container* ast_bridge_peers | ( | struct ast_bridge * | bridge | ) |
Get a container of all channels in the bridge.
bridge | The bridge |
NULL | Failed to create container |
non-NULL | Container of channels in the bridge |
Definition at line 4103 of file bridge.c.
References ast_bridge_lock, ast_bridge_peers_nolock(), ast_bridge_unlock, and channels.
struct ao2_container* ast_bridge_peers_nolock | ( | struct ast_bridge * | bridge | ) |
Get a container of all channels in the bridge.
bridge | The bridge which is already locked. |
NULL | Failed to create container |
non-NULL | Container of channels in the bridge |
Definition at line 4085 of file bridge.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_hash, ao2_link, AST_LIST_TRAVERSE, ast_bridge_channel::chan, channel_cmp(), channel_hash(), channels, ast_bridge::channels, and NULL.
Referenced by ast_bridge_peers(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), and two_bridge_attended_transfer().
int ast_bridge_queue_action | ( | struct ast_bridge * | bridge, |
struct ast_frame * | action | ||
) |
Put an action onto the specified bridge.
bridge | What to queue the action on. |
action | What to do. |
0 | on success. |
-1 | on error. |
Definition at line 307 of file bridge.c.
References ast_frdup, and bridge_queue_action_nodup().
Referenced by bridge_dissolve().
int ast_bridge_queue_everyone_else | ( | struct ast_bridge * | bridge, |
struct ast_bridge_channel * | bridge_channel, | ||
struct ast_frame * | frame | ||
) |
Queue the given frame to everyone else.
bridge | What bridge to distribute frame. |
bridge_channel | Channel to optionally not pass frame to. (NULL to pass to everyone) |
frame | Frame to pass. |
0 | Frame written to at least one channel. |
-1 | Frame written to no channels. |
Definition at line 1122 of file bridge_channel.c.
References ast_bridge_channel_queue_frame(), AST_FRAME_NULL, AST_LIST_TRAVERSE, ast_bridge::channels, and ast_frame::frametype.
Referenced by bridge_hold(), bridge_ringing(), bridge_unhold(), holding_bridge_write(), native_bridge_write(), native_rtp_bridge_write(), simple_bridge_write(), softmix_bridge_write(), softmix_bridge_write_control(), softmix_bridge_write_text(), and softmix_bridge_write_video().
int ast_bridge_remove | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Remove a channel from a bridge.
bridge | Bridge that the channel is to be removed from |
chan | Channel to remove |
0 | on success |
-1 | on failure |
Example usage:
This removes the channel pointed to by the chan pointer from the bridge pointed to by the bridge pointer and requests that it be hung up. Control over the channel will NOT be given to the calling thread.
Definition at line 1997 of file bridge.c.
References ast_bridge_channel_leave_bridge(), ast_bridge_lock, ast_bridge_unlock, AST_CAUSE_NORMAL_CLEARING, ast_channel_name(), ast_debug, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, bridge_find_channel(), and ast_bridge::uniqueid.
Referenced by action_kick_last(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), execute_menu_entry(), kick_conference_participant(), and leave_marked().
void ast_bridge_remove_video_src | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
remove a channel as a source of video for the bridge.
Definition at line 3984 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_NONE, AST_BRIDGE_VIDEO_MODE_SFU, AST_BRIDGE_VIDEO_MODE_SINGLE_SRC, AST_BRIDGE_VIDEO_MODE_TALKER_SRC, ast_channel_unref, ast_bridge_video_talker_src_data::average_talking_energy, ast_bridge_video_talker_src_data::chan_old_vsrc, ast_bridge_video_single_src_data::chan_vsrc, ast_bridge_video_talker_src_data::chan_vsrc, ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, NULL, ast_bridge_video_mode::single_src_data, ast_bridge::softmix, ast_bridge_video_mode::talker_src_data, and ast_bridge_softmix::video_mode.
Referenced by bridge_channel_internal_join(), and handle_video_on_exit().
void ast_bridge_set_binaural_active | ( | struct ast_bridge * | bridge, |
unsigned int | binaural_active | ||
) |
Activates the use of binaural signals in a conference bridge.
bridge | Channel to activate the binaural signals. |
binaural_active | If true binaural signal processing will be active for the bridge. |
Definition at line 3772 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, ast_bridge_softmix::binaural_active, and ast_bridge::softmix.
Referenced by join_conference_bridge().
void ast_bridge_set_internal_sample_rate | ( | struct ast_bridge * | bridge, |
unsigned int | sample_rate | ||
) |
Adjust the internal mixing sample rate of a bridge used during multimix mode.
bridge | Channel to change the sample rate on. |
sample_rate | the sample rate to change to. If a value of 0 is passed here, the bridge will be free to pick what ever sample rate it chooses. |
Definition at line 3779 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, ast_bridge_softmix::internal_sample_rate, and ast_bridge::softmix.
Referenced by join_conference_bridge().
void ast_bridge_set_maximum_sample_rate | ( | struct ast_bridge * | bridge, |
unsigned int | sample_rate | ||
) |
Adjust the maximum mixing sample rate of a bridge used during multimix mode.
bridge | Channel to change the sample rate on. |
sample_rate | the maximum sample rate to use. If a value of 0 is passed here, the bridge will be free to pick what ever sample rate it chooses. |
Definition at line 3786 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, ast_bridge_softmix::maximum_sample_rate, and ast_bridge::softmix.
Referenced by join_conference_bridge().
void ast_bridge_set_mixing_interval | ( | struct ast_bridge * | bridge, |
unsigned int | mixing_interval | ||
) |
Adjust the internal mixing interval of a bridge used during multimix mode.
bridge | Channel to change the sample rate on. |
mixing_interval | the sample rate to change to. If 0 is set the bridge tech is free to choose any mixing interval it uses by default. |
Definition at line 3765 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, ast_bridge_softmix::internal_mixing_interval, and ast_bridge::softmix.
Referenced by join_conference_bridge().
void ast_bridge_set_remb_estimated_bitrate | ( | struct ast_bridge * | bridge, |
float | estimated_bitrate | ||
) |
Force the REMB report estimated bitrate to a specific max value.
bridge | Bridge to set the REMB behavior on |
estimated_bitrate | The estimated bitrate in bits per second |
Definition at line 3874 of file bridge.c.
References ast_assert, ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_SFU, ast_bridge_video_sfu_data::estimated_bitrate, ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, ast_bridge_video_mode::sfu_data, ast_bridge::softmix, and ast_bridge_softmix::video_mode.
Referenced by join_conference_bridge().
void ast_bridge_set_remb_send_interval | ( | struct ast_bridge * | bridge, |
unsigned int | remb_send_interval | ||
) |
Set the interval at which a combined REMB frame will be sent to video sources.
bridge | Bridge to set the REMB send interval on |
remb_send_interval | The REMB send interval |
Definition at line 3856 of file bridge.c.
References ast_assert, ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_SFU, ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, ast_bridge_video_sfu_data::remb_send_interval, ast_bridge_video_mode::sfu_data, ast_bridge::softmix, and ast_bridge_softmix::video_mode.
Referenced by join_conference_bridge().
void ast_bridge_set_send_sdp_label | ( | struct ast_bridge * | bridge, |
unsigned int | send_sdp_label | ||
) |
Controls whether to send a "label" attribute in each stream in an SDP.
bridge | The bridge |
send_sdp_label | Whether to send the labels or not |
Definition at line 4033 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, ast_bridge_softmix::send_sdp_label, and ast_bridge::softmix.
Referenced by join_conference_bridge().
void ast_bridge_set_sfu_video_mode | ( | struct ast_bridge * | bridge | ) |
Set the bridge to be a selective forwarding unit.
Definition at line 3841 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_SFU, cleanup_video_mode(), ast_bridge_video_mode::mode, ast_bridge::softmix, and ast_bridge_softmix::video_mode.
Referenced by bridge_stasis_new(), and join_conference_bridge().
void ast_bridge_set_single_src_video_mode | ( | struct ast_bridge * | bridge, |
struct ast_channel * | video_src_chan | ||
) |
Set a bridge to feed a single video source to all participants.
Definition at line 3816 of file bridge.c.
References ast_bridge_lock, ast_bridge_publish_state(), ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_SINGLE_SRC, ast_channel_name(), ast_channel_ref, ast_channel_uniqueid(), AST_CONTROL_VIDUPDATE, ast_indicate(), ast_verb, ast_bridge_video_single_src_data::chan_vsrc, cleanup_video_mode(), ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, ast_bridge::name, ast_bridge_video_mode::single_src_data, ast_bridge::softmix, ast_bridge::uniqueid, and ast_bridge_softmix::video_mode.
Referenced by action_confbridgesetsinglevideosrc(), bridge_set_video_source_cb(), bridge_stasis_new(), execute_menu_entry(), handle_video_on_exit(), and handle_video_on_join().
void ast_bridge_set_talker_src_video_mode | ( | struct ast_bridge * | bridge | ) |
Set the bridge to pick the strongest talker supporting video as the single source video feed.
Definition at line 3833 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_TALKER_SRC, cleanup_video_mode(), ast_bridge_video_mode::mode, ast_bridge::softmix, and ast_bridge_softmix::video_mode.
Referenced by ast_ari_bridges_clear_video_source(), bridge_stasis_new(), handle_video_on_exit(), and join_conference_bridge().
void ast_bridge_set_transfer_variables | ( | struct ast_channel * | chan, |
const char * | value, | ||
int | is_attended | ||
) |
Set the relevant transfer variables for a single channel.
Sets either the ATTENDEDTRANSFER or BLINDTRANSFER variable for a channel while clearing the opposite.
chan | Channel the variable is being set for |
value | Value the variable is being set to |
is_attended | false set BLINDTRANSFER and unset ATTENDEDTRANSFER true set ATTENDEDTRANSFER and unset BLINDTRANSFER |
Definition at line 4404 of file bridge.c.
References ATTENDEDTRANSFER, BLINDTRANSFER, NULL, and pbx_builtin_setvar_helper().
Referenced by dial_transfer(), manager_park(), park_local_transfer(), parking_park_bridge_channel(), and set_transfer_variables_all().
void ast_bridge_set_video_update_discard | ( | struct ast_bridge * | bridge, |
unsigned int | video_update_discard | ||
) |
Set the amount of time to discard subsequent video updates after a video update has been sent.
bridge | Bridge to set the minimum video update wait time on |
video_update_discard | Amount of time after sending a video update that others should be discarded |
Definition at line 3849 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, ast_bridge::softmix, ast_bridge_softmix::video_mode, and ast_bridge_video_mode::video_update_discard.
Referenced by bridge_stasis_new(), and join_conference_bridge().
int ast_bridge_suspend | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Suspend a channel temporarily from a bridge.
bridge | Bridge to suspend the channel from |
chan | Channel to suspend |
0 | on success |
-1 | on failure |
Example usage:
This suspends the channel pointed to by chan from the bridge pointed to by bridge temporarily. Control of the channel is given to the calling thread. This differs from ast_bridge_depart as the channel will not be removed from the bridge.
Definition at line 3068 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, bridge_channel_internal_suspend_nolock(), and bridge_find_channel().
Referenced by conf_moh_start(), and conf_moh_stop().
struct ast_bridge* ast_bridge_transfer_acquire_bridge | ( | struct ast_channel * | chan | ) |
Acquire the channel's bridge for transfer purposes.
chan | Channel involved in a transfer. |
Definition at line 4460 of file bridge.c.
References ao2_ref, AST_BRIDGE_FLAG_INVISIBLE, AST_BRIDGE_FLAG_MASQUERADE_ONLY, ast_channel_get_bridge(), ast_channel_lock, ast_channel_unlock, ast_test_flag, bridge_manager_request::bridge, ast_bridge::feature_flags, and NULL.
Referenced by ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), handle_invite_replaces(), and invite_replaces().
enum ast_transfer_result ast_bridge_transfer_attended | ( | struct ast_channel * | to_transferee, |
struct ast_channel * | to_transfer_target | ||
) |
Attended transfer.
The two channels are both transferer channels. The first is the channel that is bridged to the transferee (or if unbridged, the 'first' call of the transfer). The second is the channel that is bridged to the transfer target (or if unbridged, the 'second' call of the transfer).
to_transferee | Transferer channel on initial call (presumably bridged to transferee) |
to_transfer_target | Transferer channel on consultation call (presumably bridged to transfer target) |
Definition at line 4729 of file bridge.c.
References ao2_cleanup, ao2_container_count(), app, ast_attended_transfer_message_add_app(), ast_attended_transfer_message_create(), ast_bridge_channel_write_playfile(), ast_bridge_channel_write_unhold(), AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY, AST_BRIDGE_FLAG_TRANSFER_PROHIBITED, ast_bridge_lock, ast_bridge_lock_both, ast_bridge_peers_nolock(), ast_bridge_publish_attended_transfer(), ast_bridge_remove(), ast_bridge_transfer_acquire_bridge(), AST_BRIDGE_TRANSFER_FAIL, AST_BRIDGE_TRANSFER_INVALID, AST_BRIDGE_TRANSFER_NOT_PERMITTED, AST_BRIDGE_TRANSFER_SUCCESS, ast_bridge_unlock, ast_channel_appl(), ast_channel_get_bridge_channel(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_log, ast_softhangup(), AST_SOFTHANGUP_DEV, ast_strdupa, ast_strlen_zero, ast_test_flag, attended_transfer_bridge(), bridge_channel_internal_queue_attended_transfer(), channels, end, ast_bridge::feature_flags, get_transferee(), lock, LOG_ERROR, NULL, pbx_builtin_getvar_helper(), RAII_VAR, SCOPED_LOCK, set_transfer_variables_all(), and two_bridge_attended_transfer().
Referenced by analog_attempt_transfer(), AST_TEST_DEFINE(), attempt_transfer(), local_attended_transfer(), misdn_attempt_transfer(), refer_attended_task(), and skinny_transfer_attended().
enum ast_transfer_result ast_bridge_transfer_blind | ( | int | is_external, |
struct ast_channel * | transferer, | ||
const char * | exten, | ||
const char * | context, | ||
transfer_channel_cb | new_channel_cb, | ||
void * | user_data | ||
) |
Blind transfer target to the extension and context provided.
The channel given is bridged to one or multiple channels. Depending on the bridge and the number of participants, the entire bridge could be transferred to the given destination, or a single channel may be redirected.
Callers may also provide a callback to be called on the channel that will be running dialplan. The user data passed into ast_bridge_transfer_blind will be given as the argument to the callback to be interpreted as desired. This callback is guaranteed to be called in the same thread as ast_bridge_transfer_blind() and before ast_bridge_transfer_blind() returns.
is_external | Indicates that transfer was initiated externally |
transferer | The channel performing the blind transfer |
exten | The dialplan extension to send the call to |
context | The dialplan context to send the call to |
new_channel_cb | A callback to be called on the channel that will be executing dialplan |
user_data | Argument for new_channel_cb |
Definition at line 4477 of file bridge.c.
References ao2_alloc, ao2_cleanup, ao2_container_count(), ast_blind_transfer_message_create(), ast_bridge_channel_write_unhold(), AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY, AST_BRIDGE_FLAG_TRANSFER_PROHIBITED, ast_bridge_lock, ast_bridge_peer(), ast_bridge_peers_nolock(), ast_bridge_publish_blind_transfer(), ast_bridge_remove(), ast_bridge_snapshot_create(), ast_bridge_transfer_acquire_bridge(), AST_BRIDGE_TRANSFER_FAIL, AST_BRIDGE_TRANSFER_INVALID, AST_BRIDGE_TRANSFER_NOT_PERMITTED, AST_BRIDGE_TRANSFER_SUCCESS, ast_bridge_unlock, ast_channel_cleanup, ast_channel_get_bridge_channel(), ast_channel_lock, ast_channel_name(), ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_channel_unlock, ast_log, ast_test_flag, blind_transfer_bridge(), bridge_manager_request::bridge, bridge_channel_internal_queue_blind_transfer(), channels, ast_bridge::feature_flags, lock, LOG_ERROR, NULL, publish, RAII_VAR, SCOPED_LOCK, set_transfer_variables_all(), and try_parking().
Referenced by action_blind_transfer(), blind_transfer_exec(), console_transfer(), feature_blind_transfer(), handle_request_refer(), refer_incoming_attended_request(), refer_incoming_blind_request(), skinny_transfer_blind(), and socket_process_helper().
int ast_bridge_unreal_optimize_out | ( | struct ast_channel * | chan, |
struct ast_channel * | peer, | ||
struct ast_unreal_pvt * | pvt | ||
) |
Check and optimize out the unreal channels between bridges.
chan | Unreal channel writing a frame into the channel driver. |
peer | Other unreal channel in the pair. |
pvt | Private data provided by an implementation of the unreal driver that contains the callbacks that should be called when optimization begins/ends |
0 | if unreal channels were not optimized out. |
non-zero | if unreal channels were optimized out. |
Definition at line 2968 of file bridge.c.
References ast_bridge_channel_unlock, ast_bridge_unlock, ast_channel_internal_bridge_channel(), ast_channel_unlock, optimize_lock_chan_stack(), optimize_lock_peer_stack(), try_merge_optimize_out(), and try_swap_optimize_out().
Referenced by got_optimized_out().
int ast_bridge_unsuspend | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Unsuspend a channel from a bridge.
bridge | Bridge to unsuspend the channel from |
chan | Channel to unsuspend |
0 | on success |
-1 | on failure |
Example usage:
This unsuspends the channel pointed to by chan from the bridge pointed to by bridge. The bridge will go back to handling the channel once this function returns.
Definition at line 3089 of file bridge.c.
References ast_bridge_lock, ast_bridge_unlock, bridge_channel_internal_unsuspend_nolock(), and bridge_find_channel().
Referenced by conf_moh_start(), and conf_moh_stop().
void ast_bridge_update_talker_src_video_mode | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan, | ||
int | talker_energy, | ||
int | is_keyfame | ||
) |
Update information about talker energy for talker src video mode.
Definition at line 3883 of file bridge.c.
References ast_bridge_lock, ast_bridge_publish_state(), ast_bridge_unlock, ast_channel_name(), ast_channel_nativeformats(), ast_channel_ref, ast_channel_uniqueid(), ast_channel_unref, AST_CONTROL_VIDUPDATE, ast_format_cap_has_type(), ast_indicate(), AST_MEDIA_TYPE_VIDEO, ast_verb, ast_bridge_video_talker_src_data::average_talking_energy, ast_bridge_video_talker_src_data::chan_old_vsrc, ast_bridge_video_talker_src_data::chan_vsrc, ast_bridge_video_mode::mode_data, ast_bridge::name, ast_bridge::softmix, ast_bridge_video_mode::talker_src_data, ast_bridge::uniqueid, and ast_bridge_softmix::video_mode.
Referenced by softmix_bridge_write_video().
void ast_bridge_vars_set | ( | struct ast_channel * | chan, |
const char * | name, | ||
const char * | pvtid | ||
) |
Sets BRIDGECHANNEL and BRIDGEPVTCALLID for a channel.
name | channel name of the bridged peer |
pvtid | Private CallID of the bridged peer |
Definition at line 1242 of file bridge.c.
References ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), and pbx_builtin_setvar_helper().
Referenced by ast_bridge_channel_leave_bridge_nolock(), set_bridge_peer_vars_2party(), set_bridge_peer_vars_holding(), and set_bridge_peer_vars_multiparty().
const char* ast_bridge_video_mode_to_string | ( | enum ast_bridge_video_mode_type | video_mode | ) |
Converts an enum representation of a bridge video mode to string.
video_mode | The video mode |
A | string representation of video_mode |
Definition at line 4018 of file bridge.c.
References AST_BRIDGE_VIDEO_MODE_NONE, AST_BRIDGE_VIDEO_MODE_SFU, AST_BRIDGE_VIDEO_MODE_SINGLE_SRC, and AST_BRIDGE_VIDEO_MODE_TALKER_SRC.
Referenced by ast_bridge_snapshot_to_json(), ast_manager_build_bridge_state_string_prefix(), and handle_bridge_show_specific().
struct ao2_container* ast_bridges | ( | void | ) |
Returns the global bridges container.
a | pointer to the bridges container success |
NULL | on failure |
Definition at line 174 of file bridge.c.
References ao2_bump.
Referenced by ast_ari_bridges_list(), bridges_scrape_cb(), and manager_bridges_list().
enum ast_bridge_optimization ast_bridges_allow_optimization | ( | struct ast_bridge * | chan_bridge, |
struct ast_bridge * | peer_bridge | ||
) |
Determine if bridges allow for optimization to occur betweem them.
chan_bridge | First bridge being tested |
peer_bridge | Second bridge being tested |
This determines if two bridges allow for unreal channel optimization to occur between them. The function does not require for unreal channels to already be in the bridges when called.
Definition at line 3008 of file bridge.c.
References AST_BRIDGE_OPTIMIZE_MERGE_TO_CHAN_BRIDGE, AST_BRIDGE_OPTIMIZE_MERGE_TO_PEER_BRIDGE, AST_BRIDGE_OPTIMIZE_PROHIBITED, AST_BRIDGE_OPTIMIZE_SWAP_TO_CHAN_BRIDGE, AST_BRIDGE_OPTIMIZE_SWAP_TO_PEER_BRIDGE, bridge_allows_optimization(), bridges_allow_merge_optimization(), bridges_allow_swap_optimization(), merge_direction::dest, MERGE_ALLOWED, SWAP_PROHIBITED, SWAP_TO_CHAN_BRIDGE, and SWAP_TO_PEER_BRIDGE.
Referenced by two_bridge_attended_transfer().
void ast_brige_set_remb_behavior | ( | struct ast_bridge * | bridge, |
enum ast_bridge_video_sfu_remb_behavior | behavior | ||
) |
Set the REMB report generation behavior on a bridge.
bridge | Bridge to set the REMB behavior on |
behavior | How REMB reports are generated |
Definition at line 3865 of file bridge.c.
References ast_assert, ast_bridge_lock, ast_bridge_unlock, AST_BRIDGE_VIDEO_MODE_SFU, ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, ast_bridge_video_sfu_data::remb_behavior, ast_bridge_video_mode::sfu_data, ast_bridge::softmix, and ast_bridge_softmix::video_mode.
Referenced by join_conference_bridge().
struct ast_bridge_methods ast_bridge_base_v_table |
Bridge base class virtual method table.
Definition at line 949 of file bridge.c.
Referenced by ast_bridging_init_basic(), bridge_agent_hold_dissolving(), bridge_agent_hold_pull(), bridge_agent_hold_push(), bridge_basic_destroy(), bridge_basic_pull(), bridge_basic_push(), bridge_init_agent_hold(), bridge_parking_destroy(), bridge_parking_dissolving(), bridge_parking_get_merge_priority(), bridge_parking_notify_masquerade(), bridge_parking_pull(), bridge_parking_push(), bridge_stasis_init(), bridge_stasis_pull(), bridge_stasis_push(), and bridge_stasis_push_peek().