Summary
| Direction | Setup Steps | Use Case |
|---|---|---|
| Outbound (AI → Phone) | 1. Create Credentials or IP ACL → 2. Create Outbound Trunk | Your AI agent calls phone numbers |
| Inbound (Phone → AI) | 1. Create Origination URI → 2. Create Inbound Trunk → 3. Assign phone number | Callers reach your AI agent |
Outbound Calls (AI Agent → Phone)
Route calls from your AI agent platform to phone numbers via PSTN.Step 1: Create Authentication
Choose one authentication method:- Credentials (Username/Password)
- IP Access Control List
Use when your AI platform has dynamic IPs or you need SIP digest authentication.Endpoint:
Response:Save the
POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Friendly name |
username | string | Yes | SIP authentication username |
password | string | Yes | SIP authentication password |
cURL
credential_uuid for trunk creation.Step 2: Create Outbound Trunk
Endpoint:POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Friendly name |
trunk_direction | string | Yes | Must be outbound |
trunk_status | string | No | enabled (default) or disabled |
secure | boolean | No | Enable SRTP/TLS. Default: false |
credential_uuid | string | Conditional | From Step 1 (if using credentials) |
ipacl_uuid | string | Conditional | From Step 1 (if using IP ACL) |
cURL
Step 3: Configure Your AI Platform
Use thetrunk_domain (e.g., 21784177241578.zt.plivo.com) in your AI platform’s SIP configuration. Your platform sends SIP INVITE to this domain to place outbound calls.
Inbound Calls (Phone → AI Agent)
Route incoming phone calls to your AI agent platform.Step 1: Create Origination URI
Define where Plivo sends inbound calls (your AI platform’s SIP endpoint). Endpoint:POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/URI/
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Friendly name |
uri | string | Yes | Your AI platform’s SIP address |
authentication_needed | boolean | No | Require auth. Default: false |
username | string | Conditional | Username (if auth enabled) |
password | string | Conditional | Password (if auth enabled) |
- Without Authentication
- With Authentication
cURL
uri_uuid for trunk creation. Optionally create a second URI for failover.
URI Format Examples
| Format | Example |
|---|---|
| FQDN with port | sip.example.com:5060 |
| FQDN | sip.example.com |
| IP with port | 192.168.1.100:5060 |
| IP address | 192.168.1.100 |
Step 2: Create Inbound Trunk
Endpoint:POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Friendly name |
trunk_direction | string | Yes | Must be inbound |
trunk_status | string | No | enabled (default) or disabled |
secure | boolean | No | Enable SRTP/TLS. Default: false |
primary_uri_uuid | string | Yes | From Step 1 |
fallback_uri_uuid | string | No | Backup URI (optional) |
cURL
Step 3: Assign Phone Number to Trunk
- Go to Phone Numbers in the Plivo Console
- Select your phone number
- Under Voice Configuration, select SIP Trunk
- Choose your inbound trunk from the dropdown
- Save changes
Call Records
To retrieve call detail records (CDRs) and call quality insights for SIP trunk calls, see SIP Trunking API - Calls.Additional API Operations
For retrieving, listing, updating, and deleting resources:| Resource | Full API Reference |
|---|---|
| Trunks | SIP Trunking API - Trunks |
| Credentials | SIP Trunking API - Credentials |
| Origination URIs | SIP Trunking API - Origination URIs |
| IP Access Control Lists | SIP Trunking API - IP ACLs |
Related
- SIP Trunking Overview - Architecture and concepts
- ElevenLabs Integration - Connect ElevenLabs
- LiveKit Integration - Connect LiveKit
- Vapi Integration - Connect Vapi
- Hangup Codes - Troubleshooting