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.
Prerequisites
Before starting, you’ll need:- Plivo account - Request Trial
- LiveKit Cloud account - Create account
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.- On your Plivo console, navigate to SIP Trunking → Inbound Trunks.
- Click Create New Inbound Trunk and configure:
None
- Add a URI by clicking Add New URI:
None
- Replace
your-project-SIP-URIwith your actual LiveKit SIP URI (LiveKit Dashboard: Settings > Project). - Click Create Trunk.
Connect your phone number
Route your Plivo phone number to the trunk you just created.- Navigate to Your Numbers.
- Click on your phone number to configure it.
- Update these settings:
- Application Type: Select
SIP Trunking. - Trunk: Select
LiveKit-Inbound.
- Application Type: Select
- Click Update Number.
Configure LiveKit to accept calls
LiveKit needs to know how to handle incoming calls. Follow these guides:- Create an inbound trunk in LiveKit with your phone number.
- Set up dispatch rules to route calls to your AI agent.
Test incoming calls
Call your Plivo number from any phone. You should:- Hear the call connect.
- Have the call routed to LiveKit.
- Have two-way audio working.
- 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
- Navigate to SIP Trunking → Outbound Trunks.
- Click Create New Outbound Trunk.
- Add credentials by clicking Add New Credentials List:
None
- Configure trunk settings:
None
- Click Create Trunk and copy the Termination SIP Domain:
None
Configure LiveKit for outbound calls
Use the credentials from Plivo to set up LiveKit:- Create an outbound trunk in LiveKit.
- 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.