From b6456e7d454bb3bf2e70656381d331c9341ea27f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 26 Apr 2021 18:33:14 +0200 Subject: [PATCH] Don't pause all calls when receiving a new call. This creates recursions in callkit's logic that cause AudioSession to be lost. Call fulfill() when action is done. --- Classes/ProviderDelegate.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/ProviderDelegate.swift b/Classes/ProviderDelegate.swift index 9ba8cb83e..6d5d06a07 100644 --- a/Classes/ProviderDelegate.swift +++ b/Classes/ProviderDelegate.swift @@ -90,7 +90,7 @@ class ProviderDelegate: NSObject { let callInfo = callInfos[uuid] let callId = callInfo?.callId Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: report new incoming call with call-id: [\(String(describing: callId))] and UUID: [\(uuid.description)]") - CallManager.instance().setHeldOtherCalls(exceptCallid: callId ?? "") + //CallManager.instance().setHeldOtherCalls(exceptCallid: callId ?? "") provider.reportNewIncomingCall(with: uuid, update: update) { error in if error == nil { if CallManager.instance().endCallkit { @@ -155,7 +155,7 @@ class ProviderDelegate: NSObject { // MARK: - CXProviderDelegate extension ProviderDelegate: CXProviderDelegate { func provider(_ provider: CXProvider, perform action: CXEndCallAction) { - action.fulfill() + let uuid = action.callUUID let callId = callInfos[uuid]?.callId @@ -170,6 +170,7 @@ extension ProviderDelegate: CXProviderDelegate { CallManager.instance().terminateCall(call: call.getCobject); Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: Call ended with call-id: \(String(describing: callId)) an UUID: \(uuid.description).") } + action.fulfill() } func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {