How It Works
- Plivo handles phone call routing and streams real-time audio over WebSocket
- Pipecat receives audio and orchestrates the AI pipeline
- STT service converts speech to text
- LLM processes the text and generates a response
- TTS service converts the response back to speech
- Plivo plays the audio to the caller
Choose Your Stack
Pipecat supports multiple AI service combinations. Choose based on your requirements:Standard Pipelines (STT → LLM → TTS)
Speech-to-Speech (Direct Audio Processing)
Speech-to-speech models process audio directly without intermediate text conversion, resulting in lower latency and more natural conversations.
Prerequisites
Quick Start
1. Clone the Examples
2. Choose Inbound or Outbound
- Inbound calls:
cd inbound- Receive calls on your Plivo number - Outbound calls:
cd outbound- Initiate calls programmatically
3. Configure Environment
.env with your credentials (varies by provider stack).
4. Start the Server
5. Expose for Development (Inbound Only)
https://your-ngrok-url.ngrok.io/
Inbound vs Outbound Calls
Inbound Calls
Your Plivo number receives calls and connects them to your Pipecat bot. Setup:- Configure Answer URL on your Plivo number
- Plivo sends call to your server
- Server returns XML with
<Stream>element - WebSocket connection established with Pipecat
Outbound Calls
Your application initiates calls to phone numbers. Setup:- Start your Pipecat server
- Call the
/startendpoint with target phone number - Plivo places the call and connects to your bot
runner_args.body.
Troubleshooting
Debug logs:
- Server logs: Terminal running
server.py - Bot logs:
bot_<room_name>.logfiles - Plivo logs: Console > Logs > Calls
Related
- Pipecat Documentation - Complete Pipecat setup
- Pipecat Plivo Examples - Source code
- Audio Streaming Overview - Plivo Audio Streaming docs