Every 10 minutes from the moment I dial with CXStartCallAction and reporting an outgoing call, the call will always disconnect after 10 minutes has elapsed. Not sure why it is disconnecting every 10 minutes on the dot. I don't have any timers going off. This issue happens when the app is in the foreground or background.
This is how I am connecting the call through CallKit
provider.setDelegate(self as? CXProviderDelegate, queue: nil)
let controller = CXCallController()
let transaction = CXTransaction(action: CXStartCallAction(call: UUID(), handle: CXHandle(type: .generic, value: "Call"))); controller.request(transaction, completion: { error in })
DispatchQueue.main.asyncAfter(wallDeadline: DispatchWallTime.now() + 1){
self.provider.reportOutgoingCall(with: controller.callObserver.calls[0].uuid, connectedAt: nil)
self.uuidString = controller.callObserver.calls[0].uuid.uuidString
print("Call: Outgoing to " + self.uuidString)
}
Also another issue I have been having with CallKit is when connecting while the app is in the background the audio goes through fine. However when connecting to callkit when the app is in the foreground no audio is going through. But when switching the app the from foreground to background the audio starts going through CallKit. Maybe there's an audio session configuration I am missing?
Any help is appreciated.
Thanks!