In September we introduced you to <Queue>, a simple way to build and manage call queues with just a few lines of TwiML. Queue gives you the ability to easily route inbound calls, whether you are building a simple call waiting solution or a large, dynamic call center.
Today we’re launching <Gather> supported by <Queue>, which allows your caller to interact with your application while sitting in a call queue. This gives you the ability to make the most of your customers’ wait time, from collecting caller information to providing them with options to act on.
Where Would I Use <Gather> in <Queue>?
Gather in Queue saves valuable time for both you and your customers. Use this new feature to:
- Exit hold to leave a voicemail for a call back.
- Enter important account information before connecting to an agent.
- Make the wait time fun by changing the hold music or playing a trivia game.
- How are you using <Gather> in <Queue>? Email community@twilio.com and tell us how it works for you.
Enough Talk, Let’s Build it
Here is a simple Twilio app. It loops through a countdown, and lets a user interrupt by pressing any two keys. Then, it repeats back the number the user entered:
First your caller will enter the queue:
index.php:
<Response> <Say> Your Intergalactic Agent will be with you shortly, please answer the following question so we can better serve you </Say> <Enqueue waitUrl="/decisions.php">test</Enqueue> </Response>
Now you can collect information from your caller while the are waiting in the queue:
decisions.php:
<Response> <Gather numDigits="1" action="/processgather.php"> <Say>What is the Answer to the Ultimate Question of Life, the Universe, and Everything?</Say> <Say>Choose 1 for the TARDIS</Say> <Say>Choose 2 for The Matrix</Say <Say>Choose 3 for 42</Say> <Say>Choose 4 for Cylon Leaders</Say> <Say>Stay on the line to hear these options again.</Say> <Gather> </Response>
Gather captures that answer and reads it back to the caller on the line:
processgather.php:
<?php $digits = $_POST['Digits']; ?> <Response> <Say>you typed <?php echo $digits; ?></Say> <Say>Thank you! Please hold for the next available Intergalactic Agent</Say> </Response>
At no point does your caller have to exit the call queue. It’s that simple. Ready to build your own? Read the docs on <Gather> and Queue.
Learn more about Queue
If you are new to Queue we have a great list of resources to help you get started. We’re always listening, if you have any questions just send us a note.
- Walk through the Queue How To in XML, PHP and Python
- Watch the Quickstart Screencast
- Watch ‘How to Build a Customer Support Line with Queue”
- Check out the Twilio Queue Hack Pack For Python, on GitHub
- Build your own realtime Queue Dashboard
- See the difference the new Queue feature makes in the amount of code you have to write
We’re excited to share this new feature with you and continue to expand our capabilities in Queue. Stay tuned for more in-depth tutorials on building with Queue.