reduce latency for end call not exist

This commit is contained in:
Danmei Chen 2020-05-04 14:20:02 +02:00
parent b7fb7f3ce6
commit 05f9fdb15a

View file

@ -89,7 +89,8 @@ class ProviderDelegate: NSObject {
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: report new incoming call with call-id: [\(String(describing: callId))] and UUID: [\(uuid.description)]")
provider.reportNewIncomingCall(with: uuid, update: update) { error in
if error == nil {
CallManager.instance().providerDelegate.endCallNotExist(uuid: uuid, timeout: .now() + 60)
let latency = ConfigManager.instance().lpConfigIntForKey(key: "max_call_received_latency", defaultValue: 20000000000)
CallManager.instance().providerDelegate.endCallNotExist(uuid: uuid, timeout: .init(uptimeNanoseconds: UInt64(latency)))
} else {
Log.directLog(BCTBX_LOG_ERROR, text: "CallKit: cannot complete incoming call with call-id: [\(String(describing: callId))] and UUID: [\(uuid.description)] from [\(handle)] caused by [\(error!.localizedDescription)]")
if (call == nil) {