From 1a9c6060c2df498b950414f40040c1339d7c8d8e Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Fri, 20 May 2022 09:21:25 +0200 Subject: [PATCH] Stop voice recording in progress if any before accepting a call --- Classes/ChatConversationView.h | 2 ++ Classes/Swift/CallManager.swift | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Classes/ChatConversationView.h b/Classes/ChatConversationView.h index 7d8fd00dc..b186a849c 100644 --- a/Classes/ChatConversationView.h +++ b/Classes/ChatConversationView.h @@ -159,4 +159,6 @@ -(void) initiateReplyViewForMessage:(LinphoneChatMessage *)message; +-(void) stopVoiceRecording; + @end diff --git a/Classes/Swift/CallManager.swift b/Classes/Swift/CallManager.swift index 444fc8617..cf13510b3 100644 --- a/Classes/Swift/CallManager.swift +++ b/Classes/Swift/CallManager.swift @@ -202,6 +202,10 @@ import AVFoundation callParams.recordFile = writablePath + if let chatView : ChatConversationView = PhoneMainView.instance().VIEW(ChatConversationView.compositeViewDescription()), chatView.isVoiceRecording { + Log.directLog(BCTBX_LOG_MESSAGE, text: "Voice recording in progress, stopping it befoce accepting the call.") + chatView.stopVoiceRecording() + } try call.acceptWithParams(params: callParams) } catch { Log.directLog(BCTBX_LOG_ERROR, text: "accept call failed \(error)")