Bridge: Don't suspend/unspend the channel for interception routines.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 15 Aug 2013 22:10:20 +0000 (22:10 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 15 Aug 2013 22:10:20 +0000 (22:10 +0000)
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

index 32d4830..013475c 100644 (file)
@@ -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;