Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Go to the source code of this file.
Data Structures | |
struct | ast_bridge_channel |
Structure that contains information regarding a channel in a bridge. More... | |
Macros | |
#define | ast_bridge_channel_lock(bridge_channel) _ast_bridge_channel_lock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel) |
Lock the bridge_channel. More... | |
#define | ast_bridge_channel_trylock(bridge_channel) _ast_bridge_channel_trylock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel) |
Try locking the bridge_channel. More... | |
#define | ast_bridge_channel_unlock(bridge_channel) _ast_bridge_channel_unlock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel) |
Unlock the bridge_channel. More... | |
Typedefs | |
typedef void(* | ast_bridge_custom_callback_fn) (struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size) |
Custom callback run on a bridge channel. More... | |
typedef void(* | ast_bridge_custom_play_fn) (struct ast_bridge_channel *bridge_channel, const char *playfile) |
Custom interpretation of the playfile name. More... | |
Enumerations | |
enum | ast_bridge_channel_custom_callback_option { AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA = (1 << 0) } |
enum | bridge_channel_state { BRIDGE_CHANNEL_STATE_WAIT = 0 , BRIDGE_CHANNEL_STATE_END , BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE } |
State information about a bridged channel. More... | |
enum | bridge_channel_thread_state { BRIDGE_CHANNEL_THREAD_IDLE , BRIDGE_CHANNEL_THREAD_SIMPLE , BRIDGE_CHANNEL_THREAD_FRAME } |
Functions | |
static void | _ast_bridge_channel_lock (struct ast_bridge_channel *bridge_channel, const char *file, const char *function, int line, const char *var) |
static int | _ast_bridge_channel_trylock (struct ast_bridge_channel *bridge_channel, const char *file, const char *function, int line, const char *var) |
static void | _ast_bridge_channel_unlock (struct ast_bridge_channel *bridge_channel, const char *file, const char *function, int line, const char *var) |
void | ast_bridge_channel_feature_digit (struct ast_bridge_channel *bridge_channel, int digit) |
Add a DTMF digit to the collected digits to match against DTMF features. More... | |
void | ast_bridge_channel_feature_digit_add (struct ast_bridge_channel *bridge_channel, int digit) |
Add a DTMF digit to the collected digits. More... | |
struct ast_channel * | ast_bridge_channel_get_chan (struct ast_bridge_channel *bridge_channel) |
Get a ref to the bridge_channel's ast_channel. More... | |
void | ast_bridge_channel_kick (struct ast_bridge_channel *bridge_channel, int cause) |
Kick the channel out of the bridge. More... | |
void | ast_bridge_channel_leave_bridge (struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause) |
Set bridge channel state to leave bridge (if not leaving already). More... | |
void | ast_bridge_channel_leave_bridge_nolock (struct ast_bridge_channel *bridge_channel, enum bridge_channel_state new_state, int cause) |
Set bridge channel state to leave bridge (if not leaving already). More... | |
void | ast_bridge_channel_lock_bridge (struct ast_bridge_channel *bridge_channel) |
Lock the bridge associated with the bridge channel. More... | |
struct ast_bridge * | ast_bridge_channel_merge_inhibit (struct ast_bridge_channel *bridge_channel, int request) |
Adjust the bridge_channel's bridge merge inhibit request count. More... | |
int | ast_bridge_channel_notify_talking (struct ast_bridge_channel *bridge_channel, int started_talking) |
Lets the bridging indicate when a bridge channel has stopped or started talking. More... | |
struct ast_bridge_channel * | ast_bridge_channel_peer (struct ast_bridge_channel *bridge_channel) |
Get the peer bridge channel of a two party bridge. More... | |
void | ast_bridge_channel_playfile (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class) |
Play a file on the bridge channel. More... | |
int | ast_bridge_channel_queue_app (struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class) |
Queue a bridge action run application frame onto the bridge channel. More... | |
int | ast_bridge_channel_queue_callback (struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_custom_callback_option flags, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size) |
Queue a bridge action custom callback frame onto the bridge channel. More... | |
int | ast_bridge_channel_queue_control_data (struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen) |
Queue a control frame onto the bridge channel with data. More... | |
int | ast_bridge_channel_queue_frame (struct ast_bridge_channel *bridge_channel, struct ast_frame *fr) |
Write a frame to the specified bridge_channel. More... | |
int | ast_bridge_channel_queue_playfile (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class) |
Queue a bridge action play file frame onto the bridge channel. More... | |
int | ast_bridge_channel_queue_playfile_sync (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class) |
Synchronously queue a bridge action play file frame onto the bridge channel. More... | |
void | ast_bridge_channel_restore_formats (struct ast_bridge_channel *bridge_channel) |
Restore the formats of a bridge channel's channel to how they were before bridge_channel_internal_join. More... | |
void | ast_bridge_channel_run_app (struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class) |
Run an application on the bridge channel. More... | |
void | ast_bridge_channel_stream_map (struct ast_bridge_channel *bridge_channel) |
Maps a channel's stream topology to and from the bridge. More... | |
void | ast_bridge_channel_update_accountcodes (struct ast_bridge_channel *joining, struct ast_bridge_channel *leaving) |
void | ast_bridge_channel_update_linkedids (struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap) |
int | ast_bridge_channel_write_app (struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class) |
Write a bridge action run application frame into the bridge. More... | |
int | ast_bridge_channel_write_callback (struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_custom_callback_option flags, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size) |
Write a bridge action custom callback frame into the bridge. More... | |
int | ast_bridge_channel_write_control_data (struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen) |
Write a control frame into the bridge with data. More... | |
int | ast_bridge_channel_write_hold (struct ast_bridge_channel *bridge_channel, const char *moh_class) |
Write a hold frame into the bridge. More... | |
int | ast_bridge_channel_write_park (struct ast_bridge_channel *bridge_channel, const char *parkee_uuid, const char *parker_uuid, const char *app_data) |
Have a bridge channel park a channel in the bridge. More... | |
int | ast_bridge_channel_write_playfile (struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class) |
Write a bridge action play file frame into the bridge. More... | |
int | ast_bridge_channel_write_unhold (struct ast_bridge_channel *bridge_channel) |
Write an unhold frame into the bridge. More... | |
#define ast_bridge_channel_lock | ( | bridge_channel | ) | _ast_bridge_channel_lock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel) |
Lock the bridge_channel.
bridge_channel | What to lock |
Definition at line 229 of file bridge_channel.h.
#define ast_bridge_channel_trylock | ( | bridge_channel | ) | _ast_bridge_channel_trylock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel) |
Try locking the bridge_channel.
bridge_channel | What to try locking |
0 | on success. |
non-zero | on error. |
Definition at line 218 of file bridge_channel.h.
#define ast_bridge_channel_unlock | ( | bridge_channel | ) | _ast_bridge_channel_unlock(bridge_channel, __FILE__, __PRETTY_FUNCTION__, __LINE__, #bridge_channel) |
Unlock the bridge_channel.
bridge_channel | What to unlock |
Definition at line 240 of file bridge_channel.h.
typedef void(* ast_bridge_custom_callback_fn) (struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size) |
Custom callback run on a bridge channel.
bridge_channel | Which channel to operate on. |
payload | Data to pass to the callback. (NULL if none). |
payload_size | Size of the payload if payload is non-NULL. A number otherwise. |
Definition at line 598 of file bridge_channel.h.
typedef void(* ast_bridge_custom_play_fn) (struct ast_bridge_channel *bridge_channel, const char *playfile) |
Custom interpretation of the playfile name.
bridge_channel | Which channel to play the file on |
playfile | Sound filename to play. |
Definition at line 514 of file bridge_channel.h.
Enumerator | |
---|---|
AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA | The callback temporarily affects media. (Like a custom playfile.) |
Definition at line 600 of file bridge_channel.h.
enum bridge_channel_state |
State information about a bridged channel.
Definition at line 60 of file bridge_channel.h.
Definition at line 69 of file bridge_channel.h.
|
inlinestatic |
Definition at line 230 of file bridge_channel.h.
References __ao2_lock(), AO2_LOCK_REQ_MUTEX, ast_channel::bridge_channel, make_ari_stubs::file, and var.
|
inlinestatic |
Definition at line 219 of file bridge_channel.h.
References __ao2_trylock(), AO2_LOCK_REQ_MUTEX, ast_channel::bridge_channel, make_ari_stubs::file, and var.
|
inlinestatic |
Definition at line 241 of file bridge_channel.h.
References __ao2_unlock(), ast_channel::bridge_channel, make_ari_stubs::file, and var.
void ast_bridge_channel_feature_digit | ( | struct ast_bridge_channel * | bridge_channel, |
int | digit | ||
) |
Add a DTMF digit to the collected digits to match against DTMF features.
bridge_channel | Channel that received a DTMF digit. |
digit | DTMF digit to add to collected digits or 0 for timeout event. |
Definition at line 1695 of file bridge_channel.c.
References ao2_find, ao2_ref, ao2_unlink, ARRAY_LEN, ast_bridge_channel_kick(), ast_bridge_channel_lock_bridge(), ast_bridge_unlock, ast_channel_name(), ast_check_hangup_locked(), AST_CONTROL_SRCUPDATE, ast_debug, ast_indicate(), ast_samp2tv(), ast_test_suite_event_notify, ast_tvadd(), ast_tvnow(), ast_bridge_channel::bridge, bridge_channel_feature_digit_add(), bridge_channel_feature_digit_timeout(), bridge_channel_internal_suspend_nolock(), bridge_channel_unsuspend(), bridge_channel_write_dtmf_stream(), ast_bridge_hook::callback, ast_bridge_channel::chan, ast_bridge_hook_dtmf_parms::code, ast_bridge_channel::collected, digit, ast_bridge_hook_dtmf::dtmf, ast_bridge_channel::dtmf_hook_state, ast_bridge_features::dtmf_hooks, ast_bridge_features::dtmf_passthrough, ast_bridge_channel::features, ast_bridge_hook_dtmf::generic, ast_bridge_hook::hook_pvt, ast_bridge_channel::interdigit_timeout, NULL, OBJ_SEARCH_PARTIAL_KEY, ast_bridge_channel::suspended, and testsuite_notify_feature_success().
Referenced by agent_alert(), bridge_channel_handle_feature_timeout(), bridge_channel_internal_join(), and bridge_handle_dtmf().
void ast_bridge_channel_feature_digit_add | ( | struct ast_bridge_channel * | bridge_channel, |
int | digit | ||
) |
Add a DTMF digit to the collected digits.
bridge_channel | Channel that received a DTMF digit. |
digit | DTMF digit to add to collected digits |
Definition at line 1687 of file bridge_channel.c.
References bridge_channel_feature_digit_add(), ast_bridge_channel::collected, digit, and ast_bridge_channel::dtmf_hook_state.
Referenced by play_file().
struct ast_channel * ast_bridge_channel_get_chan | ( | struct ast_bridge_channel * | bridge_channel | ) |
Get a ref to the bridge_channel's ast_channel.
bridge_channel | The bridge channel |
ref'd | ast_channel on success |
NULL | otherwise |
Definition at line 212 of file bridge_channel.c.
References ao2_bump, ao2_lock, ao2_unlock, ast_channel::bridge_channel, and ast_bridge_channel::chan.
Referenced by ast_bridge_channel_write_unhold().
void ast_bridge_channel_kick | ( | struct ast_bridge_channel * | bridge_channel, |
int | cause | ||
) |
Kick the channel out of the bridge.
bridge_channel | Which channel is being kicked or hungup. |
cause | Cause of channel being kicked. If cause <= 0 then use cause on channel if cause still <= 0 use AST_CAUSE_NORMAL_CLEARING. |
Definition at line 592 of file bridge_channel.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ao2_unlink, ast_bridge_channel_leave_bridge(), ast_bridge_channel_lock, ast_bridge_channel_unlock, AST_BRIDGE_HOOK_TYPE_HANGUP, ast_channel_name(), ast_debug, BRIDGE_CHANNEL_STATE_END, BRIDGE_CHANNEL_STATE_WAIT, ast_bridge_hook::callback, ast_bridge_channel::chan, channel_set_cause(), ast_bridge_channel::features, ast_bridge_hook::hook_pvt, ast_bridge_features::other_hooks, ast_bridge_channel::state, and ast_bridge_hook::type.
Referenced by ast_bridge_channel_feature_digit(), ast_bridge_channel_run_app(), bridge_channel_attended_transfer(), bridge_channel_blind_transfer(), bridge_channel_handle_action(), bridge_channel_internal_join(), bridge_handle_trip(), and kick_it().
void ast_bridge_channel_leave_bridge | ( | struct ast_bridge_channel * | bridge_channel, |
enum bridge_channel_state | new_state, | ||
int | cause | ||
) |
Set bridge channel state to leave bridge (if not leaving already).
bridge_channel | Channel to change the state on |
new_state | The new state to place the channel into |
cause | Cause of channel leaving bridge. If cause <= 0 then use cause on channel if cause still <= 0 use AST_CAUSE_NORMAL_CLEARING. |
Example usage:
This places the channel pointed to by bridge_channel into the state BRIDGE_CHANNEL_STATE_END if it was BRIDGE_CHANNEL_STATE_WAIT before.
Definition at line 315 of file bridge_channel.c.
References ast_bridge_channel_leave_bridge_nolock(), ast_bridge_channel_lock, and ast_bridge_channel_unlock.
Referenced by agent_connect_caller(), ast_bridge_channel_kick(), ast_bridge_depart(), ast_bridge_remove(), basic_hangup_hook(), bridge_agent_hold_heartbeat(), bridge_agent_hold_push(), bridge_channel_complete_join(), bridge_channel_dissolve_check(), bridge_channel_internal_push_full(), bridge_dissolve(), bridge_do_merge(), bridge_do_move(), bridge_features_duration_callback(), bridge_swap_attended_transfer(), bridgewait_timeout_callback(), caller_joined_bridge(), caller_safety_timeout(), feature_hangup(), parking_duration_callback(), say_parking_space(), set_softmix_bridge_data(), try_swap_optimize_out(), and user_timeout().
void ast_bridge_channel_leave_bridge_nolock | ( | struct ast_bridge_channel * | bridge_channel, |
enum bridge_channel_state | new_state, | ||
int | cause | ||
) |
Set bridge channel state to leave bridge (if not leaving already).
bridge_channel | Channel to change the state on |
new_state | The new state to place the channel into |
cause | Cause of channel leaving bridge. If cause <= 0 then use cause on channel if cause still <= 0 use AST_CAUSE_NORMAL_CLEARING. |
Example usage:
This places the channel pointed to by bridge_channel into the state BRIDGE_CHANNEL_STATE_END if it was BRIDGE_CHANNEL_STATE_WAIT before.
Definition at line 293 of file bridge_channel.c.
References ast_bridge_vars_set(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, bridge_channel_poke(), BRIDGE_CHANNEL_STATE_WAIT, ast_bridge_channel::chan, channel_set_cause(), NULL, and ast_bridge_channel::state.
Referenced by ast_bridge_channel_leave_bridge(), bridge_do_merge(), and caller_abort_agent().
void ast_bridge_channel_lock_bridge | ( | struct ast_bridge_channel * | bridge_channel | ) |
Lock the bridge associated with the bridge channel.
bridge_channel | Channel that wants to lock the bridge. |
This is an upstream lock operation. The defined locking order is bridge then bridge_channel.
Definition at line 223 of file bridge_channel.c.
References ao2_ref, ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_bridge_lock, ast_bridge_unlock, and ast_bridge_channel::bridge.
Referenced by action_toggle_binaural(), agent_alert(), ast_bridge_channel_feature_digit(), ast_bridge_channel_merge_inhibit(), ast_bridge_notify_masquerade(), basic_hangup_hook(), bridge_channel_handle_control(), bridge_channel_internal_join(), bridge_channel_suspend(), bridge_channel_unsuspend(), bridge_channel_wait(), bridge_channel_write_frame(), bridge_handle_trip(), check_binaural_position_change(), deferred_action(), feature_automixmonitor(), and parking_blind_transfer_park().
struct ast_bridge * ast_bridge_channel_merge_inhibit | ( | struct ast_bridge_channel * | bridge_channel, |
int | request | ||
) |
Adjust the bridge_channel's bridge merge inhibit request count.
bridge_channel | What to operate on. |
request | Inhibit request increment. (Positive to add requests. Negative to remove requests.) |
bridge | adjusted merge inhibit with reference count. |
Definition at line 370 of file bridge_channel.c.
References ao2_ref, ast_bridge_channel_lock_bridge(), ast_bridge_unlock, ast_bridge_channel::bridge, bridge_merge_inhibit_nolock(), and request().
Referenced by feature_attended_transfer().
int ast_bridge_channel_notify_talking | ( | struct ast_bridge_channel * | bridge_channel, |
int | started_talking | ||
) |
Lets the bridging indicate when a bridge channel has stopped or started talking.
bridge_channel | The bridge channel that has either started or stopped talking. |
started_talking | set to 1 when this indicates the channel has started talking set to 0 when this indicates the channel has stopped talking. |
0 | on success. |
-1 | on error. |
Definition at line 245 of file bridge_channel.c.
References ast_bridge_channel_queue_frame(), AST_FRAME_BRIDGE_ACTION, BRIDGE_CHANNEL_ACTION_TALKING_START, BRIDGE_CHANNEL_ACTION_TALKING_STOP, and ast_frame::frametype.
Referenced by clear_talking(), and softmix_bridge_write_voice().
struct ast_bridge_channel * ast_bridge_channel_peer | ( | struct ast_bridge_channel * | bridge_channel | ) |
Get the peer bridge channel of a two party bridge.
bridge_channel | What to get the peer of. |
peer | on success. |
NULL | no peer channel. |
Definition at line 322 of file bridge_channel.c.
References AST_LIST_TRAVERSE, ast_bridge_channel::bridge, ast_bridge::channels, ast_bridge_channel::in_bridge, NULL, and ast_bridge::num_channels.
Referenced by bridge_reconfigured_connected_line_update(), bridge_swap_attended_transfer(), parking_blind_transfer_park(), and try_swap_optimize_out().
void ast_bridge_channel_playfile | ( | struct ast_bridge_channel * | bridge_channel, |
ast_bridge_custom_play_fn | custom_play, | ||
const char * | playfile, | ||
const char * | moh_class | ||
) |
Play a file on the bridge channel.
bridge_channel | Which channel to play the file on |
custom_play | Call this function to play the playfile. (NULL if normal sound file to play) |
playfile | Sound filename to play. |
moh_class | MOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class. |
Definition at line 1262 of file bridge_channel.c.
References ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), ast_channel_flags(), ast_channel_latest_musicclass(), ast_channel_lock, ast_channel_unlock, AST_DIGIT_NONE, AST_FLAG_MOH, ast_moh_start(), ast_strdupa, ast_stream_and_wait(), ast_test_flag, ast_bridge_channel::chan, and NULL.
Referenced by bridge_channel_playfile().
int ast_bridge_channel_queue_app | ( | struct ast_bridge_channel * | bridge_channel, |
const char * | app_name, | ||
const char * | app_args, | ||
const char * | moh_class | ||
) |
Queue a bridge action run application frame onto the bridge channel.
bridge_channel | Which channel to put the frame onto |
app_name | Dialplan application name. |
app_args | Arguments for the application. (NULL or empty for no arguments) |
moh_class | MOH class to request bridge peers to hear while application is running. NULL if no MOH. Empty if default MOH class. |
0 | on success. |
-1 | on error. |
Definition at line 1256 of file bridge_channel.c.
References app_name(), bridge_channel_queue_action_data(), and payload_helper_app().
int ast_bridge_channel_queue_callback | ( | struct ast_bridge_channel * | bridge_channel, |
enum ast_bridge_channel_custom_callback_option | flags, | ||
ast_bridge_custom_callback_fn | callback, | ||
const void * | payload, | ||
size_t | payload_size | ||
) |
Queue a bridge action custom callback frame onto the bridge channel.
bridge_channel | Which channel to put the frame onto. |
flags | Custom callback option flags. |
callback | Custom callback run on a bridge channel. |
payload | Data to pass to the callback. (NULL if none). |
payload_size | Size of the payload if payload is non-NULL. A number otherwise. |
0 | on success. |
-1 | on error. |
Definition at line 1429 of file bridge_channel.c.
References bridge_channel_queue_action_data(), bridge_custom_callback::callback, bridge_custom_callback::flags, bridge_custom_callback::payload, payload_helper_cb(), and bridge_custom_callback::payload_size.
Referenced by ast_bridge_kick(), defer_action(), handle_bridge_kick_channel(), and send_alert_to_agent().
int ast_bridge_channel_queue_control_data | ( | struct ast_bridge_channel * | bridge_channel, |
enum ast_control_frame_type | control, | ||
const void * | data, | ||
size_t | datalen | ||
) |
Queue a control frame onto the bridge channel with data.
bridge_channel | Which channel to queue the frame onto. |
control | Type of control frame. |
data | Frame payload data to pass. |
datalen | Frame payload data length to pass. |
0 | on success. |
-1 | on error. |
Definition at line 1104 of file bridge_channel.c.
References ast_bridge_channel_queue_frame(), AST_FRAME_CONTROL, ast_frame::data, ast_frame::datalen, and ast_frame::frametype.
Referenced by bridge_reconfigured_connected_line_update(), and send_colp_to_agent().
int ast_bridge_channel_queue_frame | ( | struct ast_bridge_channel * | bridge_channel, |
struct ast_frame * | fr | ||
) |
Write a frame to the specified bridge_channel.
bridge_channel | Channel to queue the frame. |
fr | Frame to write. |
0 | on success. |
-1 | on error. |
Definition at line 1005 of file bridge_channel.c.
References ast_bridge_channel::alert_pipe, ast_alertpipe_write(), ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_channel_name(), AST_FRAME_DTMF_BEGIN, AST_FRAME_DTMF_END, AST_FRAME_IMAGE, AST_FRAME_NULL, AST_FRAME_RTCP, AST_FRAME_TEXT, AST_FRAME_TEXT_DATA, AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_frdup, ast_is_deferrable_frame(), AST_LIST_INSERT_TAIL, ast_log, AST_MSG_DATA_ATTR_BODY, AST_MSG_DATA_ATTR_FROM, AST_MSG_DATA_ATTR_TO, ast_msg_data_get_attribute(), AST_VECTOR_GET, AST_VECTOR_SIZE, BRIDGE_CHANNEL_STATE_WAIT, bridge_frame_free(), ast_bridge_channel::chan, ast_frame::data, ast_frame::datalen, DEBUG_ATLEAST, ast_bridge_channel::features, ast_frame::frametype, LOG_DEBUG, LOG_ERROR, ast_frame::ptr, ast_bridge_channel::state, ast_bridge_channel::stream_map, ast_frame::stream_num, ast_bridge_channel::suspended, ast_bridge_features::text_messaging, ast_bridge_channel::to_channel, and ast_bridge_channel::wr_queue.
Referenced by ast_bridge_channel_notify_talking(), ast_bridge_channel_queue_control_data(), ast_bridge_queue_everyone_else(), bridge_channel_queue_action_data(), bridge_channel_queue_action_data_sync(), remb_send_report(), send_message(), softmix_mixing_loop(), and softmix_pass_video_top_priority().
int ast_bridge_channel_queue_playfile | ( | struct ast_bridge_channel * | bridge_channel, |
ast_bridge_custom_play_fn | custom_play, | ||
const char * | playfile, | ||
const char * | moh_class | ||
) |
Queue a bridge action play file frame onto the bridge channel.
bridge_channel | Which channel to put the frame onto. |
custom_play | Call this function to play the playfile. (NULL if normal sound file to play) |
playfile | Sound filename to play. |
moh_class | MOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class. |
0 | on success. |
-1 | on error. |
Definition at line 1343 of file bridge_channel.c.
References bridge_channel_queue_action_data(), bridge_playfile::custom_play, payload_helper_playfile(), and bridge_playfile::playfile.
Referenced by ast_bridge_add_channel(), bridge_parking_pull(), bridge_parking_push(), check_bridge_play_sound(), feature_automixmonitor(), parker_parked_call_message_response(), play_sound(), start_automixmonitor(), and stop_automixmonitor().
int ast_bridge_channel_queue_playfile_sync | ( | struct ast_bridge_channel * | bridge_channel, |
ast_bridge_custom_play_fn | custom_play, | ||
const char * | playfile, | ||
const char * | moh_class | ||
) |
Synchronously queue a bridge action play file frame onto the bridge channel.
bridge_channel | Which channel to put the frame onto. |
custom_play | Call this function to play the playfile. (NULL if normal sound file to play) |
playfile | Sound filename to play. |
moh_class | MOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class. |
This function will block until the queued frame has been destroyed. This will happen either if an error occurs or if the queued playback finishes.
0 | The playback was successfully queued. |
-1 | The playback could not be queued. |
Definition at line 1349 of file bridge_channel.c.
References bridge_channel_queue_action_data_sync(), bridge_playfile::custom_play, payload_helper_playfile(), and bridge_playfile::playfile.
Referenced by parker_parked_call_message_response(), and play_uri().
void ast_bridge_channel_restore_formats | ( | struct ast_bridge_channel * | bridge_channel | ) |
Restore the formats of a bridge channel's channel to how they were before bridge_channel_internal_join.
bridge_channel | Channel to restore |
Definition at line 338 of file bridge_channel.c.
References ast_assert, ast_channel_lock, ast_channel_name(), ast_channel_readformat(), ast_channel_unlock, ast_channel_writeformat(), ast_debug, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), ast_set_read_format(), ast_set_write_format(), ast_bridge_channel::chan, NULL, ast_bridge_channel::read_format, and ast_bridge_channel::write_format.
Referenced by bridge_channel_internal_join(), and participant_reaction_announcer_leave().
void ast_bridge_channel_run_app | ( | struct ast_bridge_channel * | bridge_channel, |
const char * | app_name, | ||
const char * | app_args, | ||
const char * | moh_class | ||
) |
Run an application on the bridge channel.
bridge_channel | Which channel to run the application on. |
app_name | Dialplan application name. |
app_args | Arguments for the application. (NULL tolerant) |
moh_class | MOH class to request bridge peers to hear while application is running. NULL if no MOH. Empty if default MOH class. |
Definition at line 1184 of file bridge_channel.c.
References app_name(), ast_bridge_channel_kick(), ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), AST_CAUSE_NORMAL_CLEARING, ast_channel::bridge_channel, ast_bridge_channel::chan, run_app_helper(), and S_OR.
Referenced by bridge_channel_run_app(), and dynamic_dtmf_hook_callback().
void ast_bridge_channel_stream_map | ( | struct ast_bridge_channel * | bridge_channel | ) |
Maps a channel's stream topology to and from the bridge.
When a channel joins a bridge or its associated stream topology is updated, each stream in the topology needs to be mapped according to its media type to the bridge. Calling this method creates a mapping of each stream on the channel indexed to the bridge's supported media types and vice versa (i.e. bridge's media types indexed to channel streams).
The first channel to join the bridge creates the initial order for the bridge's media types (e.g. a one to one mapping is made). Subsequently added channels are mapped to that order adding more media types if/when the newly added channel has more streams and/or media types specified by the bridge.
bridge_channel | Channel to map |
Definition at line 3119 of file bridge_channel.c.
References ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_channel_get_stream_topology(), ast_channel_lock, ast_channel_unlock, ast_stream_topology_map(), ast_bridge_channel::bridge, ast_bridge_channel::chan, ast_bridge::media_types, ast_bridge_channel::stream_map, ast_bridge_channel::to_bridge, and ast_bridge_channel::to_channel.
Referenced by bridge_channel_complete_join(), bridge_handle_trip(), native_rtp_stream_topology_changed(), simple_bridge_stream_topology_changed(), and softmix_bridge_stream_topology_changed().
void ast_bridge_channel_update_accountcodes | ( | struct ast_bridge_channel * | joining, |
struct ast_bridge_channel * | leaving | ||
) |
Definition at line 583 of file bridge_channel.c.
References bridge_channel_update_accountcodes_joining(), and bridge_channel_update_accountcodes_leaving().
Referenced by bridge_basic_pull(), bridge_basic_push(), bridge_stasis_pull(), and bridge_stasis_push().
void ast_bridge_channel_update_linkedids | ( | struct ast_bridge_channel * | bridge_channel, |
struct ast_bridge_channel * | swap | ||
) |
Definition at line 382 of file bridge_channel.c.
References ast_channel_internal_copy_linkedid(), ast_channel_internal_oldest_linkedid(), ast_channel_lock, ast_channel_unlock, AST_LIST_TRAVERSE, ast_bridge_channel::bridge, ast_channel::bridge, ast_channel::bridge_channel, ast_bridge_channel::chan, and ast_bridge::channels.
Referenced by bridge_basic_push(), and bridge_stasis_push().
int ast_bridge_channel_write_app | ( | struct ast_bridge_channel * | bridge_channel, |
const char * | app_name, | ||
const char * | app_args, | ||
const char * | moh_class | ||
) |
Write a bridge action run application frame into the bridge.
bridge_channel | Which channel is putting the frame into the bridge |
app_name | Dialplan application name. |
app_args | Arguments for the application. (NULL or empty for no arguments) |
moh_class | MOH class to request bridge peers to hear while application is running. NULL if no MOH. Empty if default MOH class. |
0 | on success. |
-1 | on error. |
Definition at line 1250 of file bridge_channel.c.
References app_name(), bridge_channel_write_action_data(), and payload_helper_app().
int ast_bridge_channel_write_callback | ( | struct ast_bridge_channel * | bridge_channel, |
enum ast_bridge_channel_custom_callback_option | flags, | ||
ast_bridge_custom_callback_fn | callback, | ||
const void * | payload, | ||
size_t | payload_size | ||
) |
Write a bridge action custom callback frame into the bridge.
bridge_channel | Which channel is putting the frame into the bridge |
flags | Custom callback option flags. |
callback | Custom callback run on a bridge channel. |
payload | Data to pass to the callback. (NULL if none). |
payload_size | Size of the payload if payload is non-NULL. A number otherwise. |
0 | on success. |
-1 | on error. |
Definition at line 1421 of file bridge_channel.c.
References bridge_channel_write_action_data(), bridge_custom_callback::callback, bridge_custom_callback::flags, bridge_custom_callback::payload, payload_helper_cb(), and bridge_custom_callback::payload_size.
Referenced by agent_connect_caller(), and dynamic_dtmf_hook_trip().
int ast_bridge_channel_write_control_data | ( | struct ast_bridge_channel * | bridge_channel, |
enum ast_control_frame_type | control, | ||
const void * | data, | ||
size_t | datalen | ||
) |
Write a control frame into the bridge with data.
bridge_channel | Which channel is putting the frame into the bridge. |
control | Type of control frame. |
data | Frame payload data to pass. |
datalen | Frame payload data length to pass. |
0 | on success. |
-1 | on error. |
Definition at line 1116 of file bridge_channel.c.
References AST_FRAME_CONTROL, bridge_channel_write_frame(), ast_frame::data, ast_frame::datalen, and ast_frame::frametype.
Referenced by agent_connect_caller(), ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), and ringing().
int ast_bridge_channel_write_hold | ( | struct ast_bridge_channel * | bridge_channel, |
const char * | moh_class | ||
) |
Write a hold frame into the bridge.
bridge_channel | Which channel is putting the hold into the bridge. |
moh_class | The suggested music class for the other end to use. |
0 | on success. |
-1 | on error. |
Definition at line 1128 of file bridge_channel.c.
References ast_bridge_channel_write_control_data(), ast_channel_hold_type(), ast_channel_publish_cached_blob(), AST_CONTROL_HOLD, ast_json_pack(), ast_json_unref(), ast_strlen_zero(), ast_bridge_channel::chan, and NULL.
Referenced by ast_bridge_channel_playfile(), ast_bridge_channel_run_app(), feature_attended_transfer(), feature_blind_transfer(), and hold().
int ast_bridge_channel_write_park | ( | struct ast_bridge_channel * | bridge_channel, |
const char * | parkee_uuid, | ||
const char * | parker_uuid, | ||
const char * | app_data | ||
) |
Have a bridge channel park a channel in the bridge.
bridge_channel | Bridge channel performing the parking |
parkee_uuid | Unique id of the channel we want to park |
parker_uuid | Unique id of the channel parking the call |
app_data | string indicating data used for park application (NULL allowed) |
0 | on success. |
-1 | on error. |
Definition at line 1492 of file bridge_channel.c.
References bridge_channel_write_action_data(), bridge_park::parkee_uuid, and payload_helper_park().
Referenced by manager_park_bridged(), and parking_blind_transfer_park().
int ast_bridge_channel_write_playfile | ( | struct ast_bridge_channel * | bridge_channel, |
ast_bridge_custom_play_fn | custom_play, | ||
const char * | playfile, | ||
const char * | moh_class | ||
) |
Write a bridge action play file frame into the bridge.
bridge_channel | Which channel is putting the frame into the bridge |
custom_play | Call this function to play the playfile. (NULL if normal sound file to play) |
playfile | Sound filename to play. |
moh_class | MOH class to request bridge peers to hear while file is played. NULL if no MOH. Empty if default MOH class. |
0 | on success. |
-1 | on error. |
Definition at line 1337 of file bridge_channel.c.
References bridge_channel_write_action_data(), bridge_playfile::custom_play, payload_helper_playfile(), and bridge_playfile::playfile.
Referenced by ast_bridge_transfer_attended(), start_automixmonitor(), and stop_automixmonitor().
int ast_bridge_channel_write_unhold | ( | struct ast_bridge_channel * | bridge_channel | ) |
Write an unhold frame into the bridge.
bridge_channel | Which channel is putting the hold into the bridge. |
0 | on success. |
-1 | on error. |
Definition at line 1154 of file bridge_channel.c.
References ao2_ref, ast_bridge_channel_get_chan(), ast_bridge_channel_write_control_data(), ast_channel_publish_cached_blob(), ast_channel_unhold_type(), AST_CONTROL_UNHOLD, ast_channel::bridge_channel, and NULL.
Referenced by ast_bridge_channel_playfile(), ast_bridge_channel_run_app(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), feature_attended_transfer(), feature_blind_transfer(), and unhold().