]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5127 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 26 Feb 2013 17:05:44 +0000 (11:05 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 26 Feb 2013 17:05:49 +0000 (11:05 -0600)
src/include/switch_types.h
src/switch_core_io.c
src/switch_ivr_async.c

index 2c8b9503cf7b619ca7c5f388da74e68308dc67da..f3a15cbe27c86c5e534d5d80312997d526fcae1c 100644 (file)
@@ -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;
 
index 22e0cc811db392da370e4f9912f5a27f184b3dff..cfac3bf6293117c4e9adf02b08bbf9499257be4a 100644 (file)
@@ -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;
index 8b1ce552d497048a2ead0ea09575c87716c82200..d6b8c172c5db584d577237edab4017c346a102a6 100644 (file)
@@ -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;
        }