Native support for Exotel’s WebSocket Transport with Pipecat Cloud allows you to connect your AI agents with Exotel’s voice infrastructure. This integration enables your Pipecat bots to handle real phone calls using Exotel’s Voice Streaming.

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 the Connected 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
A ready-to-build example of an Exotel websockets bot with complete source code is available on our Github. Follow the steps to build and deploy the image.

Exotel Setup

To connect your Pipecat Cloud bot to Exotel’s voice network:
  1. 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
  2. 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”
  3. Retrieve your Pipecat Cloud organization name using the pipecatcloud CLI. This information is required when creating the App Bazaar configuration.
    pcc organizations list
    
    This command will output a list of organizations associated with your account. For example:
    Organization        Name
    ──────────────────────────────────────
    Default Workspace   three-random-words-randomnumber (active)
    
  4. 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:
    Add Voicebot Applet
    • Drag the “Voicebot” applet to your call flow (not “Stream” or “Passthru”)
    • Configure the Voicebot Applet with the following URL:
    wss://api.pipecat.daily.co/ws/exotel?serviceHost=AGENT_NAME.ORGANIZATION_NAME
    
    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)
    For example, if your agent is named “customer-support” and your organization is “industrious-purple-cat-12345”, your URL would be: 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
    Add Hangup Applet
    • Drag a “Hangup” applet at the end to properly terminate calls
    Your final flow should look like:
    Call Start → [Voicebot Applet] → [Hangup Applet]
    
  5. 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.

Advanced Call Control

Your bot can control the active call by leveraging Exotel’s REST API with the CallSid that’s automatically provided to your bot. This enables capabilities such as:
  • Recording conversations
  • DTMF collection and processing
  • Real-time call monitoring
For examples of these advanced features, refer to the sample implementation on GitHub and Exotel’s API documentation.