Revert "fix workaround for incoming call"

This reverts commit 244d580bf8.
This commit is contained in:
Danmei Chen 2021-01-20 14:21:37 +01:00
parent bf33513300
commit b62fe18ff3

View file

@ -174,19 +174,15 @@ extension ProviderDelegate: CXProviderDelegate {
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: answer call with call-id: \(String(describing: callId)) and UUID: \(uuid.description).")
let call = CallManager.instance().callByCallId(callId: callId)
// workaround
CallManager.configAudioSession(audioSession: AVAudioSession.sharedInstance())
if (call == nil || call?.state != Call.State.IncomingReceived) {
// The application is not yet registered or the call is not yet received, mark the call as accepted. The audio session must be configured here.
CallManager.configAudioSession(audioSession: AVAudioSession.sharedInstance())
callInfo?.accepted = true
callInfos.updateValue(callInfo!, forKey: uuid)
CallManager.instance().providerDelegate.endCallNotExist(uuid: uuid, timeout: .now() + 10)
} else {
CallManager.instance().acceptCall(call: call!, hasVideo: call!.params?.videoEnabled ?? false)
}
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: answer call finished.")
action.fulfill()
}