Twilio Conference Call: how to add options menu - twilio

Hello to Twilio Developer Evangelists here :)
Is there an easy way to add options menu (not sure if I call it right) to conference call, so all participants have ability to perform some actions by pressing numbers.
At this moment the only way I can see how this can be implemented - add outgoing call with to conference call. But I'm still playing with it, so not sure if this would work...
Thank you!

Twilio evangelist here :)
One way I've done this before is by using the hangupOnStar attribute of the <Dial> verb.
As long as you've not provided an action parameter on the <Dial> verb, if the caller hits * while in the conference room, Twilio will disconnect them from the conference room and execute the next verb in your Twilio document, which could be a <Gather> containing a menu:
<Response>
<Dial hangupOnStar="true">
<Conference>YourConference</Conference>
</Dial>
<Gather action="http://example.com/processConferenceMenu?confName=YourConference" numDigits="1">
<Say>To mute all participants, press one</Say>
<Say>To leave the conference, press two</Say>
</Gather>
</Response>
In the processConferenceMenu endpoint you would process whatever value the caller has input durung the gather and then if needed put then right back into the same conference room.
I've created systems which let users use *6 (the standard self-mute command) without any menu prompts and the lag between when the user leaves and then re-enters the conference muted was barely noticeable.
Hope that helps.

Related

How to play a message for the second caller to hear

