Prerequisites
Before connecting your AI platform to Plivo SIP trunking, you’ll need:What is SIP Trunking?
SIP trunking provides a direct connection between your infrastructure and Plivo’s voice network. For AI voice agents, this means:- Inbound calls: Route calls from Plivo phone numbers to your AI platform via SIP
- Outbound calls: Your AI agents can place calls through Plivo to any phone number worldwide
- Global reach: Access phone numbers and terminate calls globally. See coverage
Inbound vs Outbound Trunks
How It Works
- For inbound calls: Calls to your Plivo phone number are routed via SIP to your AI agent platform
- For outbound calls: Your AI agent initiates calls through Plivo’s SIP trunk to reach phone numbers
Supported Platforms
Quick Start
LiveKit
Build custom real-time voice applications with LiveKit and Plivo
ElevenLabs
Connect Plivo with ElevenLabs for natural-sounding AI voice agents
Retell AI
Connect Retell AI voice agents to the phone network with Plivo
Vapi
Deploy voice AI assistants quickly using Vapi and Plivo
Transferring to a Human Agent
When your AI agent needs to hand off a live call to a human, whether for escalations, complex queries, or compliance, use SIP REFER. Your endpoint sends a REFER request mid-call with the transfer target’s number in theRefer-To header. Plivo bridges the caller to the human agent and disconnects your AI endpoint. The caller never re-dials and experiences a seamless handoff.
How it works:
- Your AI agent is on a live call with a customer (inbound or outbound)
- Agent decides to transfer and sends
REFERwith the target number - Plivo responds
202 Acceptedand starts calling the transfer target - Transfer target answers: Plivo bridges the caller and sends your agent a
BYE - Caller and human agent continue the conversation
- The
Refer-ToURI must use your SIP trunk domain (ending in.zt.plivo.com) - Your endpoint must handle
NOTIFYmessages from Plivo to track transfer progress - Do not send
BYEbefore receivingNOTIFY 200 OK, as this would drop the caller - If the transfer fails, the caller stays on your AI agent’s line, so you can retry or continue
Outbound call transfer
Your AI agent placed the call and wants to hand off.
Inbound call transfer
A caller dialled your Plivo number and your AI agent wants to hand off.
Regional Considerations
If you’re handling calls to or from India, ensure your AI platform has servers deployed in India to comply with regulatory requirements. See the individual integration guides for platform-specific instructions.Related
- SIP Trunking Overview - Complete SIP trunking documentation
- SIP Trunking API Reference - Programmatically manage trunks
- Technical Specifications - Codecs, protocols, and supported features