diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-05-31 15:34:20 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-05-31 15:34:20 +0000 |
commit | ccc8cc5346f7f68f38b1749755777a33cd897f07 (patch) | |
tree | 994ae78a31cd77542073af477e3111795a3740b9 /bridges | |
parent | a1494300c935864074b000dc33590010c70e749b (diff) |
Fixup hold/unhold with attended and blind transfers.
* DTMF attended and blind transfers have hold/unhold behavior restored.
* External attended and blind transfers unhold the transfered party when
the transfer is initiated.
* Made prohibit blind transferring a bridge marked as masquerade only.
(ConfBridge bridges)
* Made running an application or playing a file inside a bridge post the
hold/unhold messages if MOH is requested.
Review: https://reviewboard.asterisk.org/r/2574/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/bridge_builtin_features.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bridges/bridge_builtin_features.c b/bridges/bridge_builtin_features.c index 0ae1e19f7..9574bb844 100644 --- a/bridges/bridge_builtin_features.c +++ b/bridges/bridge_builtin_features.c @@ -182,7 +182,8 @@ static int feature_blind_transfer(struct ast_bridge *bridge, struct ast_bridge_c const char *context; char *goto_on_blindxfr; -/* BUGBUG the peer needs to be put on hold for the transfer. */ + ast_bridge_channel_write_hold(bridge_channel, NULL); + ast_channel_lock(bridge_channel->chan); context = ast_strdupa(get_transfer_context(bridge_channel->chan, blind_transfer ? blind_transfer->context : NULL)); @@ -192,6 +193,7 @@ static int feature_blind_transfer(struct ast_bridge *bridge, struct ast_bridge_c /* Grab the extension to transfer to */ if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), context)) { + ast_bridge_channel_write_unhold(bridge_channel); return 0; } @@ -264,9 +266,10 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg const char *context; enum atxfer_code transfer_code = ATXFER_INCOMPLETE; + ast_bridge_channel_write_hold(bridge_channel, NULL); + bridge = ast_bridge_channel_merge_inhibit(bridge_channel, +1); -/* BUGBUG the peer needs to be put on hold for the transfer. */ ast_channel_lock(bridge_channel->chan); context = ast_strdupa(get_transfer_context(bridge_channel->chan, attended_transfer ? attended_transfer->context : NULL)); @@ -276,6 +279,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), context)) { ast_bridge_merge_inhibit(bridge, -1); ao2_ref(bridge, -1); + ast_bridge_channel_write_unhold(bridge_channel); return 0; } @@ -286,6 +290,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg ao2_ref(bridge, -1); /* BUGBUG beeperr needs to be configurable from features.conf */ ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE); + ast_bridge_channel_write_unhold(bridge_channel); return 0; } @@ -313,6 +318,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg ao2_ref(bridge, -1); /* BUGBUG beeperr needs to be configurable from features.conf */ ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE); + ast_bridge_channel_write_unhold(bridge_channel); return 0; } @@ -326,6 +332,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg ao2_ref(bridge, -1); /* BUGBUG beeperr needs to be configurable from features.conf */ ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE); + ast_bridge_channel_write_unhold(bridge_channel); return 0; } ast_bridge_merge_inhibit(attended_bridge, +1); @@ -340,6 +347,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg ao2_ref(bridge, -1); /* BUGBUG beeperr needs to be configurable from features.conf */ ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE); + ast_bridge_channel_write_unhold(bridge_channel); return 0; } @@ -384,6 +392,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg break; case ATXFER_COMPLETE: /* The peer takes our place in the bridge. */ + ast_bridge_channel_write_unhold(bridge_channel); ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_HANGUP); xfer_failed = ast_bridge_impart(bridge_channel->bridge, peer, bridge_channel->chan, NULL, 1); break; @@ -394,6 +403,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg * Just impart the peer onto the bridge and have us return to it * as normal. */ + ast_bridge_channel_write_unhold(bridge_channel); xfer_failed = ast_bridge_impart(bridge_channel->bridge, peer, NULL, NULL, 1); break; case ATXFER_ABORT: @@ -407,6 +417,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg if (!ast_check_hangup_locked(bridge_channel->chan)) { ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE); } + ast_bridge_channel_write_unhold(bridge_channel); } return 0; |