Set up a SIP trunk
Updated
Configure an Elastic SIP Trunk for inbound and outbound calling in Agent Studio.
Preview documentation
This guide walks you through configuring an Elastic SIP Trunk for both inbound calls (customers call your AI agent) and outbound calls (your AI agent calls customers).
Prerequisites
Before you begin, make sure that you have:
- An active SIP trunk account.
- A phone number that supports SIP trunking.
Understand the setup
Both inbound and outbound calls are supported through Elastic SIP Trunk, but each direction requires different configuration in your SIP trunk and in Agora Console. The following table summarizes the key differences:
| Inbound | Outbound | |
|---|---|---|
| Use case | Customer support hotline, IVR replacement, appointment booking | Outbound campaigns, appointment reminders, follow-up calls |
| Call direction | External caller dials your SIP trunk number → SIP trunk routes to Agora → agent answers | Agora initiates call through SIP trunk → SIP trunk connects to external number → agent speaks |
| SIP trunk config | Origination URI (SIP trunk sends calls to Agora) | Termination URI + IP ACL (Agora sends calls to SIP trunk) |
| Console config | Import number → connect to an Inbound agent | Import number → use as the caller ID of an Outbound agent or campaign |
Basic setup
The following steps are required for both inbound and outbound calling.
Verify your SIP trunk phone number
To confirm your phone number is ready for SIP trunk configuration:
- Sign in to Twilio Console.
- Go to Phone Numbers → Manage → Active Numbers.
- Check that the number you want to use is active and supports SIP trunking.
- If you don't have a number, select Buy a number and choose a number from the list.
Create or select an Elastic SIP Trunk
To set up a trunk that handles inbound and outbound calls:
-
Go to Elastic SIP Trunking → Manage → Trunks in Twilio Console.
-
Select Create a new SIP Trunk (or select an existing one).
-
Give it a descriptive name. For example,
Production Trunk.
Info
You can use the same trunk for both inbound and outbound calling or create separate trunks for easier management. Agora recommends using separate trunks if you have different security requirements for inbound and outbound.
Assign the phone number to the Elastic SIP Trunk
To link your phone number with the SIP trunk:
- Go to Phone Numbers → Manage → Active Numbers.
- Select the phone number.
- Under Voice Calling settings, set the number to use your Elastic SIP Trunk.
- Save your changes.
Check the Secure Trunking setting
To determine which transport protocol to use when you import your number:
-
Open SIP Trunk → General Settings.
-
Locate Secure Trunking.
-
Check whether it's enabled or disabled:
- Enabled: Choose TLS for SIP protocol.
- Disabled: Choose TCP or UDP for SIP protocol.
-
Save any changes.
The SIP protocol setting you choose when you import your number must match your SIP trunk's Secure Trunking setting. A mismatch causes calls to fail silently.
Outbound calling setup
Complete the following steps to enable your agent to make outbound calls through your SIP trunk phone number.
Configure the Termination URI
To set up the domain that Agora uses to reach your SIP trunk:
-
In your SIP trunk, go to Termination.
-
Set a custom Termination SIP URI. For example:
yourcompany.pstn.twilio.com. -
This domain is required later as the SIP host when you import the number.
Create an IP Access Control List
Without Agora's IP addresses in an allowlist, your SIP trunk blocks Agora traffic. To allow Agora's traffic through Twilio, create an Access Control List (ACL) containing the Agora SIP outgoing IPs for your phone number's country code:
To create the ACL:
-
Go to Elastic SIP Trunking → Manage → IP Access Control Lists.
-
Select + Create new Access Control List.
-
Give your ACL a descriptive name.
-
Add the Agora SIP outgoing IPs for your country code, listed in Create an IP Access Control List.
-
Save the Access Control List.
Add IP Access Control List
-
In your SIP trunk, go to Termination → Authentication.
-
Under IP Access Control Lists, select the authentication list you just created. If you don't see the list you created, access it by selecting View all Authentication lists.
-
Select Save.
Credential lists (optional)
You can create username and password authentication if required.
- If you don't specify a credential list, you can leave the Username and Password fields blank when you import the number.
- If you configure a credential list, you must specify the same username and password in the Username and Password fields when you import the number.
To set up a credential list:
- Under Authentication, find Credential Lists.
- Use the
+button to create a new list. - Give your list a descriptive name.
- Specify a username and password.
- Select Save.
Import the outbound number
After you configure your SIP trunk, import the number. See Import a phone number for step-by-step instructions. Use your Termination URI as the SIP host, and match the SIP protocol to your Secure Trunking setting.
Inbound calling setup
Complete the following steps to enable customers to call your agent through your SIP trunk phone number.
Configure Origination URI
-
In your SIP trunk, go to Origination.
-
Select Add new Origination URI.
-
Enter the Agora SIP Origination URI for your region:
The Origination URI depends on the country code of your phone number. Select the URI for your region and enter it in your SIP trunk.
-
United States
Transport URI TLS sip:sbc-us-west-1.viblinx.com:5061TCP/UDP sip:sbc-us-west-1.viblinx.com:5060Supported country codes: +1 (United States)
-
Americas, Europe, Oceania, and Brazil
Transport URI TLS sip:sbc-sa-east-1.viblinx.com:5061TCP/UDP sip:sbc-sa-east-1.viblinx.com:5060Supported country codes: +52 (Mexico), +54 (Argentina), +55 (Brazil), +56 (Chile), +51 (Peru), +44 (United Kingdom), +33 (France), +49 (Germany), +39 (Italy), +34 (Spain), +61 (Australia), +64 (New Zealand)
-
Asia-Pacific, India, and Africa
Transport URI TLS sip:sbc-ap-south.viblinx.com:5061TCP/UDP sip:sbc-ap-south.viblinx.com:5060Supported country codes: +82 (South Korea), +65 (Singapore), +81 (Japan), +91 (India), +886 (Taiwan), +27 (South Africa), +20 (Egypt), +254 (Kenya)
-
-
Set Priority to
10and Weight to10(default). -
Select Add.
Configure number routing
- Go to Phone Numbers → Manage → Active Numbers.
- Select the number you want to use for inbound calling.
- Under Voice Configuration → Configure with, select SIP Trunk.
- Choose the trunk you created in Basic setup.
- Select Save configuration.
Import the inbound number
After you configure SIP trunk origination and routing, import the number and connect it to an agent to answer inbound calls. See Deploy an inbound agent for step-by-step instructions.
Configuration checklist
Before testing inbound and outbound calls, make sure that you address each item in the checklist:
| Item | Inbound | Outbound |
|---|---|---|
| Assign phone number to SIP trunk | Required | Required |
| SIP host | Required | Required |
| Configure Origination URI (SIP trunk → Agora) | Required | Not needed |
| IP Access Control List | Not needed | Required |
| Credential List | Not needed | Optional |
| Secure Trunking setting matches SIP protocol | Required | Required |
| Import number | Required | Required |
| Connect number | Connect to an Inbound agent | Use as a caller ID |
Troubleshooting
If you encounter issues with your SIP trunk setup, use the following table to identify and resolve common problems.
| Symptom | Cause | Solution |
|---|---|---|
| Inbound calls don't reach the agent | Origination URI not set or incorrect | Verify the Origination URI in your SIP trunk |
| Outbound calls rejected by SIP trunk | IP ACL missing or incomplete | Add all Agora SIP IPs to the SIP trunk IP Access Control List |
| Calls connect but no audio | Transport mismatch (TLS vs TCP/UDP) | Match the Secure Trunking setting in your SIP trunk with the SIP protocol setting |
| One-way audio | Firewall or NAT issue | Make sure that both sides allow the Agora SIP IPs |
| "403 Forbidden" in SIP trunk logs | Authentication failed | Check Credential List or IP ACL configuration |
| Call drops after about 30 seconds | SIP session timer timeout | Check SIP trunk timeout settings |
Next steps
- Import a phone number: Import your configured SIP trunk number.
- Set up a campaign: Use your imported number to create an outbound calling campaign.
- Deploy an inbound agent: Connect a number to an agent to answer inbound calls.
- Deploy an outbound agent: Use your imported number as the agent's caller ID.
