How to detect Touch-tones (DTMF) in a Twilio video room - twilio

After following this document I can successfully add PSTN callers to a video room (Small Room type). What I haven't been able to do is to detect DTMF tones from the person calling in.
I tried two different approaches, both have failed
1) The one that I used before with a different provider and worked, but not with Twilio, was to have one of the other users in the room (not the PSTN caller but a javascript client) detect the DTMF client-side. This doesn't work with twilio because it sounds to me like twilio is manipulating the audio stream to remove the DTMFs before they reach the other users in the room (when the PSTN caller presses a number, you only hear a short "click" on the other side)
2) Inspired by this answer, I tried to reply with a TWIML
<Response>
<Connect>
<Room>my-room</Room>
</Connect>
<Gather input="dtmf">
</Gather>
</Response>
This would not be ideal since it wouldn't detect the DTMF while in the room; you would have to leave the room, but I tried it anyway to see if I could come up with a way to terminate the call to move on to the gather verb like in the linked answer. It looks like the call doesn't move to the gather part after the room ends (i tried completing the room and the PSTN call immediately ends)
Are there any other approaches that anyone has used for this? The simplest to me would be a way to tell twilio not to remove the DTMFs from the audio stream so my solution #1 would work, but I'm open to other ideas maybe leveraging twilio's gather

Twilio developer evangelist here.
It doesn't look like it's currently directly possible to detect DTMF tones in a phone call that has been connected to a video room.
One possibility is to use the new Media Stream capability to direct the live audio to your own server to detect the tones.
I have asked the team to see if there are other options though.

Related

Is it possible to replace Twilio's default ringing sound with some melody?

So the idea is pretty simple: to make caller to listen some nice melody instead of default ring beeps.
I have already looked at Twilio tutorials, but the only thing i found is that it is possible with queued calls.
Does such feature available with verb and not using queues?
Twilio developer evangelist here.
If you dropped your caller into a conference you could set the wait music while you dialled another party into the call. That's not much different to using a queue though. There's no way to just set the dialling tone while the phone is ringing, so I would recommend one of these options.
Also note, the phone may ring before Twilio is able to deal with it. That is out of our control, so you may not get your music for the entire ringing period.

Twilio Dynamic Text-To-Speech Conversation

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.

Twilio - Play an audio file to the person call is transferred to before connecting

The answer to this my be out there, but I'm having trouble locating it do to I don't know what the feature would be called.
I have a phone system setup where people call in with an option to press zero to be transferred to a live person. The person it goes to also receives calls from other places and I would like to notify them with an audio file and possibly a action with a little more info about the call before it's connected.
Example of what I would like to happen:
A call is placed to our system and they press zero, they hear on-hold music while a action is started.The phone rings in our office and the receptionist picks it up. After answering they hear something like 'incoming call from some company, connecting now', and then the call connects to the other person.
I have everything working in the system right now minus the piece of audio the receptionist would hear before the call is connected.
Is there a feature like this built into Twilio?
Twilio evangelist here.
What you're describing is called a 'whisper' and its pretty easy to set up with Twilio. I'd start by reading through the Call Screening and Recording How to which includes an example of a whisper.
Specifically, check out examples 4 and 5 which shows how to include the url attribute on the <Number> noun. The url you provide there will be requested when the second call is answered and allows you to return TwiML that Twilio will execute to that call before we bridge the two calls together.
Hope that helps.

Can Twilio detect if a call to a Google Voice number gets forwarded to voicemail or an actual person?

I have an app that creates outbound calls to set up simple conferences.
I am having difficulty dealing with dialing out to Google Voice numbers as I use IfMachine to be able to determine if the call goes to voicemail for one or more participants so that I can "fail" the conference call attempt.
Here's the issue that I am having...
Google Voice answers the call attempt and asks you to say your name before forwarding your call onto the configured endpoint for that user.
I can use IfMachine to detect this and I can automate this portion and get Google Voice to forward the call, but then I can no longer detect if the call ultimately goes to voicemail or if an actual person picks up on the other end.
any ideas?
Twilio Evangelist here,
I think given that there are 2 points you need machine detection, you may want to use a <Gather> as secondary call screening before connecting the person to a conference.
When you make the outbound call to a number, you're using IfMachine to find out if you get to Google Voice. So that's great. But because you're passed that hurdle, it won't be triggered again.
What you could do is to use call screening, to manually detect a human with some TwiML like this:
<Response>
<Gather numDigits="1" timeout="15" action="/some-conference-path">
<Say>Press any key to be connected to the Something Something Conference</Say>
</Gather>
</Response>
Then, if the call is answered by a human, they can press any key on their keypad and be redirect to the actual conference call, or if the Gather times out, you most likely got their voicemail.
You're basically combining automatic and manual machine detection as you need to do it twice at different points of the same call.
Hope this helps!

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