Commit ed0fe3bb authored by DanmeiChen's avatar DanmeiChen
Browse files

fix not end callkit when registration failed due to network reason

parent 15ff3fd9
Pipeline #30981 passed with stage
in 5 minutes and 58 seconds
......@@ -444,10 +444,19 @@ import AVFoundation
func onRegistrationStateChanged(core: Core, proxyConfig: ProxyConfig, state: RegistrationState, message: String) {
if core.proxyConfigList.count == 1 && (state == .Failed || state == .Cleared){
// terminate callkit immediately when registration failed or cleared, supporting single proxy configuration
CallManager.instance().endCallkit = true
for call in CallManager.instance().providerDelegate.uuids {
let callId = CallManager.instance().providerDelegate.callInfos[call.value]?.callId
if (callId != nil) {
let call = CallManager.instance().lc?.getCallByCallid(callId: callId!)
if (call != nil && call?.state != .PushIncomingReceived) {
// sometimes (for example) due to network, registration failed, in this case, keep the call
continue
}
}
CallManager.instance().providerDelegate.endCall(uuid: call.value)
}
CallManager.instance().endCallkit = true
} else {
CallManager.instance().endCallkit = false
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment