]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5840 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 5 Oct 2013 23:07:10 +0000 (18:07 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 5 Oct 2013 23:07:10 +0000 (18:07 -0500)
src/switch_ivr_async.c

index 159bdb5f6e9f5b193a0246a1691dedd62ca7ac7f..3bf20b5839f153f968bfb4baab0b3559398a1d81 100644 (file)
@@ -1204,20 +1204,21 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
                                        switch_channel_set_variable(channel, "RECORD_DISCARDED", "true");
                                        switch_file_remove(rh->file, switch_core_session_get_pool(session));
                                }
-                       }
 
+                               if (read_impl.actual_samples_per_second) {
+                                       switch_channel_set_variable_printf(channel, "record_seconds", "%d", rh->fh->samples_out / read_impl.actual_samples_per_second);
+                                       switch_channel_set_variable_printf(channel, "record_ms", "%d", rh->fh->samples_out / (read_impl.actual_samples_per_second / 1000));
+                               }
+                               switch_channel_set_variable_printf(channel, "record_samples", "%d", rh->fh->samples_out);
+                               
+                       }
+                       
                        if (switch_event_create(&event, SWITCH_EVENT_RECORD_STOP) == SWITCH_STATUS_SUCCESS) {
                                switch_channel_event_set_data(channel, event);
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Record-File-Path", rh->file);
                                switch_event_fire(&event);
                        }
-
-                       if (read_impl.actual_samples_per_second) {
-                               switch_channel_set_variable_printf(channel, "record_seconds", "%d", rh->fh->samples_out / read_impl.actual_samples_per_second);
-                               switch_channel_set_variable_printf(channel, "record_ms", "%d", rh->fh->samples_out / (read_impl.actual_samples_per_second / 1000));
-                       }
-                       switch_channel_set_variable_printf(channel, "record_samples", "%d", rh->fh->samples_out);
-
+                       
                        switch_channel_execute_on(channel, SWITCH_RECORD_POST_PROCESS_EXEC_APP_VARIABLE);
 
                        if ((var = switch_channel_get_variable(channel, SWITCH_RECORD_POST_PROCESS_EXEC_API_VARIABLE))) {