Configuring Twilio Webhook
Bot URLs for developmentVisit this section to learn how to generate
the required bot URL when testing the channel on your local machine.
Select the option “Webhook, TwiML Bin, Function, Studio Flow, Proxy Service” and set the URL of your Rasa Server as webhook. Depending on the hostname, the webhook URL would be

Using Basic Authentication
Basic AuthenticationRasa supports Basic Authentication for Twilio Media Streams
in Rasa Pro 3.11.8+, Rasa Pro 3.12.7+ and latest releases.
Basic Rasa Configuration
Create or edit yourcredentials.yml and add the following channel configuration:
credentials.yml
Basic AuthenticationSupport for
username and password parameters is available
in Rasa Pro 3.11.8+, Rasa Pro 3.12.7+ and latest releases.server_url(required): The domain at which Rasa server is available. Do not include protocol (ws:// or wss://). For example, if your server is deployed onhttps://example.ngrok.app,server_urlshould beexample.ngrok.app.asr(required): Configuration for Automatic Speech Recognition. See Speech Integrations for a list of ASR engines for which Rasa provides built-in integration with.tts(required): Configuration for Text-To-Speech. See Speech Integrations for a list of TTS engines for which Rasa provides built-in integration with.username(optional): Basic authentication username for Twilio Media Streams channel.password(optional): Basic authentication password for Twilio Media Streams channel.interruptions(optional): Configuration for interruption handling. This allows the assistant to detect when users interrupt while the assistant is speaking and respond more naturally. See Interruption Handling for more information.
rasa run. You’ll need a URL accessible by Twilio for your Rasa assistant. For development, you can use tools like ngrok or Cloudflare Tunnel.
You can also run it with a development inspector using rasa run --inspect.
To see all available parameters for this command, use rasa run -h.
Usage
Receiving Audio
When a user speaks, Twilio streams the audio to Rasa where:- The audio stream is collected and buffered
- The configured ASR service converts speech to text
- The text is processed by Rasa’s NLU pipeline
Sending Responses
For bot responses:- Rasa generates text responses
- The configured TTS service converts text to audio
- Audio is streamed back to Twilio
Call Events
Like other voice channels, the following events are supported:Call Metadata
Metadata about the call can be accessed by the slotsession_started_metadata
in the beginning of the call. Following fields are available:
A custom
action_session_start can be used to store this information to a slot.