From e6e5fced08d167d47b52a840617f2586e952c27e Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Mon, 12 Nov 2018 09:27:49 +0100 Subject: [PATCH] Terminate CallKit end poing upon cancel or failuer --- Classes/LinphoneManager.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index c28dff5ab..4986e4940 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -802,6 +802,16 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char CXTransaction *tr = [[CXTransaction alloc] initWithAction:act]; [LinphoneManager.instance.providerDelegate.controller requestTransaction:tr completion:^(NSError *err){}]; + + LOGI(@"CallKit - clearing CK as call ended on uuid %@",uuid); + [LinphoneManager.instance.providerDelegate.provider reportOutgoingCallWithUUID:uuid connectedAtDate:[NSDate date]]; + [self.providerDelegate.uuids removeObjectForKey:callId2]; + [self.providerDelegate.calls removeObjectForKey:uuid]; + [self.providerDelegate.provider reportCallWithUUID:uuid + endedAtDate:[NSDate date] + reason:(state == LinphoneCallError ? CXCallEndedReasonFailed : CXCallEndedReasonRemoteEnded)]; + + } else { // Can happen when Call-ID changes (Replaces header) if (linphone_core_get_calls_nb(LC) ==0) { // Need to clear all CK calls for (NSUUID *myUuid in self.providerDelegate.calls) {