From 812355db8282eac83ddcd1969aea5bdd334e63a8 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Thu, 15 Aug 2013 22:10:20 +0000 Subject: [PATCH] Bridge: Don't suspend/unspend the channel for interception routines. By their nature, the connected line and redirecting interception routines are not supposed to affect the channel's media. Therefore, they should not suspend and unsuspend the channel while running. The suspend/unsuspend operations could be expensive depending upon the bridge and channel technology involved. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396814 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/bridge_channel.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/main/bridge_channel.c b/main/bridge_channel.c index 32d48309b0..013475c689 100644 --- a/main/bridge_channel.c +++ b/main/bridge_channel.c @@ -1477,27 +1477,20 @@ static void bridge_channel_handle_control(struct ast_bridge_channel *bridge_chan struct ast_channel *chan; struct ast_option_header *aoh; int is_caller; - int intercept_failed; chan = bridge_channel->chan; switch (fr->subclass.integer) { case AST_CONTROL_REDIRECTING: is_caller = !ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING); - bridge_channel_suspend(bridge_channel); - intercept_failed = ast_channel_redirecting_sub(NULL, chan, fr, 1) - && ast_channel_redirecting_macro(NULL, chan, fr, is_caller, 1); - bridge_channel_unsuspend(bridge_channel); - if (intercept_failed) { + if (ast_channel_redirecting_sub(NULL, chan, fr, 1) && + ast_channel_redirecting_macro(NULL, chan, fr, is_caller, 1)) { ast_indicate_data(chan, fr->subclass.integer, fr->data.ptr, fr->datalen); } break; case AST_CONTROL_CONNECTED_LINE: is_caller = !ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING); - bridge_channel_suspend(bridge_channel); - intercept_failed = ast_channel_connected_line_sub(NULL, chan, fr, 1) - && ast_channel_connected_line_macro(NULL, chan, fr, is_caller, 1); - bridge_channel_unsuspend(bridge_channel); - if (intercept_failed) { + if (ast_channel_connected_line_sub(NULL, chan, fr, 1) && + ast_channel_connected_line_macro(NULL, chan, fr, is_caller, 1)) { ast_indicate_data(chan, fr->subclass.integer, fr->data.ptr, fr->datalen); } break;