Overview
This guide walks you through configuring a Twilio SIP trunk to work with SubVerse AI for both inbound and outbound calls.Prerequisites
- Active Twilio account
- Purchase a Twilio phone number
- Install the Twilio CLI (optional, for CLI method)
- Create a Twilio profile (optional, for CLI method)
Step 1: Get Your SubVerse SIP URI
Before configuring Twilio, you need to obtain your SIP URI from SubVerse:- Log in to your SubVerse dashboard
- Navigate to Integrations → Telephony
- Copy your SIP URI (it will look like:
sip:xxxxx.sip.livekit.cloud)
Keep this SIP URI handy - you’ll need it in the next steps.
Step 2: Create a SIP Trunk
Using Twilio Console (Recommended)
- Sign in to the Twilio Console
- Navigate to Elastic SIP Trunking → Trunks
- Click Create new SIP Trunk
- Enter a Friendly Name (e.g., “SubVerse AI Trunk”)
- Click Create
Using Twilio CLI
The domain name for your SIP trunk must end inpstn.twilio.com:
Step 3: Configure for Inbound Calls
Configure the trunk to route incoming calls to SubVerse.Using Twilio Console
- In your SIP trunk settings, go to Origination
- Click Add new Origination URI
- Enter the following details:
- Origination SIP URI: Your SubVerse SIP URI (from Step 1)
- Priority: 1
- Weight: 1
- Enabled: Check this box
- Friendly Name: “SubVerse SIP URI”
- Click Add
- Click Save
Using Twilio CLI
Replace<your_sip_uri> with your SubVerse SIP URI and <twilio_trunk_sid> with your trunk SID:
Step 4: Configure for Outbound Calls
Configure authentication for outbound calls from SubVerse through Twilio.Create Credential List
- In Twilio Console, navigate to Voice → Manage → Credential Lists
- Click Create new Credential List
- Enter a name (e.g., “SubVerse Credentials”)
- Click Create
- Click Add Credential
- Enter:
- Username: Your chosen username
- Password: Your chosen password
- Click Save
Associate Credential List with Trunk
- Go back to your SIP trunk settings
- Navigate to Termination → Authentication
- Under Credential Lists, select the credential list you just created
- Click Save
Configure Termination URI
- In your SIP trunk, go to Termination
- Click Add new Termination URI
- Enter:
- Termination SIP URI: This will be provided by Twilio (usually your trunk domain)
- Priority: 1
- Weight: 1
- Enabled: Check this box
- Click Save
Step 5: Associate Phone Number with Trunk
Using Twilio Console
- In your SIP trunk settings, go to Numbers
- Click Add an Existing Number or Buy a Number
- Select your phone number
- Click Add
Using Twilio CLI
Step 6: Configure in SubVerse Dashboard
Now that Twilio is configured, add the trunk to SubVerse:For Outbound Calls
- Go to SubVerse Integrations → Telephony
- Click Add Outbound Trunk
- Enter:
- Name: Descriptive name (e.g., “Twilio Outbound”)
- Phone Number: Your Twilio number with country code (e.g., +1xxxxxxxxxx)
- SIP Address: Your Twilio termination URI (e.g.,
subverse-trunk.pstn.twilio.com) - Auth Username: Username from Step 4
- Auth Password: Password from Step 4
- Click Save
For Inbound Calls
- Go to SubVerse Integrations → Telephony
- Click Add Inbound Trunk
- Enter:
- Name: Descriptive name (e.g., “Twilio Inbound”)
- Phone Number: Your Twilio number with country code (e.g., +1xxxxxxxxxx)
- Auth Username: Username from Step 4 (if configured)
- Auth Password: Password from Step 4 (if configured)
- Click Map Voicebot Usecase and select your voice agent
- Click Save
Testing Your Configuration
Test Inbound Calls
- Call your Twilio phone number
- The call should be routed to your SubVerse voice agent
- Check the call appears in SubVerse Call History
Test Outbound Calls
- Create a workflow or use the voice agent interface
- Make a test call using your configured Twilio number
- Verify the call connects successfully
- Check the call appears in SubVerse Call History
Troubleshooting
Inbound Calls Not Working
Check:- Origination URI is correctly configured in Twilio
- SIP URI matches exactly what’s shown in SubVerse dashboard
- Phone number is associated with the trunk
- Voice agent is mapped to the inbound trunk in SubVerse
- Verify SIP URI in Twilio matches SubVerse
- Check Twilio debugger logs for errors
- Ensure phone number is active and not in use elsewhere
Outbound Calls Not Working
Check:- Credential list is associated with the trunk
- Username and password match in both Twilio and SubVerse
- Termination URI is correctly configured
- SIP address in SubVerse matches Twilio trunk domain
- Verify credentials are correct
- Check Twilio trunk status is active
- Review Twilio debugger for authentication errors
- Ensure sufficient Twilio account balance
Call Quality Issues
Check:- Network connectivity
- Twilio service status
- Region-specific routing configuration
- Use region-based SIP endpoints for better latency
- Check Twilio status page
- Contact SubVerse support for assistance