Stop voice recording in progress if any before accepting a call

This commit is contained in:
Christophe Deschamps 2022-05-20 09:21:25 +02:00
parent f33ed2f7f9
commit 1a9c6060c2
2 changed files with 6 additions and 0 deletions

View file

@ -159,4 +159,6 @@
-(void) initiateReplyViewForMessage:(LinphoneChatMessage *)message;
-(void) stopVoiceRecording;
@end

View file

@ -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)")