This guide covers Pipecat Cloud-specific configuration for Plivo WebSocket
integration. For a complete guide including dial-in, dial-out, and advanced
features, see the Plivo WebSocket Integration
guide.
How It Works
Pipecat Cloud implements Plivo’s bidirectional Media Streaming protocol. While audio streams flow through WebSockets, the call session is controlled by XML responses that tell Plivo how to handle each call. When Pipecat Cloud receives an incoming WebSocket connection from Plivo, it processes thestart message to initialize a new bot instance. All WebSocket messages are forwarded to your bot, including call information such as the caller’s number and call UUID. This allows your bot to leverage Plivo’s Voice 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:- A Plivo account with voice capabilities
- A Pipecat Cloud account with a Plivo WebSocket-compatible bot
- A web server to host XML responses (we’ll show you how to set this up)
Pipecat Cloud Configuration
1. Get Your Organization Name
Retrieve your Pipecat Cloud organization name using the Pipecat CLI:2. Set Up an XML Server
Unlike Twilio’s TwiML Bins, Plivo requires a web server to host your XML responses. Create a file calledserver.py:
Using Regional EndpointsIf you deployed your agent to a specific region, use the regional WebSocket endpoint:
wss://{region}.api.pipecat.daily.co/ws/plivo?serviceHost=AGENT_NAME.ORGANIZATION_NAMEFor example, for Europe: wss://eu-central.api.pipecat.daily.co/ws/plivo?serviceHost=my-agent.my-orgLearn more about regional endpoints.3. Deploy Your XML Server
Install dependencies and run your server:https://abc123.ngrok.io.
For production, deploy your XML server to a reliable hosting platform.
4. Configure Plivo
Purchase a phone number from Plivo if you haven’t already, then:- Navigate to Voice → XML in your Plivo dashboard
- Select Add New Application
- Enter a name for your application (e.g., “Pipecat WebSocket”)
- Set the Answer URL to your server URL with agent and organization parameters:
- Replace
AGENT_NAMEwith your deployed bot’s name (e.g.,my-first-agent) - Replace
ORGANIZATION_NAMEwith your organization name from step 1 (e.g.,three-random-words-randomnumber)
- Replace
- Set HTTP Method to
GET - Click Create Application
5. Assign to Your Phone Number
- Navigate to Phone Numbers and select your phone number
- Select XML Application as the Application Type
- Select your XML Application from the Plivo Application dropdown
- Click Update to apply your changes