StatusCallBack for iOS SDK - ios

I'm using the iOS client SDK for VoIP, and need to know when a caller has accepted, rejected or ignored an incoming call. Everything I've read suggests using StatusCallBack, but this seems to be available only in the REST API, not the iOS client API. How can I do this in iOS?

Michael, Megan from Twilio here.
Unfortunately, at this time it's not possible to do this directly with the iOS SDK. There is a feature request in place.
In the meantime, to set up call progress, you'll need to bypass the iOS TCDevice connect method, and instead have your iOS code make a request to your server to set up both legs of the call through the Twilio REST API, so that it can enable the call progress events. Your server needs to then communicate the events back to your iOS code.
Hope this helps.

Related

Twilio: Call and Voice features?

I am trying to implement a call feature in my xamarin forms app using Twilio. I am able to call by providing From and To numbers using this API of Twilio. But the above call is happening via Twilio, I need to make a call via the internet (App to App). Is there any way to do this using Twilio?
Also is there a way to send a voice clip if the call is not answered? And any way to list out all the voices? I am able to list out SMS and call logs, but couldn't find a way to list the voices. I am using c# codes.
Twilio developer evangelist here.
If you want to make App to App calls then you want the Twilio Voice SDK. I am afraid we don't provide an official Xamarin wrapper for this SDK, though there are community wrappers available that might help you.

How to receive incoming call with TwilioXamarinBindings Twilio.Voice.iOS

I'm new to Twilio and expected there to be a Xamarin SDK for iOS and Android but apparently there isn't. I have been working with https://github.com/dkornev/TwilioXamarinBindings for native libraries but cannot seem to find any help with getting an incoming (to the iOS/Android app) call. I'm not sure if there's a tutorial somewhere explaining exactly how to route the call to a specific device but I can't see it....
So, can somebody explain the procedure, do I need Apple APN and if so how is it acheived in Xamarin Forms?
I haven't found anything for incoming calls to Xamarin apps via VOIP but all outgoing is fine.
Twilio evangelist here.
I'm not familiar with those bindings but looking at the sample application that is included in the repo it looks like in iOS there is a method called AcceptWithDelegate that you call to accept an incoming Twilio Voice call.
https://github.com/dkornev/TwilioXamarinBindings/blob/master/sample/Twilio.Voice.Sample.iOS/TwilioVoiceHelper.cs#L131-L136
The binding source appears to map this to the iOS SDK's acceptWithDelegate function:
https://media.twiliocdn.com/sdk/ios/voice/releases/2.0.7/docs/Classes/TVOCallInvite.html#//api/name/acceptWithDelegate:
Hope that helps.

Specify Twilio Region for Rest API

We are using the Twilio Programmable Voice Service globaly. In the US and EU the performance is acceptable. In Australia there is a long delay after the user answers the phone and before the user hears anything. I attempted to set the region using the C# SDK using the regions specified here. That essentially sets the root API url to https://api.au1.twilio.com which does not exists/respond (502 error). Has anyone had any success specifying the region for REST API calls using Twilio?
** I have tried using us1 and ie1 with the same results.
I received this from Twilio Support. It looks like server side API calls are US only.
Thanks for writing and sorry for the trouble. I think where we're
getting stuck is the difference between the server-side helper library
concept of the HTTP client for making and responding to REST API
requests, and the voice over IP product Client and its associated
SDKs.
The region can absolutely be set on the VoIP Client applications, and
we have this in place specifically to address the types of audio
latency you're describing below; the important distinction being that
the region designation happens at the local application, not in the
serve-side code. You can see how to set the region in the JavaScript
library, the Android SDK, and the iOS SDK.
The reason this works for VoIP Client calls is that we have media
endpoint in those regions; however, we do not have regionalized API
endpoints--api.twilio.com is only located in the US, so trying to
create a TwilioRestClient for HTTP requests will not work.
Hope that helps. Please let me know if you have any questions

Making a call from a Twilio client to another Twilio client directly

what I am trying to achieve is to make a VoIP call from an iPhone to an iPhone using Twilio.
To do that I'm using the iOS SDK, the Twilio Voice to be more specific as the iOS SDK is superseded.
I have a server that generates an access token and when I create a call the Twilio API would make a request to my server and I would return a <Dial /> keyword with the client name and the connection would be established.
The problem is, this counts as two calls(iOS app to Twilio is the first one and when I return a TwML <Dial /> response is the second one) so the price is practically doubled.
Is there a way to make it as a single iOS app to an iOS app call? All my server does is to generate the TWiML using the parameters that are sent from the client anyway.
Oh and also in the documentation there are some talks about capability tokens but all the current documentation is using Access Tokens.
Are capability tokens relics of the past for the older API?
Thanks
Twilio developer evangelist here.
Twilio calls are always priced per leg, so in a call between two people you do always pay for the outgoing leg and the incoming leg. They may also have different lengths, if the outgoing call goes through some other TwiML before making the <Dial> for example.
However, if all you want to do is make calls between applications and you don't need to be able to make calls to the phone network then can I recommend you take a look at the Twilio Video project. While it is called "Video" you can use the SDK to make audio calls between apps too. And if you choose to create peer-to-peer rooms, then the audio stream is sent directly between the two devices and not charged as a call leg at all. The only extra thing you need to do is to generate the call notifications yourself.
As for capability tokens, they are indeed a left over bit of documentation. Capability tokens have mostly been renamed as access tokens so you can use them interchangeably. If you investigate the Video SDK, then everything will be Access Tokens too.

Is twillo Client Api allow user to Call from Application to Application instead of native call in iOS?

I recently integrated twillo iOS SDK in my iPhone app and it is working fine for native call it means i can make call from app to any verified phone numbers.
But my requirement is app to app call it means there is no native call.
So i would like to know if by using Twillio SDK, is it possible to call from application to application ? Something similar to whatsApp. So there will not be any phone number but both phones must have our apps with Twillio SDK integrated.
Please Help me.
Thanks.
Twilio developer evangelist here.
You absolutely can do app to app calls using the iOS SDK. Let me explain.
Your Twilio Client capability token is created with a TwiML Application, which supplies the URL that Twilio will hit when a call is created to find out what to do with it. Normally, you would pass a phone number as a parameter to your TCDevice's connect which would be handed to your app URL when the call connects. This would then be used to produce TwiML to direct the call onto that number, like this:
<Response>
<Dial>
<Number>{{ to_number }}</Number>
</Dial>
</Response>
To make this work for client to client calls, you can pass another client ID to the URL and on your server, instead of <Dial>ing to a <Number> you would <Dial> to a <Client>. Like so:
<Response>
<Dial>
<Client>{{ client_id }}</Client>
</Dial>
</Response>
You can discover which clients are available by listening for presence events with your TCDevice object. You will also have to handle incoming calls within applications.
I recommend following the Twilio Client iOS Quickstart guide all the way through, which will guide you through most of these points, including passing parameters to your application URL and generating the right TwiML to accomplish this (though it doesn't cover presence events).
Let me know if this helps at all.
Not sure it is possible with Twilio. We have used twilio for the same purpose u mentioned (Call to phone numbers) and was working fine. I think the main purpose of twilio is that. Anyways i'm not sure about it.
May be VoIP will suit for your functionality. PortSIP is a good SDK for voice and video communications between apps.
You can download the iOS SDK from here https://www.portsip.com/downloads-center/
It is payable like Twilio only if you want to use it for business.
For more refer here
Thanks.
Twilio support sip now. you must have some setting with your twilio account.
As I know ,you can follow here to set your twilio sip server and implement sip client on your ios client.

Resources