summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-08-15 22:10:20 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-08-15 22:10:20 +0000
commit812355db8282eac83ddcd1969aea5bdd334e63a8 (patch)
tree17d9d412b6a23e802a7ca7a4a30fa5e7f48c17fb
parent8b7742202f3cf52b44af86768954ad47250d029a (diff)
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
-rw-r--r--main/bridge_channel.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 32d48309b..013475c68 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;