{"action":"created","issue":{"url":"https://api.github.com/repos/twilio/voice-quickstart-swift/issues/155","repository_url":"https://api.github.com/repos/twilio/voice-quickstart-swift","labels_url":"https://api.github.com/repos/twilio/voice-quickstart-swift/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/twilio/voice-quickstart-swift/issues/155/comments","events_url":"https://api.github.com/repos/twilio/voice-quickstart-swift/issues/155/events","html_url":"https://github.com/twilio/voice-quickstart-swift/issues/155","id":349916388,"node_id":"MDU6SXNzdWUzNDk5MTYzODg=","number":155,"title":"Getting Error: EndCallAction transaction request failed: The operation couldn’t be completed. (com.apple.CallKit.error.requesttransaction error 4.)","user":{"login":"ojhakapil","id":4309416,"node_id":"MDQ6VXNlcjQzMDk0MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/4309416?v=4","gravatar_id":"","url":"https://api.github.com/users/ojhakapil","html_url":"https://github.com/ojhakapil","followers_url":"https://api.github.com/users/ojhakapil/followers","following_url":"https://api.github.com/users/ojhakapil/following{/other_user}","gists_url":"https://api.github.com/users/ojhakapil/gists{/gist_id}","starred_url":"https://api.github.com/users/ojhakapil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojhakapil/subscriptions","organizations_url":"https://api.github.com/users/ojhakapil/orgs","repos_url":"https://api.github.com/users/ojhakapil/repos","events_url":"https://api.github.com/users/ojhakapil/events{/privacy}","received_events_url":"https://api.github.com/users/ojhakapil/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-08-13T07:29:25Z","updated_at":"2018-10-03T06:40:03Z","closed_at":"2018-10-02T23:18:14Z","author_association":"NONE","body":"Hello Twilio Support,\r\n\r\nI am using TwilioVoice 2.0.4 for VoIP calling in my application. I have taken the sample code from `TwilioVoiceCallKitQuickStart` project. But I'm facing a random issue with it.\r\n\r\nWhen `callInviteReceived` is called with `state == cancelled`, and I try to end the call, the incoming call screen from CallKit does not go away and the phone continues to ring even when the call has been disconnected by the dialer.\r\n\r\nI'm getting the below error logged on the console:\r\n\r\n> EndCallAction transaction request failed: The operation couldn’t be completed. (com.apple.CallKit.error.requesttransaction error 4.)\r\n\r\nI searched for the possible causes of the error and found that it comes when the UUID used in CXEndCallAction does not correspond to a known call. But if that is the case, this error should be repeated all the time, but it only happens occasionally.\r\n\r\nPlease let me know what I'm doing wrong here.\r\n\r\n```\r\n    func callInviteReceived(_ callInvite: TVOCallInvite) {\r\n        NSLog(\"callInviteReceived:\")\r\n        \r\n        print(\"Call Invite UUID: \", callInvite.uuid)\r\n        if (callInvite.state == .pending) {\r\n            NSLog(\"state == received\")\r\n            handleCallInviteReceived(callInvite)\r\n        } else if (callInvite.state == .canceled) {\r\n            NSLog(\"state == cancelled\")\r\n            handleCallInviteCanceled(callInvite)\r\n        }\r\n    }\r\n    \r\n    func handleCallInviteReceived(_ callInvite: TVOCallInvite) {\r\n        \r\n        if (self.incomingCallInvite != nil && self.incomingCallInvite?.state == .pending) {\r\n            NSLog(\"Already a pending incoming call invite.\");\r\n            NSLog(\"  >> Ignoring call from %@\", callInvite.from);\r\n            \r\n            showMissedCallNotification(callInvite)\r\n            \r\n            return;\r\n        } else if (self.call != nil) {\r\n            NSLog(\"Already an active call.\");\r\n            NSLog(\"  >> Ignoring call from %@\", callInvite.from);\r\n            \r\n            showMissedCallNotification(callInvite)\r\n            \r\n            return;\r\n        }\r\n        \r\n        self.incomingCallInvite = callInvite\r\n        \r\n\r\n        print(\"Reporting incoming call for uuid: \",callInvite.uuid)\r\n        self.reportIncomingCall(uuid: callInvite.uuid)\r\n    }\r\n    \r\n    func handleCallInviteCanceled(_ callInvite: TVOCallInvite) {\r\n        //Perform End Call action\r\n        performEndCallAction(uuid: callInvite.uuid)\r\n\r\n        if !incomingCallDetailFromServer.isEmpty {\r\n            DatabaseManager.saveMissedCallInCoreData(number: callInvite.from, missedCallDetail: incomingCallDetailFromServer)\r\n        }\r\n            \r\n        else {\r\n            DatabaseManager.saveMissedCallInCoreData(number: callInvite.from, missedCallDetail: [:])\r\n        }\r\n        \r\n        //Show missed call notification\r\n        showMissedCallNotification(callInvite)\r\n        \r\n        //set call invite to nil\r\n        self.incomingCallInvite = nil\r\n        \r\n        //dismiss the alert for incoming call\r\n        self.dismissIncomingCallAlertDelegate?.dismissIncomingCallAlert()\r\n    }\r\n\r\n  func performEndCallAction(uuid: UUID) {\r\n        \r\n        let endCallAction = CXEndCallAction(call: uuid)\r\n        let transaction = CXTransaction(action: endCallAction)\r\n        \r\n        print(\"PerformingEndCallAction for uuid: \",uuid)\r\n        callKitCallController?.request(transaction) { error in\r\n            if let error = error {\r\n                NSLog(\"EndCallAction transaction request failed: \\(error.localizedDescription).\")\r\n                return\r\n            }\r\n            \r\n            NSLog(\"EndCallAction transaction request successful\")\r\n        }\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/twilio/voice-quickstart-swift/issues/comments/426527867","html_url":"https://github.com/twilio/voice-quickstart-swift/issues/155#issuecomment-426527867","issue_url":"https://api.github.com/repos/twilio/voice-quickstart-swift/issues/155","id":426527867,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjUyNzg2Nw==","user":{"login":"kapilojha","id":8383731,"node_id":"MDQ6VXNlcjgzODM3MzE=","avatar_url":"https://avatars2.githubusercontent.com/u/8383731?v=4","gravatar_id":"","url":"https://api.github.com/users/kapilojha","html_url":"https://github.com/kapilojha","followers_url":"https://api.github.com/users/kapilojha/followers","following_url":"https://api.github.com/users/kapilojha/following{/other_user}","gists_url":"https://api.github.com/users/kapilojha/gists{/gist_id}","starred_url":"https://api.github.com/users/kapilojha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapilojha/subscriptions","organizations_url":"https://api.github.com/users/kapilojha/orgs","repos_url":"https://api.github.com/users/kapilojha/repos","events_url":"https://api.github.com/users/kapilojha/events{/privacy}","received_events_url":"https://api.github.com/users/kapilojha/received_events","type":"User","site_admin":false},"created_at":"2018-10-03T06:40:03Z","updated_at":"2018-10-03T06:40:03Z","author_association":"NONE","body":"Hi @bchen-twilio \r\n\r\nThanks for your response on this issue. I have looked at the changes made by you in the CallKitQuickStart sample. I have one question to you about this: the change made is for outgoing call action but I faced the issue for an incoming call not disconnecting. \r\n\r\nSo, will the new change solve the issue for me?"}}
{"actor":{"display_login":"kapilojha"}}