65#ifndef _ASTERISK_BRIDGING_H
66#define _ASTERISK_BRIDGING_H
68#if defined(__cplusplus) || defined(c_plusplus)
459#define ast_bridge_trylock(bridge) _ast_bridge_trylock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge)
470#define ast_bridge_lock(bridge) _ast_bridge_lock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge)
481#define ast_bridge_unlock(bridge) _ast_bridge_unlock(bridge, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge)
488#define ast_bridge_lock_both(bridge1, bridge2) \
491 ast_bridge_lock(bridge1); \
492 if (!ast_bridge_trylock(bridge2)) { \
495 ast_bridge_unlock(bridge1); \
1281#if defined(__cplusplus) || defined(c_plusplus)
int __ao2_trylock(void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Try locking– (don't block if fail)
int __ao2_unlock(void *a, const char *file, const char *func, int line, const char *var)
Unlock an object.
int __ao2_lock(void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var)
Lock an object.
int ast_bridge_depart(struct ast_channel *chan)
Depart a channel from a 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.
struct ao2_container * ast_bridges(void)
Returns the global bridges container.
void(* ast_bridge_destructor_fn)(struct ast_bridge *self)
Destroy the bridge.
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.
void ast_bridge_features_remove(struct ast_bridge_features *features, enum ast_bridge_hook_remove_flags flags)
Remove marked bridge channel feature hooks.
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.
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)
ast_bridge_optimization
Tells, if optimization is allowed, how the optimization would be performed.
@ AST_BRIDGE_OPTIMIZE_PROHIBITED
@ AST_BRIDGE_OPTIMIZE_MERGE_TO_CHAN_BRIDGE
@ AST_BRIDGE_OPTIMIZE_SWAP_TO_PEER_BRIDGE
@ AST_BRIDGE_OPTIMIZE_MERGE_TO_PEER_BRIDGE
@ AST_BRIDGE_OPTIMIZE_SWAP_TO_CHAN_BRIDGE
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.
void ast_bridge_set_binaural_active(struct ast_bridge *bridge, unsigned int binaural_active)
Activates the use of binaural signals in a conference bridge.
ast_bridge_video_sfu_remb_behavior
REMB report behaviors.
@ AST_BRIDGE_VIDEO_SFU_REMB_LOWEST
@ AST_BRIDGE_VIDEO_SFU_REMB_HIGHEST_ALL
@ AST_BRIDGE_VIDEO_SFU_REMB_AVERAGE
@ AST_BRIDGE_VIDEO_SFU_REMB_HIGHEST
@ AST_BRIDGE_VIDEO_SFU_REMB_AVERAGE_ALL
@ AST_BRIDGE_VIDEO_SFU_REMB_FORCE
@ AST_BRIDGE_VIDEO_SFU_REMB_LOWEST_ALL
void(* ast_bridge_dissolving_fn)(struct ast_bridge *self)
The bridge is being dissolved.
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.
int ast_bridge_number_video_src(struct ast_bridge *bridge)
Returns the number of video sources currently active in the bridge.
struct ao2_container * ast_bridge_peers_nolock(struct ast_bridge *bridge)
Get a container of all channels in the bridge.
static void _ast_bridge_unlock(struct ast_bridge *bridge, const char *file, const char *function, int line, const char *var)
void ast_bridge_set_sfu_video_mode(struct ast_bridge *bridge)
Set the bridge to be a selective forwarding unit.
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.
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.
int ast_bridge_queue_action(struct ast_bridge *bridge, struct ast_frame *action)
Put an action onto the specified bridge.
int ast_bridge_destroy(struct ast_bridge *bridge, int cause)
Destroy a bridge.
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)
struct ast_bridge_methods ast_bridge_base_v_table
Bridge base class virtual method table.
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.
struct ast_bridge * ast_bridge_transfer_acquire_bridge(struct ast_channel *chan)
Acquire the channel's bridge for transfer purposes.
int ast_bridge_remove(struct ast_bridge *bridge, struct ast_channel *chan)
Remove a channel from a bridge.
void ast_bridge_vars_set(struct ast_channel *chan, const char *name, const char *pvtid)
Sets BRIDGECHANNEL and BRIDGEPVTCALLID for a channel.
void ast_bridge_merge_inhibit(struct ast_bridge *bridge, int request)
Adjust the bridge merge inhibit request count.
int ast_bridge_kick(struct ast_bridge *bridge, struct ast_channel *chan)
Kick a channel from a bridge.
int(* ast_bridge_merge_priority_fn)(struct ast_bridge *self)
Get the merge priority of this bridge.
ast_bridge_capability
Capabilities for a bridge technology.
@ AST_BRIDGE_CAPABILITY_EARLY
@ AST_BRIDGE_CAPABILITY_MULTIMIX
@ AST_BRIDGE_CAPABILITY_NATIVE
@ AST_BRIDGE_CAPABILITY_1TO1MIX
@ AST_BRIDGE_CAPABILITY_HOLDING
struct ast_bridge * ast_bridge_find_by_id(const char *bridge_id)
Find bridge by id.
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.
int ast_bridge_suspend(struct ast_bridge *bridge, struct ast_channel *chan)
Suspend a channel temporarily from a bridge.
@ AST_BRIDGE_TRANSFER_SINGLE_PARTY
@ AST_BRIDGE_TRANSFER_MULTI_PARTY
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.
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.
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.
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.
struct ao2_container * ast_bridge_peers(struct ast_bridge *bridge)
Get a container of all channels in the bridge.
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.
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.
void(* ast_bridge_pull_channel_fn)(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel)
Pull this channel from the bridge.
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.
static int _ast_bridge_trylock(struct ast_bridge *bridge, const char *file, const char *function, int line, const char *var)
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.
int ast_bridge_unsuspend(struct ast_bridge *bridge, struct ast_channel *chan)
Unsuspend a channel from a 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.
@ AST_BRIDGE_TRANSFER_NOT_PERMITTED
@ AST_BRIDGE_TRANSFER_SUCCESS
@ AST_BRIDGE_TRANSFER_INVALID
@ AST_BRIDGE_TRANSFER_FAIL
ast_bridge_video_mode_type
Video source modes.
@ AST_BRIDGE_VIDEO_MODE_SINGLE_SRC
@ AST_BRIDGE_VIDEO_MODE_TALKER_SRC
@ AST_BRIDGE_VIDEO_MODE_NONE
@ AST_BRIDGE_VIDEO_MODE_SFU
void ast_bridge_update_talker_src_video_mode(struct ast_bridge *bridge, struct ast_channel *chan, int talker_energy, int is_keyframe)
Update information about talker energy for talker src video mode.
@ AST_BRIDGE_IMPART_CHAN_DEPARTABLE
@ AST_BRIDGE_IMPART_CHAN_MASK
@ AST_BRIDGE_IMPART_INHIBIT_JOIN_COLP
@ AST_BRIDGE_IMPART_CHAN_INDEPENDENT
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.
static void _ast_bridge_lock(struct ast_bridge *bridge, const char *file, const char *function, int line, const char *var)
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.
@ AST_BRIDGE_JOIN_INHIBIT_JOIN_COLP
@ AST_BRIDGE_JOIN_PASS_REFERENCE
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.
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.
void ast_bridge_notify_masquerade(struct ast_channel *chan)
Notify bridging that this channel was just masqueraded.
enum ast_transfer_result ast_bridge_transfer_attended(struct ast_channel *to_transferee, struct ast_channel *to_transfer_target)
Attended transfer.
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.
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.
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.
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.
ast_bridge_hook_remove_flags
Channel Bridging Roles API.
static int request(void *obj)
#define attribute_warn_unused_result
Convenient Signal Processing routines.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
Structure that contains information regarding a channel in a bridge.
struct ast_channel * swap
Structure that contains features information.
Bridge virtual methods table definition.
ast_bridge_dissolving_fn dissolving
ast_bridge_push_channel_fn push
ast_bridge_notify_masquerade_fn notify_masquerade
ast_bridge_destructor_fn destroy
ast_bridge_merge_priority_fn get_merge_priority
ast_bridge_pull_channel_fn pull
ast_bridge_push_channel_fn push_peek
Structure that contains a snapshot of information about a bridge.
enum ast_bridge_video_mode_type video_mode
struct timeval creationtime
const ast_string_field video_source_id
const ast_string_field creator
const ast_string_field uniqueid
unsigned int num_channels
const ast_string_field technology
const ast_string_field name
struct ao2_container * channels
const ast_string_field subclass
struct ast_flags feature_flags
unsigned int send_sdp_label
unsigned int maximum_sample_rate
The maximum sample rate softmix uses to mix channels.
unsigned int internal_sample_rate
The internal sample rate softmix uses to mix channels.
unsigned int binaural_active
struct ast_bridge_video_mode video_mode
unsigned int internal_mixing_interval
The mixing interval indicates how quickly softmix mixing should occur to mix audio.
Structure specific to bridge technologies capable of performing talking optimizations.
Structure that is the essence of a bridge technology.
Data structure that defines a video source mode.
struct ast_bridge_video_single_src_data single_src_data
struct ast_bridge_video_talker_src_data talker_src_data
unsigned int video_update_discard
union ast_bridge_video_mode::@189 mode_data
enum ast_bridge_video_mode_type mode
struct ast_bridge_video_sfu_data sfu_data
This is used for selective forwarding unit configuration.
unsigned int remb_send_interval
enum ast_bridge_video_sfu_remb_behavior remb_behavior
This is used for both SINGLE_SRC mode to set what channel should be the current single video feed.
struct ast_channel * chan_vsrc
This is used for both SINGLE_SRC_TALKER mode to set what channel should be the current single video f...
struct ast_channel * chan_old_vsrc
int average_talking_energy
struct ast_channel * chan_vsrc
Structure that contains information about a bridge.
struct stasis_topic * topic
struct ast_bridge_softmix softmix
struct ast_vector_int media_types
struct ast_bridge::@190 action_queue
struct timeval creationtime
const struct ast_bridge_methods * v_table
unsigned int reconfigured
const ast_string_field creator
const ast_string_field uniqueid
struct ast_bridge_channels_list channels
struct ast_bridge_snapshot * current_snapshot
unsigned int num_channels
struct ast_bridge_technology * technology
unsigned int construction_completed
const ast_string_field name
unsigned int inhibit_merge
Count of the active temporary requests to inhibit bridge merges. Zero if merges are allowed.
struct ast_flags feature_flags
uint32_t allowed_capabilities
Main Channel structure associated with a channel.
struct ast_bridge * bridge
Structure used to handle boolean flags.
Data structure associated with a single frame of data.
The base pvt structure for local channel derivatives.
struct ast_channel * chan
Integer vector definition.
AO2 object that wraps data for transfer_channel_cb.
Universally unique identifier support.