Skip to main content
The Plivo side of a voice agent integration is the same regardless of which orchestration platform you use. If your platform supports SIP trunking, this guide connects it to the phone network through Plivo, even if Plivo doesn’t have a dedicated guide for it. Each step includes both the API and the Console option.

Prerequisites

If you’re using the API, you also need your Plivo Auth ID and Auth Token, available on the Plivo Console home page. Export them as environment variables to use with the code samples in this guide:
From your platform’s documentation, you need three facts:
  1. Its SIP endpoint: the host Plivo should send inbound calls to (often sip.<platform>.com), and which transport it expects (UDP, TCP, or TLS)
  2. Its outbound authentication method: SIP digest credentials (username and password), or a published list of static IP addresses
  3. Where to enter Plivo’s details: the screen where you register a phone number and configure a SIP trunk
India traffic: calls to or from India require your platform to terminate SIP and media in India. See Calling in India before you start.

Part 1: Receive Incoming Calls

Route calls from your Plivo phone number to your platform.

Step 1: Create an Inbound Trunk in Plivo

First, create an origination URI that points to your platform’s SIP endpoint, including the transport parameter it expects:
Copy the uri_uuid from the response. Next, create an inbound trunk using the origination URI as the primary URI:
Copy the trunk_id from the response. You use it to connect your phone number in the next step.
The transport parameter must match what your platform expects. A mismatch is the most common reason an inbound integration fails silently. For TLS, use port 5061: sip.example-platform.com:5061;transport=tls.

Step 2: Connect Your Phone Number

Assign the inbound trunk to your phone number using the update a number endpoint. Set the app_id field to the trunk ID of your inbound trunk. Use your phone number in E.164 format without the leading +. For example, 15105550100:
A successful response returns HTTP 202 with the message changed.

Step 3: Configure Your Platform

On your platform, register the Plivo number and attach an agent to it. This step varies by platform; look for “SIP trunk”, “BYO carrier”, or “phone numbers” in its documentation. Call your Plivo number. Your agent should answer.

Part 2: Make Outgoing Calls

Enable your platform to place calls through Plivo.

Step 1: Create Authentication

Choose the method your platform supports: SIP digest credentials when your platform authenticates with a username and password or its IPs are dynamic, or an IP access control list when it publishes static IP addresses for its SIP traffic.
To create a credential, use a username of 5 to 20 alphanumeric characters and a password of 5 to 20 characters with at least one of the special characters ~!@#$%^&*()_+:
Copy the credential_uuid from the response.Alternatively, create an IP access control list with your platform’s published IP addresses:
Copy the ipacl_uuid from the response.

Step 2: Create an Outbound Trunk in Plivo

Create an outbound trunk using the credential or IP ACL from Step 1. Pass credential_uuid, ipacl_uuid, or both. Set secure to true if your platform supports TLS and SRTP (recommended):
Copy the trunk_id from the response, then retrieve the trunk to get your Termination SIP Domain from the trunk_domain field (e.g., 21784177241578.zt.plivo.com):

Step 3: Configure Your Platform

In your platform’s outbound trunk settings, enter:
Caller ID must be a Plivo number. Outbound calls that present a non-Plivo number fail with hangup code 4190 (unknown_caller_id). See Hangup codes.
If your platform sends SIP OPTIONS pings for health checks, point them at the outbound trunk URI only, at most one ping every 10 to 15 seconds. Higher frequency may trigger blocking. See Technical Specifications.

Troubleshooting

Debug logs: for inbound issues, check Plivo logs first; for outbound issues, check your platform’s logs first. For error codes, see Hangup codes.