Use Twilio Voice as a Channel
Twilio Alpha - Developer Preview
AI Assistants is a Twilio Alpha project that's in Developer Preview.
View the current limitations for details about feature limits during developer preview.
Legal Notice
AI Assistants, including connecting AI Assistants to Twilio Voice, is currently available as a developer preview and the information contained in this document is subject to change. As a developer preview release, AI Assistants is made available to a limited number of customers for testing purposes only. Some features are not yet implemented and others may be changed before the product is declared as Generally Available. Developer preview products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
AI Assistants, including connecting AI Assistants to Twilio Voice, is not PCI compliant or a HIPAA Eligible Service and should not be used in Voice workflows that are subject to HIPAA or PCI.
This guide will show you how to trigger your AI Assistant via an incoming call by connecting your Assistant with Twilio Voice. To get started, you will need the following:
- A configured AI Assistant. See the Quickstart guide to setting up an Assistant if you have not configured one yet.
- A Twilio phone number. See this support article for steps on buying a Phone Number.
To trigger your AI Assistant via an incoming call, you will configure a TwiML Bin and connect it to your Twilio phone number to begin a voice session on an incoming call.
- Note the Assistant ID of your configured AI Assistant.
- Go to TwiML Bins, create a new TwiML Bin, and give it a name.
- Copy the following into the TwiML Bin, and replace "{{YOUR_ASSISTANT_ID}}" with your Assistant ID. You can also add a custom greeting.
1<Response>2<Connect>3<Assistant id="{{YOUR_ASSISTANT_ID}}" welcomeGreeting="Welcome To Twilio, How can I help you?"></Assistant>4</Connect>5</Response>
- Go to Phone Numbers and click on the number you'd like to connect your Assistant to.
-
Under
Voice Configuration
, configure with a "Webhook, TwiML Bin, Function, Studio Flow, Proxy Service". When a call comes in, select "TwiML Bin" and choose the TwiML Bin you created above.
Under the hood, Twilio AI Assistants uses Twilio ConversationRelay and can make use of the attributes outlined for the <ConversationRelay>
TwiML verb.
See the ConversationRelay documentation for the full list of options.