Reputation: 414
I'm developing my iOS Voip Application with Twilio.
I got free trial account and am working on call from my iphone to the Voip Application(Installed to another iphone). I'm confident that the capability token I issued on my server is right though there is no way to confirm if the capability token is right or not as the issued TCDevice class in my iOS application.
The problem is, when I call from my phone to the trial phone number, the call log on console shows me warning that says "'To' phone number not verified". I'm sure 'To' phone number is the one I got on Twilio and have no way to verify it.
Does anyone know Twilio trial number can get incoming call? Are there any ways can I confirm the capability token is right?
Thank you
Upvotes: 0
Views: 480
Reputation: 73029
Twilio developer evangelist here.
You do not need to set the capability token in the <Dial>
in your TwiML.
You need to generate a capability token on your server and setup your TCDevice object with it. The capability token should set a name for the client when you declare allow_incoming_connections
on it: https://www.twilio.com/docs/api/client/capability-tokens#allow-incoming-connections
from twilio.util import TwilioCapability
account_sid = "ACXXXXXXXXXXXXXXX"
auth_token = "secret"
capability = TwilioCapability(account_sid, auth_token)
capability.allow_client_incoming("tommy")
print(capability.generate())
Then, when you call your Twilio number, you need to use <Dial>
with a nested <Client>
with the name you set in the capability token. Like:
<Response>
<Dial>
<Client>tommy</Client>
</Dial>
</Response>
Then Twilio can direct the call into your client application.
Upvotes: 1