]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6033 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 9 Dec 2013 22:42:12 +0000 (03:42 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 9 Dec 2013 22:42:18 +0000 (03:42 +0500)
src/switch_ivr_play_say.c

index 97f553d7335a2d556cede4aae4999461963c78ad..47451c3ca6efe8ed27d7433aa0fe7c7708d889a8 100644 (file)
@@ -389,29 +389,24 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
        const char *prefix, *var;
 
 
+       if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
+               return SWITCH_STATUS_FALSE;
+       }
+
        prefix = switch_channel_get_variable(channel, "sound_prefix");
 
        if (!prefix) {
                prefix = SWITCH_GLOBAL_dirs.sounds_dir;
        }
 
-       switch_core_session_get_read_impl(session, &read_impl);
-
-       if (!(divisor = read_impl.actual_samples_per_second / 8000)) {
-               divisor = 1;
-       }
-
-
-       if (!switch_channel_ready(channel)) {
+       if (!switch_channel_media_ready(channel)) {
                return SWITCH_STATUS_FALSE;
        }
 
-       if (switch_channel_answer(channel) != SWITCH_STATUS_SUCCESS) {
-               return SWITCH_STATUS_FALSE;
-       }
+       switch_core_session_get_read_impl(session, &read_impl);
 
-       if (!switch_channel_media_ready(channel)) {
-               return SWITCH_STATUS_FALSE;
+       if (!(divisor = read_impl.actual_samples_per_second / 8000)) {
+               divisor = 1;
        }
 
        arg_recursion_check_start(args);