From 9c00466dae0f9eb804e486ef91806b76dbf1095d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 26 Feb 2013 11:05:44 -0600 Subject: [PATCH] FS-5127 --resolve --- src/include/switch_types.h | 18 ++++++++++-------- src/switch_core_io.c | 14 ++++++++++++++ src/switch_ivr_async.c | 4 ++++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 2c8b9503cf..f3a15cbe27 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1480,7 +1480,8 @@ SMBF_WRITE_STREAM - Include the Write Stream SMBF_WRITE_REPLACE - Replace the Write Stream SMBF_READ_REPLACE - Replace the Read Stream SMBF_STEREO - Record in stereo -SMBF_ANSWER_RECORD_REQ - Don't record until the channel is answered +SMBF_ANSWER_REQ - Don't record until the channel is answered +SMBF_BRIDGE_REQ - Don't record until the channel is bridged SMBF_THREAD_LOCK - Only let the same thread who created the bug remove it. SMBF_PRUNE - SMBF_NO_PAUSE - @@ -1496,13 +1497,14 @@ typedef enum { SMBF_READ_PING = (1 << 4), SMBF_STEREO = (1 << 5), SMBF_ANSWER_REQ = (1 << 6), - SMBF_THREAD_LOCK = (1 << 7), - SMBF_PRUNE = (1 << 8), - SMBF_NO_PAUSE = (1 << 9), - SMBF_STEREO_SWAP = (1 << 10), - SMBF_LOCK = (1 << 11), - SMBF_TAP_NATIVE_READ = (1 << 12), - SMBF_TAP_NATIVE_WRITE = (1 << 13) + SMBF_BRIDGE_REQ = (1 << 7), + SMBF_THREAD_LOCK = (1 << 8), + SMBF_PRUNE = (1 << 9), + SMBF_NO_PAUSE = (1 << 10), + SMBF_STEREO_SWAP = (1 << 11), + SMBF_LOCK = (1 << 12), + SMBF_TAP_NATIVE_READ = (1 << 13), + SMBF_TAP_NATIVE_WRITE = (1 << 14) } switch_media_bug_flag_enum_t; typedef uint32_t switch_media_bug_flag_t; diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 22e0cc811d..cfac3bf629 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -551,6 +551,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi if (!switch_channel_test_flag(session->channel, CF_ANSWERED) && switch_core_media_bug_test_flag(bp, SMBF_ANSWER_REQ)) { continue; } + + if (!switch_channel_test_flag(session->channel, CF_BRIDGED) && switch_core_media_bug_test_flag(bp, SMBF_BRIDGE_REQ)) { + continue; + } + if (switch_test_flag(bp, SMBF_PRUNE)) { prune++; continue; @@ -595,6 +600,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi if (!switch_channel_test_flag(session->channel, CF_ANSWERED) && switch_core_media_bug_test_flag(bp, SMBF_ANSWER_REQ)) { continue; } + + if (!switch_channel_test_flag(session->channel, CF_BRIDGED) && switch_core_media_bug_test_flag(bp, SMBF_BRIDGE_REQ)) { + continue; + } + if (switch_test_flag(bp, SMBF_PRUNE)) { prune++; continue; @@ -757,6 +767,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi continue; } + if (!switch_channel_test_flag(session->channel, CF_BRIDGED) && switch_core_media_bug_test_flag(bp, SMBF_BRIDGE_REQ)) { + continue; + } + if (switch_test_flag(bp, SMBF_PRUNE)) { prune++; continue; diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 8b1ce552d4..d6b8c172c5 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -1845,6 +1845,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t flags |= SMBF_ANSWER_REQ; } + if ((p = switch_channel_get_variable(channel, "RECORD_BRIDGE_REQ")) && switch_true(p)) { + flags |= SMBF_BRIDGE_REQ; + } + if ((p = switch_channel_get_variable(channel, "RECORD_APPEND")) && switch_true(p)) { file_flags |= SWITCH_FILE_WRITE_APPEND; }