Asterisk - The Open Source Telephony Project
21.4.1
|
Basic bridge class. It is a subclass of struct ast_bridge. More...
#include "asterisk.h"
#include "asterisk/channel.h"
#include "asterisk/utils.h"
#include "asterisk/linkedlists.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_internal.h"
#include "asterisk/bridge_basic.h"
#include "asterisk/bridge_after.h"
#include "asterisk/astobj2.h"
#include "asterisk/features_config.h"
#include "asterisk/pbx.h"
#include "asterisk/file.h"
#include "asterisk/app.h"
#include "asterisk/dial.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/features.h"
#include "asterisk/format_cache.h"
#include "asterisk/test.h"
Go to the source code of this file.
Data Structures | |
struct | attended_transfer_properties |
Collection of data related to an attended transfer attempt. More... | |
struct | attended_transfer_state_properties |
Properties of an attended transfer state. More... | |
struct | bridge_basic_personality |
structure that organizes different personalities for basic bridges. More... | |
struct | dynamic_dtmf_hook_data |
struct | dynamic_dtmf_hook_run |
struct | personality_details |
Details for specific basic bridge personalities. More... | |
struct | stimulus_list |
Macros | |
#define | NORMAL_FLAGS |
#define | TRANSFER_FLAGS AST_BRIDGE_FLAG_SMART |
Functions | |
static int | add_normal_hooks (struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel) |
static int | add_transferer_role (struct ast_channel *chan, struct ast_bridge_features_attended_transfer *attended_transfer) |
struct ast_bridge * | ast_bridge_basic_new (void) |
Create a new basic class bridge. More... | |
void | ast_bridge_basic_set_flags (struct ast_bridge *bridge, unsigned int flags) |
Set feature flags on a basic bridge. More... | |
int | ast_bridge_features_ds_append (struct ast_channel *chan, struct ast_flags *flags) |
Append basic bridge DTMF feature flags on the channel. More... | |
struct ast_flags * | ast_bridge_features_ds_get (struct ast_channel *chan) |
Get DTMF feature flags from the channel. More... | |
int | ast_bridge_features_ds_get_string (struct ast_channel *chan, char *buffer, size_t buf_size) |
writes a channel's DTMF features to a buffer string More... | |
int | ast_bridge_features_ds_set (struct ast_channel *chan, struct ast_flags *flags) |
Set basic bridge DTMF feature flags datastore on the channel. More... | |
int | ast_bridge_features_ds_set_string (struct ast_channel *chan, const char *features) |
Sets the features a channel will use upon being bridged. More... | |
void | ast_bridging_init_basic (void) |
static int | attach_framehook (struct attended_transfer_properties *props, struct ast_channel *channel) |
static void * | attended_transfer_monitor_thread (void *data) |
The main loop for the attended transfer monitor thread. More... | |
static struct attended_transfer_properties * | attended_transfer_properties_alloc (struct ast_channel *transferer, const char *context) |
Allocate and initialize attended transfer properties. More... | |
static void | attended_transfer_properties_destructor (void *obj) |
static void | attended_transfer_properties_shutdown (struct attended_transfer_properties *props) |
Initiate shutdown of attended transfer properties. More... | |
static int | atxfer_abort (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
DTMF hook when transferer presses abort sequence. More... | |
static int | atxfer_complete (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
DTMF hook when transferer presses complete sequence. More... | |
static int | atxfer_swap (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
DTMF hook when transferer presses swap sequence. More... | |
static int | atxfer_threeway (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
DTMF hook when transferer presses threeway sequence. More... | |
static int | atxfer_transferer_hangup (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
Hangup hook for transferer channel. More... | |
static int | basic_hangup_hook (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static void | blind_transfer_cb (struct ast_channel *new_channel, struct transfer_channel_data *user_data_wrapper, enum ast_transfer_type transfer_type) |
static int | blond_enter (struct attended_transfer_properties *props) |
static int | blond_nonfinal_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | blond_nonfinal_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | bridge_basic_change_personality (struct ast_bridge *bridge, enum bridge_basic_personality_type type, void *user_data) |
Change basic bridge personality. More... | |
static void | bridge_basic_destroy (struct ast_bridge *self) |
static struct ast_bridge * | bridge_basic_personality_alloc (struct ast_bridge *bridge) |
static void | bridge_basic_pull (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel) |
static int | bridge_basic_push (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap) |
static int | bridge_basic_setup_features (struct ast_bridge_channel *bridge_channel) |
static int | bridge_features_ds_set_full (struct ast_channel *chan, struct ast_flags *flags, int replace) |
static void | bridge_hold (struct ast_bridge *bridge) |
Helper method to send a hold frame to all channels in a bridge. | |
static void | bridge_merge (struct ast_bridge *dest, struct ast_bridge *src, struct ast_channel **kick_channels, unsigned int num_channels) |
Wrapper for bridge_do_merge. | |
static void | bridge_move (struct ast_bridge *dest, struct ast_bridge *src, struct ast_channel *channel, struct ast_channel *swap) |
Wrapper for bridge_do_move. | |
static void | bridge_personality_atxfer_pull (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel) |
static int | bridge_personality_atxfer_push (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap) |
static int | bridge_personality_normal_push (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap) |
static void | bridge_ringing (struct ast_bridge *bridge) |
Helper method to send a ringing indication to all channels in a bridge. | |
static void | bridge_unhold (struct ast_bridge *bridge) |
Helper method to send an unhold frame to all channels in a bridge. | |
static int | build_dtmf_features (struct ast_flags *flags, const char *features) |
static int | builtin_feature_get_exten (struct ast_channel *chan, const char *feature_name, char *buf, size_t len) |
static int | builtin_features_helper (struct ast_bridge_features *features, struct ast_channel *chan, struct ast_flags *flags, unsigned int feature_flag, const char *feature_name, enum ast_bridge_builtin_feature feature_bridge) |
static int | calling_target_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | calling_target_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | clear_stimulus_queue (struct attended_transfer_properties *props) |
Free backlog of stimuli in the queue. | |
static void | common_recall_channel_setup (struct ast_channel *recall, struct ast_channel *transferer) |
static int | complete_enter (struct attended_transfer_properties *props) |
static int | consulting_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | consulting_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | copy_caller_data (struct ast_channel *dest, struct ast_channel *caller) |
static struct ast_channel * | dial_transfer (struct ast_channel *caller, const char *destination) |
Helper function that creates an outgoing channel and returns it immediately. | |
static int | double_checking_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | double_checking_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static int | dtmf_features_flags_to_string (struct ast_flags *feature_flags, char *buffer, size_t buffer_size) |
static int | dynamic_dtmf_hook_add (struct ast_bridge_features *features, unsigned int flags, const char *dtmf, const char *feature_name, const char *app_name, const char *app_args, const char *moh_class) |
static void | dynamic_dtmf_hook_callback (struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size) |
static int | dynamic_dtmf_hook_trip (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static int | fail_enter (struct attended_transfer_properties *props) |
static int | feature_attended_transfer (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
Internal built in feature for attended transfers. More... | |
static int | feature_blind_transfer (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
Internal built in feature for blind transfers. | |
static const char * | get_transfer_context (struct ast_channel *transferer, const char *context) |
static const char * | get_transfer_exten (struct ast_channel *transferer, const char *exten) |
static void | get_transfer_parties (struct ast_channel *transferer, struct ast_bridge *transferee_bridge, struct ast_bridge *target_bridge, struct ast_channel **transferee, struct ast_channel **transfer_target) |
determine transferee and transfer target for an attended transfer More... | |
static void | get_transfer_parties_transferer_bridge (struct ast_bridge *transferer_bridge, struct ast_bridge *other_bridge, struct ast_channel *transferer, struct ast_channel **transferer_peer, struct ast_channel **other_party) |
Get the transferee and transfer target when the transferer is in a bridge with one of the desired parties. More... | |
static void | get_transfer_party_non_transferer_bridge (struct ast_bridge *bridge, struct ast_channel **party) |
Get a desired transfer party for a bridge the transferer is not in. More... | |
static int | grab_transfer (struct ast_channel *chan, char *exten, size_t exten_len, const char *context) |
Helper function that presents dialtone and grabs extension. More... | |
static int | hesitant_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | hesitant_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | hold (struct ast_channel *chan) |
Helper method to place a channel in a bridge on hold. | |
static void | init_details (struct personality_details *details, enum bridge_basic_personality_type type) |
static void | on_personality_change_normal (struct ast_bridge *bridge) |
static void | personality_destructor (void *obj) |
static void | play_failsound (struct ast_channel *chan) |
Helper method to play a fail sound on a channel in a bridge. More... | |
static void | play_sound (struct ast_channel *chan, const char *sound) |
Helper method to play a sound on a channel in a bridge. More... | |
static void | publish_transfer_fail (struct attended_transfer_properties *props) |
Send a stasis publication for a failed attended transfer. | |
static void | publish_transfer_success (struct attended_transfer_properties *props, struct ast_channel *transferee_channel, struct ast_channel *target_channel) |
Send a stasis publication for a successful attended transfer. | |
static void | publish_transfer_threeway (struct attended_transfer_properties *props, struct ast_channel *transferee_channel, struct ast_channel *target_channel) |
Send a stasis publication for an attended transfer that ends in a threeway call. | |
static int | rebridge_enter (struct attended_transfer_properties *props) |
static void | recall_callback (struct ast_dial *dial) |
Dial callback when attempting to recall the original transferer channel. More... | |
static void | recall_pull (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct attended_transfer_properties *props) |
static int | recalling_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | recalling_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | remove_attended_transfer_stimulus (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | remove_hooks_on_personality_change (struct ast_bridge *bridge) |
Remove appropriate hooks when basic bridge personality changes. More... | |
static int | resume_enter (struct attended_transfer_properties *props) |
static int | retransfer_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | retransfer_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | ringing (struct ast_channel *chan) |
Helper method to send a ringing indication to a channel in a bridge. | |
static int | set_feature_flag_from_char (struct ast_flags *feature_flags, char feature) |
static int | setup_bridge_features_builtin (struct ast_bridge_features *features, struct ast_channel *chan) |
static int | setup_bridge_features_dynamic (struct ast_bridge_features *features, struct ast_channel *chan) |
static int | setup_dynamic_feature (void *obj, void *arg, void *data, int flags) |
static void | stimulate_attended_transfer (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static void | stream_failsound (struct ast_channel *chan) |
Helper method to stream a fail sound on a channel. More... | |
static int | threeway_enter (struct attended_transfer_properties *props) |
static void | transfer_pull (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct attended_transfer_properties *props) |
static struct ast_frame * | transfer_target_framehook_cb (struct ast_channel *chan, struct ast_frame *frame, enum ast_framehook_event event, void *data) |
Frame hook for transfer target channel. More... | |
static int | transfer_target_framehook_consume (void *data, enum ast_frame_type type) |
Callback function which informs upstream if we are consuming a frame of a specific type. | |
static void | transfer_target_framehook_destroy_cb (void *data) |
static void | unhold (struct ast_channel *chan) |
Helper method to take a channel in a bridge off hold. | |
static enum attended_transfer_stimulus | wait_for_stimulus (struct attended_transfer_properties *props) |
static int | wait_to_recall_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | wait_to_recall_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
static int | wait_to_retransfer_enter (struct attended_transfer_properties *props) |
static enum attended_transfer_state | wait_to_retransfer_exit (struct attended_transfer_properties *props, enum attended_transfer_stimulus stimulus) |
Variables | |
struct ast_bridge_methods | ast_bridge_basic_v_table |
Bridge basic class virtual method table. | |
static const struct ast_datastore_info | dtmf_features_info |
struct ast_bridge_methods | personality_atxfer_v_table |
struct ast_bridge_methods | personality_normal_v_table |
static const struct attended_transfer_state_properties | state_properties [] |
const char * | stimulus_strs [] |
String representations of the various stimuli. More... | |
Basic bridge class. It is a subclass of struct ast_bridge.
See Also:
Definition in file bridge_basic.c.
#define NORMAL_FLAGS |
Definition at line 51 of file bridge_basic.c.
The states in the attended transfer state machine.
Definition at line 773 of file bridge_basic.c.
Flags that indicate properties of attended transfer states.
Definition at line 1955 of file bridge_basic.c.
Stimuli that can cause transfer state changes.
Definition at line 1235 of file bridge_basic.c.
Attended transfer superstates.
An attended transfer's progress is facilitated by a state machine. The individual states of the state machine fall into the realm of one of two superstates.
Definition at line 736 of file bridge_basic.c.
Definition at line 58 of file bridge_basic.c.
struct ast_bridge* ast_bridge_basic_new | ( | void | ) |
Create a new basic class bridge.
NULL | on failure |
Example usage:
This creates a basic two party bridge with any configured DTMF features enabled that will be destroyed once one of the channels hangs up.
Definition at line 3661 of file bridge_basic.c.
References ast_bridge_basic_v_table, AST_BRIDGE_CAPABILITY_1TO1MIX, AST_BRIDGE_CAPABILITY_MULTIMIX, AST_BRIDGE_CAPABILITY_NATIVE, bridge_base_init(), and bridge_register().
Referenced by action_bridge(), agent_request_exec(), ast_bridge_call_with_flags(), bridge_exec(), and feature_attended_transfer().
void ast_bridge_basic_set_flags | ( | struct ast_bridge * | bridge, |
unsigned int | flags | ||
) |
Set feature flags on a basic bridge.
Using this function instead of setting flags directly will ensure that after operations such as an attended transfer, the bridge will maintain the flags that were set on it.
bridge | |
flags | These are added to the flags already set. |
Definition at line 3674 of file bridge_basic.c.
References ast_bridge_lock, ast_bridge_unlock, personality_details::bridge_flags, bridge_basic_personality::current, bridge_basic_personality::details, ast_bridge::feature_flags, lock, ast_bridge::personality, and SCOPED_LOCK.
Referenced by ast_bridge_call_with_flags().
int ast_bridge_features_ds_append | ( | struct ast_channel * | chan, |
struct ast_flags * | flags | ||
) |
Append basic bridge DTMF feature flags on the channel.
chan | Channel to append DTMF features datastore. |
flags | Builtin DTMF feature flags. (ast_bridge_config flags) |
0 | on success. |
-1 | on error. |
Definition at line 263 of file bridge_basic.c.
struct ast_flags* ast_bridge_features_ds_get | ( | struct ast_channel * | chan | ) |
Get DTMF feature flags from the channel.
chan | Channel to get DTMF features datastore. |
NULL | if the datastore does not exist. |
Definition at line 268 of file bridge_basic.c.
References ast_channel_datastore_find(), and ast_datastore::data.
Referenced by ast_bridge_features_ds_get_string(), attended_transfer_properties_alloc(), and parked_call_retrieve_enable_features().
int ast_bridge_features_ds_get_string | ( | struct ast_channel * | chan, |
char * | buffer, | ||
size_t | buf_size | ||
) |
writes a channel's DTMF features to a buffer string
chan | channel whose feature flags should be checked |
buffer | pointer string buffer where the output should be stored |
buf_size | size of the provided buffer (ideally enough for all features, 6+) |
0 | on successful write |
-1 | on failure |
Definition at line 208 of file bridge_basic.c.
References ast_bridge_features_ds_get().
int ast_bridge_features_ds_set | ( | struct ast_channel * | chan, |
struct ast_flags * | flags | ||
) |
Set basic bridge DTMF feature flags datastore on the channel.
chan | Channel to set DTMF features datastore. |
flags | Builtin DTMF feature flags. (ast_bridge_config flags) |
0 | on success. |
-1 | on error. |
Definition at line 258 of file bridge_basic.c.
Referenced by ast_bridge_features_ds_set_string(), and parked_call_retrieve_enable_features().
int ast_bridge_features_ds_set_string | ( | struct ast_channel * | chan, |
const char * | features | ||
) |
Sets the features a channel will use upon being bridged.
chan | Which channel to set features for |
features | Which feature codes to set for the channel |
0 | on success |
-1 | on failure |
Definition at line 189 of file bridge_basic.c.
References ast_bridge_features_ds_set().
void ast_bridging_init_basic | ( | void | ) |
Initialize the basic bridge class for use by the system.
Definition at line 3683 of file bridge_basic.c.
References ast_bridge_base_v_table, ast_bridge_basic_v_table, AST_BRIDGE_BUILTIN_ATTENDEDTRANSFER, AST_BRIDGE_BUILTIN_BLINDTRANSFER, ast_bridge_features_register(), ast_bridge_methods::destroy, feature_attended_transfer(), feature_blind_transfer(), ast_bridge_methods::name, ast_bridge_methods::pull, and ast_bridge_methods::push.
Referenced by ast_bridging_init().
|
static |
The main loop for the attended transfer monitor thread.
This loop runs continuously until the attended transfer reaches a terminal state. Stimuli for changes in the attended transfer state are handled in this thread so that all factors in an attended transfer can be handled in an orderly fashion.
data | The attended transfer properties |
Definition at line 3064 of file bridge_basic.c.
References ast_callid_threadassoc_add(), ast_callid_threadassoc_remove(), ast_debug, attended_transfer_properties_shutdown(), attended_transfer_state_properties::enter, attended_transfer_state_properties::exit, attended_transfer_state_properties::flags, attended_transfer_properties::state, attended_transfer_state_properties::state_name, TRANSFER_STATE_FLAG_TERMINAL, and attended_transfer_properties::transferer.
Referenced by feature_attended_transfer().
|
static |
Allocate and initialize attended transfer properties.
transferer | The channel performing the attended transfer |
context | Suggestion for what context the transfer target extension can be found in |
NULL | Failure to allocate or initialize |
non-NULL | Newly allocated properties |
Definition at line 1425 of file bridge_basic.c.
References ao2_ref, ast_bridge_features_ds_get(), ast_channel_ref, ast_debug, ast_party_connected_line_copy(), ast_strdupa, ast_string_field_init, ast_string_field_set, ast_features_xfer_config::atxfercallbackretries, attended_transfer_properties::atxfercallbackretries, ast_features_xfer_config::atxferdropcall, attended_transfer_properties::atxferdropcall, ast_features_xfer_config::atxferloopdelay, attended_transfer_properties::atxferloopdelay, ast_features_xfer_config::atxfernoanswertimeout, attended_transfer_properties::atxfernoanswertimeout, attended_transfer_properties::cond, attended_transfer_properties::original_transferer_colp, attended_transfer_properties::target_framehook_id, attended_transfer_properties::transferer, attended_transfer_properties::transferer_addr, attended_transfer_properties::transferer_features, attended_transfer_properties::transferer_type, ast_features_xfer_config::xfersound, and attended_transfer_properties::xfersound.
Referenced by feature_attended_transfer().
|
static |
Initiate shutdown of attended transfer properties.
Calling this indicates that the attended transfer properties are no longer needed because the transfer operation has concluded.
Definition at line 1524 of file bridge_basic.c.
References ast_bridge_destroy(), ast_bridge_merge_inhibit(), ast_channel_remove_bridge_role(), ast_debug, bridge_basic_change_personality(), BRIDGE_BASIC_PERSONALITY_NORMAL, clear_stimulus_queue(), attended_transfer_properties::target_bridge, attended_transfer_properties::transferee_bridge, and attended_transfer_properties::transferer.
Referenced by attended_transfer_monitor_thread(), and feature_attended_transfer().
|
static |
DTMF hook when transferer presses abort sequence.
Sends a stimulus to the attended transfer monitor thread that the abort sequence has been pressed
Definition at line 2761 of file bridge_basic.c.
References ast_debug, and STIMULUS_DTMF_ATXFER_ABORT.
|
static |
DTMF hook when transferer presses complete sequence.
Sends a stimulus to the attended transfer monitor thread that the complete sequence has been pressed
Definition at line 2775 of file bridge_basic.c.
References ast_debug, and STIMULUS_DTMF_ATXFER_COMPLETE.
|
static |
DTMF hook when transferer presses swap sequence.
Sends a stimulus to the attended transfer monitor thread that the swap sequence has been pressed
Definition at line 2803 of file bridge_basic.c.
References ast_debug, and STIMULUS_DTMF_ATXFER_SWAP.
|
static |
DTMF hook when transferer presses threeway sequence.
Sends a stimulus to the attended transfer monitor thread that the threeway sequence has been pressed
Definition at line 2789 of file bridge_basic.c.
References ast_debug, and STIMULUS_DTMF_ATXFER_THREEWAY.
|
static |
Hangup hook for transferer channel.
Sends a stimulus to the attended transfer monitor thread that the transferer has hung up.
Definition at line 2817 of file bridge_basic.c.
References ast_debug, and STIMULUS_TRANSFERER_HANGUP.
|
static |
Change basic bridge personality.
Changing personalities allows for the bridge to remain in use but have properties such as its v_table and its flags change.
bridge | The bridge |
type | The personality to change the bridge to |
user_data | Private data to attach to the personality. |
Definition at line 3574 of file bridge_basic.c.
References ao2_ref, ast_bridge_lock, ast_bridge_unlock, personality_details::bridge_flags, bridge_basic_personality::current, bridge_basic_personality::details, ast_bridge::feature_flags, lock, personality_details::on_personality_change, ast_bridge::personality, personality_details::pvt, remove_hooks_on_personality_change(), and SCOPED_LOCK.
Referenced by attended_transfer_properties_shutdown(), and feature_attended_transfer().
|
static |
Internal built in feature for attended transfers.
This hook will set up a thread for monitoring the progress of an attended transfer. For more information about attended transfer progress, see documentation on the transfer state machine.
bridge_channel | The channel that pressed the attended transfer DTMF sequence |
hook_pvt | Structure with further information about the attended transfer |
Definition at line 3340 of file bridge_basic.c.
References ao2_ref, ast_bridge_basic_new(), ast_bridge_channel_merge_inhibit(), ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_INDEPENDENT, ast_bridge_merge_inhibit(), ast_call(), ast_channel_ref, ast_debug, ast_hangup(), AST_MAX_CONTEXT, AST_MAX_EXTENSION, ast_string_field_set, attended_transfer_monitor_thread(), attended_transfer_properties_alloc(), attended_transfer_properties_shutdown(), bridge_basic_change_personality(), BRIDGE_BASIC_PERSONALITY_ATXFER, ast_bridge_channel::chan, ast_bridge_features_attended_transfer::context, attended_transfer_properties::context, dial_transfer(), attended_transfer_properties::exten, grab_transfer(), ast_bridge::inhibit_merge, ast_bridge_methods::name, stream_failsound(), attended_transfer_properties::target_bridge, thread, attended_transfer_properties::transfer_target, attended_transfer_properties::transferee_bridge, attended_transfer_properties::transferer, ast_bridge::uniqueid, and ast_bridge::v_table.
Referenced by ast_bridging_init_basic().
|
static |
determine transferee and transfer target for an attended transfer
In builtin attended transfers, there is a single transferer channel that jumps between the two bridges involved. At the time the attended transfer occurs, the transferer could be in either bridge, so determining the parties is a bit more complex than normal.
The method used here is to determine which of the two bridges the transferer is in, and grabbing the peer from that bridge. The other bridge, if it only has a single channel in it, has the other desired channel.
transferer | The channel performing the transfer | |
transferee_bridge | The bridge that the transferee is in | |
target_bridge | The bridge that the transfer target is in | |
[out] | transferee | The transferee channel |
[out] | transfer_target | The transfer target channel |
Definition at line 1634 of file bridge_basic.c.
References ast_channel_get_bridge(), get_transfer_parties_transferer_bridge(), and get_transfer_party_non_transferer_bridge().
|
static |
Get the transferee and transfer target when the transferer is in a bridge with one of the desired parties.
transferer_bridge | The bridge the transferer is in | |
other_bridge | The bridge the transferer is not in. May be NULL. | |
transferer | The transferer party | |
[out] | transferer_peer | The party that is in the bridge with the transferer |
[out] | other_party | The party that is in the other_bridge |
Definition at line 1609 of file bridge_basic.c.
References ast_bridge_peer(), and get_transfer_party_non_transferer_bridge().
Referenced by get_transfer_parties().
|
static |
Get a desired transfer party for a bridge the transferer is not in.
bridge | The bridge to get the party from. May be NULL. | |
[out] | party | The lone channel in the bridge. Will be set NULL if bridge is NULL or multiple parties are present. |
Definition at line 1589 of file bridge_basic.c.
References ast_channel_ref, AST_LIST_FIRST, ast_bridge::channels, and ast_bridge::num_channels.
Referenced by get_transfer_parties(), and get_transfer_parties_transferer_bridge().
|
static |
Helper function that presents dialtone and grabs extension.
0 | on success |
-1 | on failure |
Definition at line 3180 of file bridge_basic.c.
References ao2_ref, ast_app_dtget(), ast_copy_string(), AST_DIGIT_NONE, ast_exists_extension(), ast_stopstream(), ast_strdupa, ast_stream_and_wait(), ast_test_suite_event_notify, S_COR, ast_features_xfer_config::transferannouncesound, ast_features_xfer_config::transferdialattempts, ast_features_xfer_config::transferdigittimeout, ast_features_xfer_config::transferinvalidsound, and ast_features_xfer_config::transferretrysound.
Referenced by feature_attended_transfer(), and feature_blind_transfer().
|
static |
Helper method to play a fail sound on a channel in a bridge.
chan | The channel to play the fail sound to |
Definition at line 1752 of file bridge_basic.c.
References play_sound().
|
static |
Helper method to play a sound on a channel in a bridge.
chan | The channel to play the sound to |
sound | The sound to play |
Definition at line 1733 of file bridge_basic.c.
References ao2_ref, ast_bridge_channel_queue_playfile(), and ast_channel_get_bridge_channel().
Referenced by play_failsound().
|
static |
Dial callback when attempting to recall the original transferer channel.
This is how we can monitor if the recall target has answered or has hung up. If one of the two is detected, then an appropriate stimulus is sent to the attended transfer monitor thread.
Definition at line 2410 of file bridge_basic.c.
References ast_dial_answered_steal(), ast_dial_get_user_data(), AST_DIAL_RESULT_ANSWERED, AST_DIAL_RESULT_FAILED, AST_DIAL_RESULT_HANGUP, AST_DIAL_RESULT_INVALID, AST_DIAL_RESULT_PROCEEDING, AST_DIAL_RESULT_PROGRESS, AST_DIAL_RESULT_RINGING, AST_DIAL_RESULT_TIMEOUT, AST_DIAL_RESULT_TRYING, AST_DIAL_RESULT_UNANSWERED, ast_dial_state(), attended_transfer_properties::recall_target, STIMULUS_RECALL_TARGET_ANSWER, and STIMULUS_RECALL_TARGET_HANGUP.
|
static |
Remove appropriate hooks when basic bridge personality changes.
Hooks that have the AST_BRIDGE_HOOK_REMOVE_ON_PERSONALITY_CHANGE flag set will be removed from all bridge channels in the bridge.
bridge | Basic bridge undergoing personality change |
Definition at line 719 of file bridge_basic.c.
References ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_bridge_features_remove(), AST_BRIDGE_HOOK_REMOVE_ON_PERSONALITY_CHANGE, AST_LIST_TRAVERSE, ast_bridge::channels, ast_bridge_channel::features, lock, and SCOPED_LOCK.
Referenced by bridge_basic_change_personality().
|
static |
Helper method to stream a fail sound on a channel.
chan | The channel to stream the fail sound to |
Definition at line 1771 of file bridge_basic.c.
References AST_DIGIT_NONE, and ast_stream_and_wait().
Referenced by feature_attended_transfer().
|
static |
Frame hook for transfer target channel.
This is used to determine if the transfer target or recall target has answered the outgoing call.
When an answer is detected, a stimulus is sent to the attended transfer monitor thread to indicate that the transfer target or recall target has answered.
chan | The channel the framehook is attached to. |
frame | The frame being read or written. |
event | What is being done with the frame. |
data | The attended transfer properties. |
Definition at line 2840 of file bridge_basic.c.
References ast_check_hangup(), AST_CONTROL_ANSWER, ast_debug, AST_FRAME_CONTROL, ast_framehook_detach(), AST_FRAMEHOOK_EVENT_READ, ast_frame::frametype, ast_frame_subclass::integer, STIMULUS_RECALL_TARGET_ANSWER, STIMULUS_TRANSFER_TARGET_ANSWER, ast_frame::subclass, attended_transfer_properties::superstate, SUPERSTATE_TRANSFER, and attended_transfer_properties::target_framehook_id.
|
static |
Definition at line 82 of file bridge_basic.c.
const char* stimulus_strs[] |
String representations of the various stimuli.
Used for debugging purposes
Definition at line 1267 of file bridge_basic.c.