Interactive Voice Response
Learn how to build an Interactive Voice Response (IVR) system to create automated phone menus, look up information, and route inbound callers. An IVR system works by gathering DTMF (touch-tone) keypad presses or spoken voice inputs from incoming callers. You can use this guide to implement self-service automation and build inbound contact centers.
See Related reference documentation to learn more about the TwiML elements used in this guide.
By combining decoded DTMF tones with some web application logic, you'll be building your call center's menu in no time. Here we've gathered snippets, tutorials, guides, and full sample applications for various IVR use cases across many web languages and frameworks.
Not a developer? See our IVR page and our high level Interactive Voice Response Buildout view.
The most common IVR use case is to build a navigation menu for incoming callers. For common cases, this should get your customers - and potential customers - to the right department. These tutorials show how to use the TwiML <Gather> verb with common web languages and frameworks to create a phone tree.
- Node.js and Express.js
- Python and Flask
- Ruby on Rails
- C# and ASP.NET MVC
- Java Servlets
- PHP and Laravel
You can also add voicemail support to your contact center for when the call center's closed or a customer needs a callback. These sample applications use the TwiML <Record> Verb then automatically transcribe calls to text for your agents (and salespeople) to better route or handle.
Your particular IVR setup will be unique to your business, but you can tie-in a lot of prior art and best practices from our sample applications and customer examples. We also give you the freedom you need to include your IVR and routing logic into Salesforce or your CRM. These links show how others have built IVRs with Twilio in the past - both with our library-supported languages and others as well.
- Integrating a Twilio IVR with Salesforce and Call Tracking
- RingDNA: Building a Twilio IVR with Haskell
- Using PHP and ngrok to Build a Jukebox Phone Tree
- Implementing Long-running IVR Tasks in C# with a Twilio IVR
- Scaling a Twilio PHP IVR to Over 60,000 Calls a Day
- Building a Serverless and Codeless Twilio IVR with TaskRouter
- Validating Twilio IVR Webhooks with Python and Pyramid
Interactive Voice Response is both a tool and a means to an end in your contact center. The best setups tie seamlessly into tools such as TaskRouter to instantly assign tasks to human operators when needed, or use transcription and recording to assist your workforce. Your Twilio IVR build will save customer time and reduce negative feedback (and customer frustration!) while getting people where they need to go.
We're always ready to help you with your implementation and best practices - get in touch with sales or support and we'll get you going with IVR in no-time flat.
This guide covers a feature that can support the following use cases:
You can use the feature in this guide to build automated pathways that gather user intent without requiring live operator intervention. For example, you can build touch-tone phone trees that enable customers to look up account details, handle basic transactions, or self-route to specific assistance queues. To learn more advanced features that you can use with self-service automation, see Voice self-service automation.
You can use the feature in this guide to structure complex routing rules for handling massive inbound call volumes efficiently. Callers can select departments or query systems via keypad options before being automatically assigned to the right agents or support queues. To learn more advanced features that you can use with inbound contact centers, see Voice inbound contact center.
Explore the following guides to build on what you've learned in this guide:
- Gather user input via keypad (DTMF tones): Collect telephone button inputs from your customers using backend application code.
- Respond to incoming phone calls: Learn how to capture incoming webhooks and handle voice triggers seamlessly.
- Record phone calls: Capture and store full audio files from ongoing communication channels.
- Queue calls: Hold incoming customer calls in sequential order until a representative is available.