]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6667 #comment block sending audio when dmachine is reading
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 5 Aug 2014 20:21:34 +0000 (01:21 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 5 Aug 2014 20:21:34 +0000 (01:21 +0500)
src/include/switch_ivr.h
src/switch_core_media.c
src/switch_ivr_async.c
src/switch_ivr_play_say.c

index f8e18b3d92cb5f55229588552515f3984d51972a..20e1cdfa455c2412afcaa001b7c4df57234b7d76 100644 (file)
@@ -958,6 +958,7 @@ SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_force_exists(const char *uuid);
 
 
 
+SWITCH_DECLARE(switch_bool_t) switch_ivr_dmachine_is_parsing(switch_ivr_dmachine_t *dmachine);
 SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_last_ping(switch_ivr_dmachine_t *dmachine);
 SWITCH_DECLARE(const char *) switch_ivr_dmachine_get_name(switch_ivr_dmachine_t *dmachine);
 SWITCH_DECLARE(void) switch_ivr_dmachine_set_match_callback(switch_ivr_dmachine_t *dmachine, switch_ivr_dmachine_callback_t match_callback);
index 45fc724b9982df2f93ee1cbca0b7141964c1e163..505f024c3e5737175cd37a504c2d9b89e2b9804d 100644 (file)
@@ -2929,6 +2929,7 @@ SWITCH_DECLARE(void) switch_core_session_set_ice(switch_core_session_t *session)
        switch_channel_set_flag(session->channel, CF_ICE);
        smh->mparams->rtcp_audio_interval_msec = "10000";
        smh->mparams->rtcp_video_interval_msec = "10000";
+
 }
 
 #define MAX_MATCHES 30
@@ -5092,6 +5093,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
                if ((val = switch_channel_get_variable(session->channel, "rtp_manual_rtp_bugs"))) {
                        switch_core_media_parse_rtp_bugs(&a_engine->rtp_bugs, val);
                }
+               
+               if (switch_channel_test_flag(session->channel, CF_WEBRTC)) {
+                       smh->mparams->manual_rtp_bugs = RTP_BUG_SEND_LINEAR_TIMESTAMPS;
+               }
 
                switch_rtp_intentional_bugs(a_engine->rtp_session, a_engine->rtp_bugs | smh->mparams->manual_rtp_bugs);
 
index e2a84eef73073a61e184539ee378b6a109f9183c..4dad74c6f9257c1dbaae72fd675f5bdcc37397b6 100644 (file)
@@ -615,6 +615,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_feed(switch_ivr_dmachine_t *
        return status;
 }
 
+SWITCH_DECLARE(switch_bool_t) switch_ivr_dmachine_is_parsing(switch_ivr_dmachine_t *dmachine)
+{
+       return !!dmachine->cur_digit_len;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_clear(switch_ivr_dmachine_t *dmachine)
 {
 
index 148b6ed3eb57f86f798aea259c1b97ee5e7c759f..f487fcec78f676bdb0414446ba1ddc7c10603ba8 100644 (file)
@@ -1680,6 +1680,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
                                switch_change_sln_volume(write_frame.data, write_frame.datalen / 2, fh->vol);
                        }
 
+                       /* write silence while dmachine is in reading state */
+                       if (args && args->dmachine && switch_ivr_dmachine_is_parsing(args->dmachine)) {
+                               memset(write_frame.data, 0, write_frame.datalen);
+                       }
+
                        status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
 
                        if (timeout_samples) {