Overview
PlivoFrameSerializer enables integration with Plivo’s Audio Streaming WebSocket protocol, allowing your Pipecat application to handle phone calls via Plivo’s voice services with bidirectional audio conversion, DTMF event handling, and automatic call termination.
Plivo Serializer API Reference
Pipecat’s API methods for Plivo Audio Streaming integration
Example Implementation
Complete telephony examples with Plivo
Plivo Documentation
Official Plivo Audio Streaming documentation
Plivo Console
Manage phone numbers and streaming configuration
Installation
ThePlivoFrameSerializer does not require any additional dependencies beyond the core Pipecat library:
Prerequisites
Plivo Account Setup
Before using PlivoFrameSerializer, you need:- Plivo Account: Sign up at Plivo Console
- Phone Number: Purchase a Plivo phone number with voice capabilities
- Audio Streaming: Configure your phone number for WebSocket streaming
- Webhook Configuration: Set up webhook endpoints for call handling
Required Environment Variables
PLIVO_AUTH_ID: Your Plivo Auth ID for authenticationPLIVO_AUTH_TOKEN: Your Plivo Auth Token for API operations
Required Configuration
- Stream ID: Provided by Plivo during Audio Streaming connection
- Call ID: Required for automatic call termination (optional)
Key Features
- Bidirectional Audio: Convert between Pipecat and Plivo audio formats
- DTMF Handling: Process touch-tone events from callers
- Auto Hang-up: Terminate calls via Plivo’s REST API
- μ-law Encoding: Handle Plivo’s standard audio encoding format
Configuration
The Plivo Stream ID.
The associated Plivo Call ID. Required when
auto_hang_up is enabled.Plivo auth ID. Required when
auto_hang_up is enabled.Plivo auth token. Required when
auto_hang_up is enabled.Configuration parameters for audio and hang-up behavior. See InputParams below.
InputParams
| Parameter | Type | Default | Description |
|---|---|---|---|
plivo_sample_rate | int | 8000 | Sample rate used by Plivo (Hz). |
sample_rate | int | None | Optional override for pipeline input sample rate. When None, uses the pipeline’s configured rate. |
auto_hang_up | bool | True | Whether to automatically terminate the call on EndFrame or CancelFrame. |
ignore_rtvi_messages | bool | True | Whether to ignore RTVI protocol messages during serialization. |
Usage
Basic Setup
Without Auto Hang-up
Notes
- Auto hang-up credentials: When
auto_hang_upis enabled (the default), the serializer usescall_id,auth_id, andauth_tokento terminate the call via Plivo’s REST API. If any are missing, a warning is logged and the hang-up is skipped. - Audio format: Plivo uses 8kHz mu-law (PCMU) audio encoding. The serializer automatically converts between this format and Pipecat’s PCM audio.
- DTMF support: Touch-tone digit events from callers are converted to
InputDTMFFrameobjects.