FSCORE-339

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12682 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2009-03-20 13:58:45 +00:00
1 parent b6660ec721
commit c2692bf05a
3 files changed
+26 -6

No files matched your search

+15 -4
View File
@@ -439,12 +439,23 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
case SWITCH_ABC_TYPE_INIT:
break;
case SWITCH_ABC_TYPE_CLOSE:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stop recording file %s\n", rh->file);
switch_channel_set_private(channel, rh->file, NULL);
{
switch_codec_implementation_t read_impl = {0};
switch_core_session_get_read_impl(session, &read_impl);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stop recording file %s\n", rh->file);
switch_channel_set_private(channel, rh->file, NULL);
if (rh->fh) {
switch_core_file_close(rh->fh);
}
if (rh->fh) {
switch_core_file_close(rh->fh);
if (rh->fh->samples_out < read_impl.samples_per_second * 3) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Discarding short file %s\n", rh->file);
switch_file_remove(rh->file, switch_core_session_get_pool(session));
}
}
break;
case SWITCH_ABC_TYPE_READ_PING:
if (rh->fh) {