mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix end call
This commit is contained in:
parent
a0b7dd0dda
commit
7b4427e785
2 changed files with 11 additions and 5 deletions
|
|
@ -176,7 +176,7 @@ import AVFoundation
|
|||
if (uuid != nil) {
|
||||
// This call was declined.
|
||||
providerDelegate.reportIncomingCall(call:nil, uuid: uuid!, handle: "Calling", hasVideo: false)
|
||||
providerDelegate.endCallNotExist(uuid: uuid!, timeout: .now())
|
||||
providerDelegate.endCall(uuid: uuid!)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -378,7 +378,7 @@ import AVFoundation
|
|||
providerDelegate.uuids.updateValue(uuid, forKey: callId)
|
||||
} else {
|
||||
// end call
|
||||
providerDelegate.endCallNotExist(uuid: uuid!, timeout: .now())
|
||||
providerDelegate.endCall(uuid: uuid!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,12 +121,18 @@ class ProviderDelegate: NSObject {
|
|||
func reportOutgoingCallConnected(uuid:UUID) {
|
||||
provider.reportOutgoingCall(with: uuid, connectedAt: nil)
|
||||
}
|
||||
|
||||
func endCall(uuid: UUID) {
|
||||
provider.reportCall(with: uuid, endedAt: .init(), reason: .declinedElsewhere)
|
||||
}
|
||||
|
||||
func endCallNotExist(uuid: UUID, timeout: DispatchTime) {
|
||||
DispatchQueue.main.asyncAfter(deadline: timeout) {
|
||||
if (CallManager.instance().lc?.callsNb == 0) {
|
||||
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: terminate call \(uuid) which does not exist.")
|
||||
CallManager.instance().providerDelegate.provider.reportCall(with: uuid, endedAt: .init(), reason: .declinedElsewhere)
|
||||
let callId = CallManager.instance().providerDelegate.callInfos[uuid]?.callId
|
||||
let call = CallManager.instance().callByCallId(callId: callId)
|
||||
if (call == nil) {
|
||||
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: terminate call with call-id: \(String(describing: callId)) and UUID: \(uuid) which does not exist.")
|
||||
CallManager.instance().providerDelegate.endCall(uuid: uuid)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue