Prerequisites
| Requirement | Description |
|---|---|
| Plivo Account | Sign up with SIP trunking enabled |
| Phone Number | Purchase a voice-enabled number |
| Retell Account | Create account with at least one agent configured |
- Your Plivo Auth ID and Auth Token, available on the Plivo Console home page. The Plivo API uses HTTP Basic authentication.
- Your Retell API key, available on the API Keys page of the Retell dashboard. The Retell API uses Bearer authentication.
Indian phone numbers: TRAI regulations require voice AI platforms to terminate SIP traffic on servers located in India. Confirm with Retell support that your deployment meets this requirement before using Indian phone numbers.
How the integration works
| Direction | Call path | What you configure |
|---|---|---|
| Inbound | Caller → Plivo number → Plivo inbound trunk → sip.retellai.com → Retell agent | Inbound trunk in Plivo pointing to Retell’s SIP server |
| Outbound | Retell agent → Plivo outbound trunk → PSTN → Callee | Outbound trunk in Plivo; its termination domain and credentials go into Retell’s number import |
Set up both trunks for a fully working number. The outbound trunk is always required — Retell won’t import a number without its termination URI, even for inbound-only use. The inbound trunk routes calls to your agent; skip the inbound trunk and phone number steps only if your agent exclusively makes outbound calls.
Set up the integration
Create an outbound trunk in Plivo
Set up an outbound trunk with username and password authentication in Plivo. Retell uses the trunk’s Termination SIP Domain and these credentials to place outbound calls.
- Console
- API
- Sign in to the Plivo Console.
- Navigate to SIP Trunking → Outbound Trunks.
- Select Create Trunk and provide a descriptive name for your trunk.
- In the Trunk Authentication section → Credential, select Create new credential.
- Add a credential name, and a username and strong password for outbound call authentication, then select Create credential.
- Username: 5 to 20 characters, alphanumeric only.
- Password: 5 to 20 characters, using only alphanumeric characters and the special characters
~!@#$%^&*()_+, with at least one special character. - Use the same username and password when you import your number into Retell.
- For Authentication, select the credential you created in the previous step.
- Optional: enable Secure Trunking to encrypt SIP signaling over TLS.
- Select Create Trunk to complete your outbound trunk configuration.
21784177241578.zt.plivo.com). You need it when you import your number into Retell.Create an inbound trunk in Plivo
Create an inbound trunk that routes calls from your Plivo phone number to Retell’s SIP server.
- Console
- API
- Navigate to SIP Trunking → Inbound Trunks.
- Select Create Trunk and provide a descriptive name for your trunk.
- For Primary URI, select Add New URI and enter Retell’s SIP server:
sip.retellai.com;transport=tcp. - For Link Numbers, select your phone number from the dropdown menu. Or connect your phone number in the next step.
- Select Create Trunk.
Connect your phone number
Connect your Plivo phone number to the inbound trunk. You can skip this step if you connected your phone number when you created the inbound trunk.
- Console
- API
- Navigate to Phone Numbers → Purchased Numbers.
- Select the phone number to connect to the trunk.
- For Application Type, select SIP Trunk.
- For Trunk, select the inbound trunk you created in the previous step.
- Select Save changes.
Import your number into Retell
Import your Plivo phone number into Retell using the Termination SIP Domain and the credential username and password from the outbound trunk you created earlier.
- Dashboard
- API
- Sign in to the Retell dashboard.
- Navigate to Phone Numbers, select the option to add a number, and choose Connect to your number via SIP trunking.
- Configure the import with the following values:
| Field | Value |
|---|---|
| Phone Number | Your Plivo number in E.164 format. For example, +15105550100. |
| Termination URI | Your Plivo Termination SIP Domain. For example, 21784177241578.zt.plivo.com. Don’t enter Retell’s SIP server URI here. |
| SIP Trunk User Name | The credential username from your Plivo outbound trunk. |
| SIP Trunk Password | The credential password from your Plivo outbound trunk. |
| Nickname (optional) | A descriptive label. For example, Plivo support line. |
| Outbound Transport | Keep the default, TCP. Select TLS if Secure Trunking is enabled on your Plivo outbound trunk. |
- Select Save.
- After the number is imported, bind an inbound agent and an outbound agent to it. A number can only receive or make calls after an agent is bound in that direction.
Changing trunk configuration: Retell doesn’t support editing an imported number’s SIP trunk settings. To change the termination URI or credentials, delete the number in Retell and import it again.
Test your integration
Inbound: Call your Plivo phone number. The Retell agent bound to the number should answer the call.Outbound: Place a call from the Retell dashboard, or use Retell’s Create Phone Call API. Set
from_number to your imported Plivo number:Troubleshooting
Trunk configuration errors typically surface only when a call is placed, so test both directions after setup. If a call fails to connect, check the following common issues:| Issue | Solution |
|---|---|
| Inbound call doesn’t connect | Verify the inbound trunk’s primary URI is sip.retellai.com;transport=tcp and your phone number is connected to the inbound trunk. Confirm an inbound agent is bound to the number in Retell. |
| Outbound call fails | Verify the termination URI in Retell matches your Plivo Termination SIP Domain exactly, with no spaces or sip: prefix. Confirm the credential username and password match. |
| Authentication errors | Verify credentials match exactly in both Plivo and Retell. Use the credential username, not the credential name. |
| Calls drop or have no audio | If Secure Trunking is enabled on your Plivo outbound trunk, set Outbound Transport to TLS in Retell. |
- Inbound issues: First check the Plivo logs, then check call history in the Retell dashboard.
- Outbound issues: First check call history in the Retell dashboard, then check the Plivo logs.
Related
SIP Trunking API overview
Plivo SIP Trunking API reference.
SIP Trunking for voice agents
Concepts and architecture for building voice agents with Plivo SIP trunking.
Retell custom telephony guide
Retell’s guide to connecting custom telephony providers.
Retell API reference
Retell’s Import Phone Number API documentation.