diff options
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; |