Hello,
I am currently working on feature which includes VoIP push notifications, CallKit and WebRTC.
About issue: if user answers the call from iOS native call window faster than RTCPeerConnection has it's remote description set I am returning from func provider(_: perform:) and not fulfilling or failling the action.
func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
if !didReceiveSipServerSdp {
didAnswerIncomingCall = true
return
}
answer { sdp in
self.janusSipChannel?.answerCall(destination: sipDestination, sdp: sdp)
}
action.fulfill()
}
I await for RTCPeerConnection to set it's remote description and then call
let callController = CXCallController()
let answerCallAction = CXAnswerCallAction(call: uuid)
let transaction = CXTransaction(action: answerCallAction)
callController.request(transaction) { error in
...
}
Thats when I receive "Error requesting transaction: Error Domain=com.apple.CallKit.error.requesttransaction Code=6 "(null)"".
Because of that I made changes to set timer for 1 sec in CXAnswerCallAction method to wait before fulfilling action if user is fast enough to answer call and internet connection is slow and RTCPeerConnection hasn't set its remote description.
Is there any other options on this matter? Or is it impossible not to handle (action.fulfill() / action.fail()) received action and make same transaction again?
Thank you in advance!