How It Works
Pipecat Cloud implements Exotel’s bidirectional voice streaming protocol. While audio streams flow through WebSockets, the call session is controlled through Exotel’s App Bazaar configuration and the Voicebot Applet. When Pipecat Cloud receives an incoming WebSocket connection from Exotel, it processes theConnected
and Start
messages to initialize a new bot instance. All WebSocket messages are forwarded to your bot, including any custom parameters set in your App Bazaar configuration. This allows your bot to leverage Exotel’s API for advanced call control - such as recording conversations, transferring to human agents, or implementing complex call flows.
Prerequisites
Before setting up this integration, ensure you have:- An Exotel account with voice streaming enabled
- A Pipecat Cloud account with an Exotel Websockets-compatible bot
Exotel Setup
To connect your Pipecat Cloud bot to Exotel’s voice network:-
Purchase a phone number from Exotel if you haven’t already:
- Log in to the Exotel dashboard: https://my.exotel.com/
- Navigate to ExoPhones and purchase a number
- Complete KYC verification if required
-
Enable Voice Streaming (if not already enabled):
Voice streaming may not be enabled by default on all accounts:
- Contact Exotel support at
hello@exotel.com
- Request: “Enable Voicebot Applet for voice streaming for account [Your Account SID]”
- Include your use case: “AI voice bot integration”
- Contact Exotel support at
-
Retrieve your Pipecat Cloud organization name using the
pipecatcloud
CLI. This information is required when creating the App Bazaar configuration.This command will output a list of organizations associated with your account. For example: -
Create a Custom App in App Bazaar:
- Navigate to App Bazaar in your Exotel dashboard
- Click “Create” to create a new app or edit an existing app
- Build your call flow:
- Drag the “Voicebot” applet to your call flow (not “Stream” or “Passthru”)
- Configure the Voicebot Applet with the following URL:
Replace the placeholder values:AGENT_NAME
with your deployed bot’s name (e.g.,customer-support
)ORGANIZATION_NAME
with your organization name from step 3 (e.g.,three-random-words-randomnumber
)
wss://api.pipecat.daily.co/ws/exotel?serviceHost=customer-support.industrious-purple-cat-12345
Optional Configuration:- Record: Enable if you want call recordings
- Additional Parameters: You can add up to 2 more custom parameters to the URL (Exotel supports 3 total)
- Example:
wss://api.pipecat.daily.co/ws/exotel?serviceHost=customer-support.acme-corp&botType=sales&priority=high
- Example:
- Drag a “Hangup” applet at the end to properly terminate calls
-
Link your phone number to the app:
- Navigate to “ExoPhones” in your dashboard
- Find your purchased number and click the edit/pencil icon
- Under “App”, select the custom app you created
- Save the configuration
Making and Receiving Calls
Receiving Inbound Calls
To test your integration, simply dial your Exotel phone number from any phone. The call will connect to your Pipecat Cloud bot, which will respond according to your bot’s configuration.Making Outbound Calls
To initiate outbound calls, refer to the Exotel WebSocket Integration guide for complete dial-out implementation details and examples.Custom Data Requirements
Currently, there are limitations with passing custom data through query
parameters in Exotel’s WebSocket URLs. While the platform theoretically
supports query parameters, they may be stripped during call processing.
Advanced Call Control
Your bot can control the active call by leveraging Exotel’s REST API with theCallSid
that’s automatically provided to your bot. This enables capabilities such as:
- Recording conversations
- DTMF collection and processing
- Real-time call monitoring