From ea0653689f430b642ed857135557da260e3a8ad9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 14 Sep 2013 10:07:25 -0500 Subject: [PATCH] FS-5791 --resolve --- src/switch_ivr_async.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 080c7fe538..687ba9a8e6 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -2189,7 +2189,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t if ((status = switch_core_media_bug_add(session, "session_record", file, record_callback, rh, to, flags, &bug)) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error adding media bug for file %s\n", file); - switch_core_file_close(fh); + if (rh->native) { + switch_core_file_close(&rh->in_fh); + switch_core_file_close(&rh->out_fh); + } else + switch_core_file_close(fh); + } return status; }