Twilio Dynamic Text-To-Speech Conversation - twilio

I'm new to using the Twilio API and I essentially want someone to be able to send text and have it be read out in the phone call, but then keep the line open so that more text can be sent at a later time.
It seems like I should be using the Programmable Voice API along with TwilML, but the problem I am having is that once the TwilML instructions are completed the call ends. Is there anyway I can stop this from happening and have the call wait for a Rest API update to be sent to the phone call to have it say new text?

Twilio developer evangelist here.
There are a few ways you could deal with this, but I believe the best would be to use <Enqueue>. Once your TwiML is played out, you can <Enqueue> the call and then provide a waitUrl that points to an endpoint that returns more TwiML to play to the user while they wait. This will automatically loop while the user remains in the queue. You could use this to simply <Pause> indefinitely or <Play> background music. Then, once you have more text to read to the user you can redirect the call by updating it.
Let me know if that helps at all.

Related

Is there any way to retrieve multiple records from a Twilio call?

I would like to know if there is anyway to retrieve multiple record from a twilio call. What I am trying to do is to get voice responses records from my users.Once I have those I would apply my own NLP software to do some Speech to text.For now what I got is a TWIml bin doing then a then in action url I would like to do something to do a new and a new everything in the same call.
Twilio developer evangelist here.
Every time you use <Record> during a call and the recording completes, the URL of that recording is sent to the recordingStatusCallback attribute that you can set on the TwiML.
Once the call is complete, you can also use the Twilio REST API to retrieve all the recordings for a call.
I'm not sure what else you were asking. I hope this helps.

Twilio - Is there a way to bypass voicemail

I have a twilio app that provides an on-call list of phone numbers that our customer's can call and speak to one of our on-support developers.
I need to find a solution that will allow the caller to press a key to bypass the voicemail of a the calling party and be redirected to the next person in the on-call list. Right now, if I call my twilio app using my number and I get the calling party voicemail, I don't have an option to move onto the next person in the call list.
Is there a way to mimic the hangupOnStar feature when a caller gets a person voicemail in twilio?
Thanks,
I had a look into this and unfortunately it does not look like you can nest <Dial> within <Gather> otherwise this might be possible.
What I would recommend is when you receive an inbound call, play a message along the lines of "Please wait a moment while we connect an available developer", then <Enqueue> the call.
At this point your application can start calling the developers and when the line connects ask them to press #, when this happens you can <Dial> the developers call into the queue ID Twilio proved in the last call to you app, and the calls will be bridged. If the developer did not press # then you can assume that it went to voicemail, at which point <Hangup> and initiate a call to the next dev on call.
Hope that helps.

Twilio: How do I always place a "All calles are being monitored message" for incoming calls?

For incoming calls:
1) I am new to twilio, but I always want a "All calls are being monitored or recorded" to play for all incoming calls. What is the best way to do this?
2) I would like to create two messages after the "monitoring" message is played. one message during open hours and a second message during closed hours.
What is the best way to do this? Any good documentation?
Twilio developer evangelist here.
Welcome to using Twilio! I'll give you a quick overview of how incoming calls to Twilio work then point you to some useful parts of our documentation that will help you achieve what you are working towards.
When a Twilio phone number receives an incoming call, Twilio will send an HTTP request to your web application, asking for instructions on how to handle the call. Your web application will respond with an XML document containing TwiML. That TwiML contains the instruction that Twilio will follow to say some arbitrary text, play an MP3 file, make a recording and much more.
In your case you want to read messages to the caller, you could either do that by returning TwiML that uses <Say> to read out the messages using our text to speech engine. Or you could record yourself reading the message and play that to the caller using the <Play> TwiML.
To learn more:
Follow the Programmable Voice Quickstart
If you need more specific instruction on a particular Twilio feature, check out the Twilio Guides
If you need to see Twilio features as part of a complete application, check out the Twilio Tutorials which cover more specific use cases
Let me know if that helps at all.

recording a twiml response via Twilio

I've looked at the docs and haven't found anything that is capable of what I'm trying to do. Basically I have the phone call user do a input via a GATHER, and is prompted with a twiml SAY response. Is there a way to record ONLY the response? Most of the recording options record either the user only, or the entire phone call
Gather response cannot be recorded. If you need to know what user had entered, just say entered digits in gather action.
Gather Documentation

Use incoming caller ID on Twilio to make outgoing call

I'm wondering if the following is possible:
Caller rings Twilio number which gets answered and then automated message is played.
Caller is placed in a queue
In parallel to this, our system dials a number (using the rest API) showing the caller id of the incoming call, plays a gather to verify the user wants to pick up, and then connects the call.
I know that the easiest way to achieve something similar to this is to redirect the incoming call with a Dial verb, but for reasons that aren't really relevant to the question that isn't possible.
Twilio evangelist here.
Yes, this is possible, with the caveat that the initial callers phone number must be previously verified with Twilio. See this topic in the help center:
http://www.twilio.com/help/faq/voice/can-i-use-a-non-twilio-number-as-the-caller-id-for-outgoing-calls
Hope that helps.
Devin

Resources