I tried as follows, but it is not working. How is it possible?
How to add <Say> inside the <Dial>?
<Response>
<Say>Hi, This call is from ...</Say>
<Dial>
<Say>Hi, This call is from ...</Say>
<Number
statusCallbackEvent="initiated ringing answered completed"
statusCallback="my_url"
statusCallbackMethod="POST">
+12345678901
</Number>
</Dial>
</Response>
You need to use the Dial verb with Number noun (url parameter) to play a message to the dialed party before the two call legs are connected.
Whisper Page /
I believe you are looking for the Twilio: Voice - https://www.twilio.com/docs/api/twiml/number, the verb's noun.
The Number noun has a URL parameter that points to TwiML to privately play or say information to the called party, or provide a chance to decline the phone call using and . The current caller will continue to hear ringing while the TwiML document executes on the other end.
To set-up a quick example, you can use a couple of TwiML Bins. One will be used as the TwiML source for the Number URL to speak, and the other will forward a call from a Twilio number to another number.
To create a TwiML Bin, go to this URL: https://www.twilio.com/console/runtime/twiml-bins
Click the big red "+" to create a TwiML Bin, give it a Friendly Name, and paste in the code below.
This TwiML will be reference in the second TwiML Bin Below:
<Response>
<Say voice="alice">
Incoming work call. In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.
</Say>
</Response>
Verify the message at the bottom of the edit box says, "Valid Voice TwiML" and then click Create.
At the top of the screen, save the URL to this TwiML Bin by clicking the Copy Icon and copying it to notepad.
Click Cancel.
Click the big red "+" to create another TwiML Bin, giving it a Friendly Name, and paste in the code below.
Edit the URL (bold) to be the URL you copied to notepad from above, and edit the number you want to call in E.164 format (this is the Agent's Phone Number).
Verify the message at the bottom of the edit box says, "Valid Voice TwiML" and then click Create.
<Response>
<Dial>
<Number url="https://handler.twilio.com/twiml/<replace with your URL>">
+1XXXXXXXXXX
</Number>
</Dial>
</Response>
Associate the 2nd TwiML Bin above (the one with the URL) to your Twilio Phone Number by visiting this URL - https://www.twilio.com/console/phone-numbers/incoming, clicking your Twilio phone number the calling party will use to call the agent, and then selecting the TwiML Bin from the drop down box next to Voice & FAX > A Call Comes In and click Save.
What happens now is when your Twilio number is called and the Agent answers, they will hear the text above in the first TwiML Bin (while the called party will hear ring back, until the text being read is completed, then both parties will be connected).
Having another <Say> tag within <Dial> results in invalid TwiML, which explains why this isn't working.
FYI: You can use the TwiML editor in the console to find out if your TwiML is valid.
Can you explain in more detail what you want to achieve with the two <Say> elements?

Gather verb is not working for 1st participant in conference only work for last connected participant

basically I want to connect third participant (A PSTN no) on ongoing call when conference owner press a key
here is my Twiml :-
<Response>
<Dial hangupOnStar="true">
<Conference">PSTNConf</Conference>
</Dial>
<Gather action="/action/url" digits="1"/>
</Response>
this is work fine till second participant not connect when second participant join the conference Gather verb is not work for 1st participant
I want both participants in a conference then Conference owner (1st participant) decided to add third participant using gather verb
Twilio developer evangelist here.
<Gather> cannot actually work with a <Conference>. You can only nest <Say>, <Play> or <Pause> within a <Gather> element.
The nearest you can get to this is to include the hangupOnStar="true" attribute on the <Dial> element as well as an action URL. Then, when one of your callers presses * they will drop out of the conference and Twilio will request the action URL, you can then return TwiML including a <Gather> if you want to take more input, or just use the webhook to dial another caller into the conference.
If you complete the action by returning TwiML that dials the caller back into the original conference, then they will rejoin and continue.
Let me know if that helps at all.

twilio conference - get dialedin participants phone input

All the participants to my twilio conference are muted except the presenter.
I need to implement a feature where the dialed in participant wants to ask a question by dialing a key on his phone.
Essentially a 'raise hand' feature. He can then be unmuted by the moderator and allowed to ask his question.
I already have a build in dashboard to mute/unmute the participants.
is there a way that the caller can hit *1 or some combination of keys that I can then use in my callback.
I've tried using * with hanguponstar functionality but it basically exits the caller from the conference.
Thanks,
Amit
Twilio developer evangelist here.
If you use hangupOnStar and add further TwiML after the <Dial> then the call will continue for the user. So, you could do something like:
<Response>
<Dial hangupOnStar="true">
<Conference>MyConferenceRoom</Conference>
</Dial>
<Redirect>/handUp</Redirect>
</Response>
You would redirect the caller through a /handup action. In this action you could register the caller's question and respond with TwiML to dial them back into the <Conference>.
Note, if you have an action attribute for your <Dial> then the call will follow that rather than carry on with the TwiML in the original action.
Let me know if that helps at all.

With Twilio, is it possible to receive user input during a conference call?

The Twilio documentation mentions that you can collect user keypad input while they are listening to a message:
You can nest the following verbs within Gather: Say, Play, Pause. But you can't nest Gather within any other verbs.
The Conference tag cannot be nested within the Gather tag, so is there another way to collect user digits once they are connected to a conference room using the Conference tag?
Twilio evangelist here.
There isn't a way to <Gather> while in a conference call, but there is a work around. You can leverage the <Dial> verbs hangupOnStar attribute.
<Response>
<Dial hangupOnStar="true">
<Conference>example</Conference>
</Dial>
<Gather action="/redirectIntoConference?name=example" numDigits="1"></Gather>
</Response>
When the user presses the * key, Twilio will disconnect them fro mthe conference call and immediately start to listen for them to press tones. When the Gather completes you would just redirect them back into the conference call.
This enables you to do things like the standard *6 key combination to mute.
Hope that helps.

Twilio checking if human representative is on the line

I'm thinking of a scenario where web app with twilio api first makes an outbound call to a customer service number, send digits to get transferred to the agent, and instead of waiting on hold, I would like the web app to detect when human picks up the call and calls the user's phone number. Is there a way to do this?
Twilio evangelist here.
There isn't an automated way to detect that a human has answered the call. You could put a prompt in the phone call that the agent can input in order to indicate that they have answered the call. Something like:
<Response>
<Gather action="process/" numDigits="1">
<Say>Please press one to connect to the incoming call</Say>
</Gather>
</Response>
Hope that helps.

Resources