Skip to main content

Overview

This guide walks you through configuring a Twilio SIP trunk to work with SubVerse AI for both inbound and outbound calls.

Prerequisites

Step 1: Get Your SubVerse SIP URI

Before configuring Twilio, you need to obtain your SIP URI from SubVerse:
  1. Log in to your SubVerse dashboard
  2. Navigate to IntegrationsTelephony
  3. 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

  1. Sign in to the Twilio Console
  2. Navigate to Elastic SIP TrunkingTrunks
  3. Click Create new SIP Trunk
  4. Enter a Friendly Name (e.g., “SubVerse AI Trunk”)
  5. Click Create

Using Twilio CLI

The domain name for your SIP trunk must end in pstn.twilio.com:
twilio api:trunking:v1:trunks:create \
  --friendly-name "SubVerse AI Trunk" \
  --domain-name "subverse-trunk.pstn.twilio.com"
Copy the trunk SID from the output for use in the following steps.

Step 3: Configure for Inbound Calls

Configure the trunk to route incoming calls to SubVerse.

Using Twilio Console

  1. In your SIP trunk settings, go to Origination
  2. Click Add new Origination URI
  3. 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”
  4. Click Add
  5. Click Save

Using Twilio CLI

Replace <your_sip_uri> with your SubVerse SIP URI and <twilio_trunk_sid> with your trunk SID:
twilio api:trunking:v1:trunks:origination-urls:create \
  --trunk-sid <twilio_trunk_sid> \
  --friendly-name "SubVerse SIP URI" \
  --sip-url "<your_sip_uri>" \
  --weight 1 \
  --priority 1 \
  --enabled
For region-specific routing, use region-based SIP endpoints provided in your SubVerse Telephony dashboard.

Step 4: Configure for Outbound Calls

Configure authentication for outbound calls from SubVerse through Twilio.

Create Credential List

  1. In Twilio Console, navigate to VoiceManageCredential Lists
  2. Click Create new Credential List
  3. Enter a name (e.g., “SubVerse Credentials”)
  4. Click Create
  5. Click Add Credential
  6. Enter:
    • Username: Your chosen username
    • Password: Your chosen password
  7. Click Save
Save these credentials securely - you’ll need to enter them in SubVerse dashboard.

Associate Credential List with Trunk

  1. Go back to your SIP trunk settings
  2. Navigate to TerminationAuthentication
  3. Under Credential Lists, select the credential list you just created
  4. Click Save

Configure Termination URI

  1. In your SIP trunk, go to Termination
  2. Click Add new Termination URI
  3. Enter:
    • Termination SIP URI: This will be provided by Twilio (usually your trunk domain)
    • Priority: 1
    • Weight: 1
    • Enabled: Check this box
  4. Click Save

Step 5: Associate Phone Number with Trunk

Using Twilio Console

  1. In your SIP trunk settings, go to Numbers
  2. Click Add an Existing Number or Buy a Number
  3. Select your phone number
  4. Click Add

Using Twilio CLI

twilio api:trunking:v1:trunks:phone-numbers:create \
  --trunk-sid <twilio_trunk_sid> \
  --phone-number-sid <twilio_phone_number_sid>
To list your phone numbers and trunks:
# List phone numbers
twilio phone-numbers:list

# List trunks
twilio api:trunking:v1:trunks:list

Step 6: Configure in SubVerse Dashboard

Now that Twilio is configured, add the trunk to SubVerse:

For Outbound Calls

  1. Go to SubVerse IntegrationsTelephony
  2. Click Add Outbound Trunk
  3. 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
  4. Click Save

For Inbound Calls

  1. Go to SubVerse IntegrationsTelephony
  2. Click Add Inbound Trunk
  3. 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)
  4. Click Map Voicebot Usecase and select your voice agent
  5. Click Save

Testing Your Configuration

Test Inbound Calls

  1. Call your Twilio phone number
  2. The call should be routed to your SubVerse voice agent
  3. Check the call appears in SubVerse Call History

Test Outbound Calls

  1. Create a workflow or use the voice agent interface
  2. Make a test call using your configured Twilio number
  3. Verify the call connects successfully
  4. 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
Solution:
  • 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
Solution:
  • 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
Solution:
  • Use region-based SIP endpoints for better latency
  • Check Twilio status page
  • Contact SubVerse support for assistance

Additional Resources

Next Steps

Remember to update the voice agent mapping in SubVerse whenever you modify your agent’s configuration to ensure calls use the latest settings.