summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-06-06 22:46:54 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-06-06 22:46:54 +0000
commitbad8caa8c65ac1937ae1c85a0c5fb45f3e8a7fe4 (patch)
treed077d5d84638645d10508c15bb6f00538e8e1f64 /bridges
parent2dc8a060064f359a17f5ebcd515d85fe5203c019 (diff)
Reimplement bridging and DTMF features related channel variables in the bridging core.
* The channel variable ATTENDED_TRANSFER_COMPLETE_SOUND is no longer channel driver specific. If the channel variable is set on the transferrer channel, the sound will be played to the target of an attended transfer. * The channel variable BRIDGEPEER becomes a comma separated list of peers in a multi-party bridge. The BRIDGEPEER value can have a maximum of 10 peers listed. Any more peers in the bridge will not be included in the list. BRIDGEPEER is not valid in holding bridges like parking since those channels do not talk to each other even though they are in a bridge. * The channel variable BRIDGEPVTCALLID is only valid for two party bridges and will contain a value if the BRIDGEPEER's channel driver supports it. * The channel variable DYNAMIC_PEERNAME is redundant with BRIDGEPEER and is removed. The more useful DYNAMIC_WHO_ACTIVATED gives the channel name that activated the dynamic feature. * The channel variables DYNAMIC_FEATURENAME and DYNAMIC_WHO_ACTIVATED are set only on the channel executing the dynamic feature. Executing a dynamic feature on the bridge peer in a multi-party bridge will execute it on all peers of the activating channel. (closes issue ASTERISK-21555) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2582/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'bridges')
-rw-r--r--bridges/bridge_builtin_features.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/bridges/bridge_builtin_features.c b/bridges/bridge_builtin_features.c
index e11b280cd..3a081c83d 100644
--- a/bridges/bridge_builtin_features.c
+++ b/bridges/bridge_builtin_features.c
@@ -134,6 +134,9 @@ static struct ast_channel *dial_transfer(struct ast_channel *caller, const char
return NULL;
}
+ /* Who is transferring the call. */
+ pbx_builtin_setvar_helper(chan, "TRANSFERERNAME", ast_channel_name(caller));
+
/* Before we actually dial out let's inherit appropriate information. */
copy_caller_data(chan, caller);
@@ -275,6 +278,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg
struct ast_bridge_features caller_features;
int xfer_failed;
struct ast_bridge_features_attended_transfer *attended_transfer = hook_pvt;
+ const char *complete_sound;
const char *context;
enum atxfer_code transfer_code = ATXFER_INCOMPLETE;
const char *atxfer_abort;
@@ -407,6 +411,20 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg
ast_bridge_destroy(attended_bridge);
ast_bridge_features_cleanup(&caller_features);
+ /* Is there a courtesy sound to play to the peer? */
+ ast_channel_lock(bridge_channel->chan);
+ complete_sound = pbx_builtin_getvar_helper(bridge_channel->chan,
+ "ATTENDED_TRANSFER_COMPLETE_SOUND");
+ if (!ast_strlen_zero(complete_sound)) {
+ complete_sound = ast_strdupa(complete_sound);
+ } else {
+ complete_sound = NULL;
+ }
+ ast_channel_unlock(bridge_channel->chan);
+ if (complete_sound) {
+ pbx_builtin_setvar_helper(peer, "BRIDGE_PLAY_SOUND", complete_sound);
+ }
+
xfer_failed = -1;
switch (transfer_code) {
case ATXFER_INCOMPLETE: