diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index fe71a6400a..f1c1727452 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -1300,7 +1300,11 @@ SWITCH_DECLARE(int) CoreSession::recordFile(char *file_name, int time_limit, int this_check(-1); sanity_check(-1); - if (!file_name) return 0; + if (!file_name) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No file specified.\n"); + return 0; + } + memset(&local_fh, 0, sizeof(local_fh)); fhp = &local_fh; local_fh.thresh = silence_threshold;