Reputation: 475
I'm using Twilio voice quickstart code https://github.com/twilio/voice-quickstart-swift. When I make a client to client call, call doesn't connect. CallKit runs in the background though, I can see the green notification bar when I send app in the background. Following is the error: StartCallAction transaction request failed: The operation couldn’t be completed. (com.apple.CallKit.error.requesttransaction error 7.)
As you can see Googling doesn't help as there doesn't seem to be any solution around?
Does anyone know how to fix or debug it further?
Updated:
Attaching VoIP settings, it's certainly enabled.
Upvotes: 6
Views: 6580
Reputation: 41
I had the same problem because the Provider
and the CallController
have been lazy loaded.
It looks like that the CXProvider
initWithConfiguration
runs asynchronously which means you need to call this early otherwise you run into the risk of having a call without the completion of the initWithConfiguration
function.
Thanks to @Allen for pointing me in the right direction.
Upvotes: 0
Reputation: 1258
Problem is in your code which you write to handle and initialise variables. There is nothing wrong in the Twilio sdk either so don't look there. Anything which you are doing beyond twilio sample code is the place to look for the problem.
I've also wasted months of my time on similar issue and found out that there was issue with initialising one variable.
Upvotes: 1
Reputation: 8407
You are trying to request CXStartCallAction
right after another CXStartCallAction
was requested. You need to end the first call correctly.
In any case you must follow correct sequence of actions. Once you user wrong action in a sequence, CallKit will return one or another error.
And DO NOT request one action immediately after another is processed. There should be some time between two requests. For example, you initiated CXStartCallAction
, then you checked that user is offline and trying to end the call. If that check is quick, then "end action" may result in error. You need to wait a few milliseconds before cancelling the outgoing call.
Upvotes: 1
Reputation: 23
Try to initialize CXProvider and CXCallController sooner, before requesting CXStartCallAction
Upvotes: 0
Reputation: 73100
Twilio developer evangelist here.
Have you enabled capabilities for Voice over IP in the project settings?
Upvotes: 0