Skip to main content
Connect Plivo’s SIP trunking with LiveKit for voice call infrastructure. This guide takes approximately 15 minutes to complete.

What you’ll build

  • Inbound calling: Configure a Plivo phone number to route incoming calls to LiveKit.
  • Outbound calling: Enable outbound calls from LiveKit through Plivo to phone numbers.
This guide covers both scenarios. Implement based on your requirements.

Prerequisites

Before starting, you’ll need:

Part 1: Receive incoming calls

Set up LiveKit to receive calls when someone dials your Plivo phone number.

Create an inbound trunk in Plivo

An inbound trunk tells Plivo where to send incoming calls.
  1. On your Plivo console, navigate to SIP Trunking → Inbound Trunks.
  2. Click Create New Inbound Trunk and configure:
None
Trunk Name: LiveKit-Inbound
  1. Add a URI by clicking Add New URI:
None
Name: LiveKit-Primary
SIP URI: your-project-SIP-URI;transport=tcp
  1. Replace your-project-SIP-URI with your actual LiveKit SIP URI (LiveKit Dashboard: Settings > Project).
  2. Click Create Trunk.

Connect your phone number

Route your Plivo phone number to the trunk you just created.
  1. Navigate to Your Numbers.
  2. Click on your phone number to configure it.
  3. Update these settings:
    • Application Type: Select SIP Trunking.
    • Trunk: Select LiveKit-Inbound.
  4. Click Update Number.

Configure LiveKit to accept calls

LiveKit needs to know how to handle incoming calls. Follow these guides:
  1. Create an inbound trunk in LiveKit with your phone number.
  2. Set up dispatch rules to route calls to your AI agent.

Test incoming calls

Call your Plivo number from any phone. You should:
  1. Hear the call connect.
  2. Have the call routed to LiveKit.
  3. Have two-way audio working.
Check logs if you encounter issues:
  • For inbound calls: Check Plivo logs first.
  • Then check: LiveKit logs in your dashboard.

Part 2: Make outgoing calls

Enable outbound calling from LiveKit through Plivo. You will need to use a Plivo number as the caller ID - this is the number that appears on the recipient’s phone.

Create an outbound trunk in Plivo

  1. Navigate to SIP Trunking → Outbound Trunks.
  2. Click Create New Outbound Trunk.
  3. Add credentials by clicking Add New Credentials List:
None
Name: LiveKit-Auth
Username: livekit_trunk
Password: [generate strong password]
  1. Configure trunk settings:
None
Trunk Name: LiveKit-Outbound
Secure Trunking: Enabled (recommended)
  1. Click Create Trunk and copy the Termination SIP Domain:
None
Example: XXXXXXXXXXXX.zt.plivo.com

Configure LiveKit for outbound calls

Use the credentials from Plivo to set up LiveKit:
  1. Create an outbound trunk in LiveKit.
  2. Use your Termination SIP Domain and credentials from above.

Make your first call

Use LiveKit’s API to initiate an outbound call. See LiveKit’s documentation for SDK examples.

Troubleshooting

Common issues

Call doesn’t connect
  • Verify your SIP URI format includes ;transport=tcp.
  • Check that the phone number is mapped to correct trunk.
  • For inbound: Check Plivo logs first.
  • For outbound: Check LiveKit logs first.

Error codes reference

View Plivo’s hangup codes for detailed explanations of errors.

Regional deployment

If you’re handling calls to or from India (whether using Plivo India phone numbers or calling Indian numbers), you must select India as your LiveKit region. This is a regulatory requirement - calls will fail if your LiveKit region doesn’t match. For other countries, choose the region closest to your call traffic location for optimal performance.

Get help