From 31fdf1b74682a5c188a7747f528b50033d11d261 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Tue, 28 Jul 2020 15:56:07 -0400 Subject: [PATCH] [core] Do not log ERROR in switch_ivr_record_session() if media bug failed due to hangup --- src/switch_ivr_async.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index d0e8a9e054..953d49ed7d 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -3238,7 +3238,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session_event(switch_core_sess 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); + if (switch_channel_ready(channel)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error adding media bug for file %s\n", file); + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error adding media bug for file %s\n", file); + } switch_goto_status(status, err); }