Twilio not executing flow - twilio

I have a flow set up so when a user calls:
Phone A rings
If Phone A does not pick up after 4 seconds, Phone B rings
If Phone B does not pick up a voicemail message plays
Caller has an option to leave a voicemail that gets emailed to us
The flow is not executing. When one dials, both phones dial at the same time and do not play the voicemail. Any ideas?
Screenshot of the flow
I have looked at the logs for the flow and it is not detecting any incoming calls despite testing it.

Related

Twilio setting CallerId for outbound transferred calls

I want to set up a system where if a transferred call is not answered, it is moved back into a queue so that someone else can grab it. I have the basics of catching the Dial status and then redirecting no-answer calls back to the queue.
My struggle is with the callerId. For inbound calls, everything works great and the correct inbound callerId shows at every step in the process.
For outbound calls using the Twilio Client, I can only get half way.
Assume:
Business phone number = 555-555-5555
Customer phone number = 222-222-2222
Agent A dials outbound
Sid1: incoming clientAnonymous
Sid2: from: 555-555-5555 to: 222-222-2222
Agent A then transfers to Agent B
<Response>
<Dial callerId="+12222222222" action="/catchNoAnswer"><Client>AgentB</Client>
</Dial>
</Response>
Agent B correctly sees the callerId as the customer.
Sid3: from: +12222222222 to:AgentB
If AgentB doesn't answer, I want to put the call back into a queue, but no matter what I try, the queue always shows the "from" number as the business phone number rather than the customer phone number. With multiple agents, this results in several calls in the queue all showing the business phone number rather than the customer phone numbers that the calls really represent.
I don't want to use a conference to do a warm transfer.
Is there any way to set the callerId to the to number before enqueuing a call?
I have tried dialing a conference with the callerId set, similar to how I dialed the client, and then moving that leg of the call back to the queue, but the callerId didn't stick.

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: how to warn users before call ends aggressively with time limited calls?

So here what i have, when a user A calls my Twilio number, the call is forwarded towards another user B number through a Twiml response which dials user B number. I have done a time limit for any calls which is 5 minutes, but i would like to prevent the two users when there is only 1 minute left that time is nearly up and avoid cutting out aggressively the call.
Any one has an idea how to do that ?
Twilio developer evangelist here.
You could have the users actually call into a <Conference> (generating a call to user B when user A calls and enters the conference) and then start a timer for 4 minutes on your server. When the timer is done you can then check if the conference is still live (by calling the REST API and checking the conference status) and if it is dial one more caller into the conference.
That caller could be a recorded message that you play with <Play> or a message to be read out with text to speech using <Say> that lets the callers know that there's only one minute left.
For example:
<Response>
<Say voice="alice">Warning. There is only one minute of calling time left.</Say>
<Hangup/>
</Response>
Update
This is now better done with announcements that can be played into conferences. Check out the blog post here with details on how to announce messages into a conference.

Call forward to my personal VM after the ring got stopped

When an inbound call reaches my system it is forwarded to my personal number using TwiML. So once the ring stops (missed call) it just hang up the call. Is there any way to reach this call to my personal VM after the ring got stopped?
Twilio developer evangelist here.
It is possible that your phone is taking longer than 30 seconds to go to voicemail. The default timeout on <Dial> is 30 seconds, at which point Twilio will hang up.
You can set the timeout to anything between 5 and 600 seconds, which should cover the needs of your voicemail setting on your phone.

Stop / Start call recording on Twilio

Is there an API that I can use to stop recording an ongoing call?
We have a feature here where you can record only pieces of a call. So you can click a button to stop recording, and then after some time you can click another button to start recording again.
How can I accomplish that on Twilio? I didn't find anything in their docs.
Twilio developer evangelist here.
There's no direct way to start and stop recording a call, however you could manage this using <Gather> and <Conference>.
The idea would be that callers would join a conference (even if there's just two of them) which recorded their call using the record attribute.
You would wrap that <Conference> in a <Gather> that was waiting for a caller to dial a particular digit which stops recording by redirecting the caller who pressed the digit to a new <Conference> without the record attribute set.
You will also need to redirect the other call to that conference too. When you get the webhook after the first caller pressed a digit to stop recording you can fire off a REST API call to redirect the second caller to the new non-recorded conference.
If you wrap this second <Conference> in a <Gather> too, you can reverse this process to start recording again.
Let me know if that helps at all.
[edit]
As a further consideration, I realised that you indicated you need a user to press a button to start or stop recording. I initially thought of this as a button on your phone, which is why I suggested using <Gather>. If, however, the user in control of recording is an agent in a call centre, for example, you could build an easier interface using Twilio Client to make or receive the calls.
Then, when the calls are connected into the initial conference you'd need to record both the Call SIDs.
You could then implement a button in your interface that when pressed transfers both calls from a recording conference to a non recording conference (or vice versa). Again, this would use the REST API to redirect the calls.

Resources