mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
fix not end callkit when registration failed due to network reason
This commit is contained in:
parent
15ff3fd9a6
commit
ed0fe3bb69
1 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue