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
changes/78/78/1
Richard Mudgett 12 years ago
parent 8b7742202f
commit 812355db82

@ -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;

Loading…
Cancel
Save