]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix switch_ivr_parse_event() to not hangup a session when there is no media yet
authorMoises Silva <moy@sangoma.com>
Mon, 20 Apr 2015 22:23:57 +0000 (18:23 -0400)
committerMoises Silva <moy@sangoma.com>
Mon, 20 Apr 2015 22:23:57 +0000 (18:23 -0400)
If the lead-frames header is set but there is no media ready yet do not
attempt to read media from the channel and continue with command execution

FS-7455 #resolve

src/switch_ivr.c

index ad9b6b11395dd42de903fd37395a1d77f7b59156..9fb9b354d8d80f0e9630ab5e4e6ae5f79a7698b7 100644 (file)
@@ -521,7 +521,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
                elp = 1;
        }
 
-       if (lead_frames) {
+       if (lead_frames && switch_channel_media_ready(channel)) {
                switch_frame_t *read_frame;
                int frame_count = atoi(lead_frames);
                int max_frames = frame_count * 2;