Twilio Client - Sometimes no receiving disconnect from the caller - twilio

We're using twilio client (1.4) to place/receive calls and we have noticed that sometimes when the caller hangs up the call, twilio client doesn't receive the disconnect signaling and therefore, it keeps like it has a ongoing call.
Could we somehow avoid or minimize this behavior?
Regards,
Carlos

You can check call status issue in twilio website www.twilio.com with your credentitals. Go to calllogs and find the particular call(with SID- this Sid you can get it from twilio.device.incoming method ) and check the call status http response.(Most probably your statuscallback has some issue)

Related

Twilio Child Call Status incorrect?

I'm experimenting with Twilio and I'm confused a bit by the ultimate status of my calls.
Here's what I'm doing. I'm making a call to a Twilio Phone Number which is hooked into an application endpoint. The app makes a database record of the call and then uses Twiml to make a secondary call out to another phone. After the call is complete, the call record is updated with data retrieved from Twilio then a secondary call record is created from the call in my account where its parent_call_sid is my original call's sid.
My issue is, if I call the Twilio Number but let the Twiml Dial timeout, the child call status ends up being 'completed' instead of 'no-answer'.
My question is why is this happening? Do I need to configure how I dial out differently in order to receive the appropriate status for my calls?
UPDATE:
This has been resolved. The issue was voicemail picking up before Twilio's default timeout of 30 seconds ended the call, resulting in a 'completed' status. By reducing the timeout Twilio was able to end the call with 'no-answer' before the voice mail picked up.
The issue was the timeout was long enough for the voice mail to pick up, which does not count as no-answer. Reducing the Timeout so that Twilio ends the call before voice mail answers correctly results in a no-answer status.

Twilio incoming call issue in twilio iOS Sdk

I am using twilio iOS sdk in my application and am having problem with incoming call . I can able to get incoming call, but the caller disconnect the call after he spoke i didn't get any callback in my app. so i can't able to identify that call has been disconnected in my app.
Note:
Right now I'm using the below callback method in my application, it has been called once when the incoming call is ignore, but it didn't call when the caller spoke and disconnect the call.
- (void)connectionDidDisconnect:(TCConnection *)connection
You might try to update your code with a call to - (void)disconnectAll after a caller disconnects.
https://www.twilio.com/docs/api/client/ios/tcdevice#disconnectAll
This a convenience routine that disconnects all current incoming and outgoing connections.

Increase the wait time of Twilio messaging?

Let's assume a server has a lag in its internet network. Whenever, Twilio is attempting to message it, then the messaging are succceding 50% of the time , while the other 50% are failing because of HTTP: connection timed out.
Is there any way to tell TWilio to increase the wait-time or retry messaging the server?
Twilio developer evangelist here.
You won't be able to increase the timeout on Twilio or have it retry but what you can do is check the response you get from Twilio using the callback url. That is obviously providing Twilio is able to make a request to your server at that time.
Twilio will then make a request to your server to tell you whether it was able to send the message or not.
You could then add those messages into a queue, and try to resend them later on.
What you could also do is use the API to get the error logs for your application, and try to resend the messages for any message that wasn't sent. Have a look at the Events Monitor API for this.
Let me know if this helps you.

How can I cancel a Twilio call in iOS after it's been initiated?

I'm running into a problem with an app that I'm building that I'm a little stuck on.
I have an iOS app (handles initiating the call via Twilio SDK) that communicates with a Ruby on Rails back-end (handles the Twilio server side implementation) to enable communication between the iDevice and the phone number being called.
The issue I'm having is that when a call is initiated accidentally (user error or misunderstanding how the app works) and the user goes to terminate the call Twilio has already received the request to create the call and it still goes through.
I've tried disabling the TCConnection and the TCDevice using their respective disconnect methods ("disconnect" and "disconnectAll"), but I'm still seeing the call go through (phone number being called still receives the call from the Twilio side of things). I haven't tried anything on the server side of things because I'd like to avoid building a set of "oh &$^$%" protocols if I can avoid it.
Has anyone experienced this before? Does anyone have any suggestions? Is there anyway to terminate calls made accidentally?
Thanks in advance!
Checking back in to share what I've discovered after reaching out to Twilio support in the event anyone finds this in the future.
From Twilio support:
For canceling a call, you can use the REST API to modify the live call and set the Status to "completed", which will cancel a ringing call and end an established call:
https://www.twilio.com/docs/api/rest/change-call-state
So, in short, build some "oh #^%$*" protocols that you can ping as necessary to actively terminate any call that you need to. Not ideal, but the options are limited.

TwiML App: If the caller hangs up in the middle of the application process, does Twilio notify the app of a hang up?

I am trying to figure out a way to capture if the caller hangs up in the middle of TwiML instructions. If the caller hangs up (abandons the call) does twilio notify the application of such?
I see the status callback url setting but I just get a "completed" status. I was wondering if the caller was in a middle of a gather and hung up would twilio know the call hung up and report it? Or am I supposed to just see the "completed" status and at that time determine if the call actually successfully completed or not?
Twilio evangelist here.
To my knowledge we don't have a specific way of telling you that a caller hung up during the middle of a <Gather> other than the status callback passing you the CallStatus, which as you points out just tells you that the call was completed, not where within a TwiML document or a call flow the caller was.
If you want to know where within a call flow the call ends (for example the caller hangs up), I'm pretty sure that is something you would need to track in your own application. You could do that by storing the callSid of the phone call along with some meta data that helps your app know where in the flow the call is, and just updating each time Twilio makes a webhook request to your app.
Hope that helps.

Resources