> ## Documentation Index
> Fetch the complete documentation index at: https://docs.callrounded.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio Configuration

> Step-by-step guide to configure a SIP trunk with Twilio

## Prerequisites

* An active Twilio account
* A Twilio phone number
* Access to the Twilio console

## Step 1: Create a SIP Trunk in Twilio

1. Log in to the [Twilio Console](https://console.twilio.com)
2. Search for **SIP Trunk** in the search bar
3. Click **Create new SIP Trunk**
4. Give your trunk a name (e.g., "Rounded-Trunk")

## Step 2: Configure Origination

Origination defines how Twilio handles outbound calls from Rounded.

1. In your SIP Trunk, go to the **Origination** tab
2. Click **Add new Origination URI**

<img src="https://mintcdn.com/roundedtechnologies/8FEZlBmlsYXYiPXc/images/twilio-origination-page.png?fit=max&auto=format&n=8FEZlBmlsYXYiPXc&q=85&s=ef44f24218da930d83c682ecfe094d4e" alt="Twilio Origination Page" width="2070" height="632" data-path="images/twilio-origination-page.png" />

3. Configure:
   * **SIP URI**: `sip:sip.callrounded.com;transport=tcp`
   * **Priority**: 10
   * **Weight**: 10

## Step 3: Configure Termination

Termination defines how Rounded can send calls via Twilio.

1. Go to the **Termination** tab
2. Note the displayed **Termination URI** (e.g., `your-trunk.pstn.twilio.com`)

<img src="https://mintcdn.com/roundedtechnologies/8FEZlBmlsYXYiPXc/images/twilio-termination-page.png?fit=max&auto=format&n=8FEZlBmlsYXYiPXc&q=85&s=7a39f12dae0490dc55e82ea61a1709e0" alt="Twilio Termination Page" width="2938" height="1852" data-path="images/twilio-termination-page.png" />

3. Configure authentication (choose one method):

### Method A: IP Access Control List (Recommended)

1. Click **+** next to **IP Access Control Lists**
2. Create a new Access Control List:

<img src="https://mintcdn.com/roundedtechnologies/8FEZlBmlsYXYiPXc/images/twilio-new-acl.png?fit=max&auto=format&n=8FEZlBmlsYXYiPXc&q=85&s=8ded10a5d883c04fea1894e8c81f1f88" alt="Twilio New Access Control List" width="808" height="546" data-path="images/twilio-new-acl.png" />

* **Friendly Name**: "Rounded ACL"
* **CIDR Network Address**: Contact [team@callrounded.com](mailto:team@callrounded.com) for Rounded IPs

### Method B: Credential Lists

1. Click **+** next to **Credential Lists**
2. Create new credentials:

<img src="https://mintcdn.com/roundedtechnologies/8FEZlBmlsYXYiPXc/images/twilio-new-credentials.png?fit=max&auto=format&n=8FEZlBmlsYXYiPXc&q=85&s=7fe242c59369071b40358f7cfdcc903d" alt="Twilio New Credential List" width="806" height="536" data-path="images/twilio-new-credentials.png" />

* **Friendly Name**: "Rounded Credentials"
* **Username**: Choose a username
* **Password**: Generate a secure password

## Step 4: Associate your numbers

1. Go to **Numbers** tab in your SIP Trunk

<img src="https://mintcdn.com/roundedtechnologies/8FEZlBmlsYXYiPXc/images/twilio-numbers-page.png?fit=max&auto=format&n=8FEZlBmlsYXYiPXc&q=85&s=8547ccdba57685cd500a1ecb6727725f" alt="Twilio Numbers Page" width="1471" height="322" data-path="images/twilio-numbers-page.png" />

2. If you don't have numbers yet, click **Add a number** > **Buy a Number**
3. Or go to **Phone Numbers > Manage > Active numbers**
4. Select the number you want to connect
5. In the number configuration:
   * **A call comes in**: Select "SIP Trunk"
   * Choose your previously created trunk

## Step 5: General Settings (Optional)

Configure additional trunk settings in the **General** tab:

<img src="https://mintcdn.com/roundedtechnologies/8FEZlBmlsYXYiPXc/images/twilio-general-settings.png?fit=max&auto=format&n=8FEZlBmlsYXYiPXc&q=85&s=ec5e0b6ce6c3ddf01706f7ae155200d3" alt="Twilio General Settings" width="2938" height="1842" data-path="images/twilio-general-settings.png" />

Key settings to review:

* **Friendly name**: Descriptive name for your trunk
* **Call Recording**: Enable if needed
* **Secure Trunking**: Enable for TLS/SRTP
* **Call Transfer (SIP REFER)**: Enable for call transfers

## Step 6: Configuration in Rounded

In the Rounded interface, configure your SIP trunk:

<img src="https://mintcdn.com/roundedtechnologies/8FEZlBmlsYXYiPXc/images/rounded-sip-trunk-configuration.png?fit=max&auto=format&n=8FEZlBmlsYXYiPXc&q=85&s=484967b9c9594b6d04d268f38cec98ba" alt="Rounded SIP Trunk Configuration" width="2936" height="1844" data-path="images/rounded-sip-trunk-configuration.png" />

### Number settings

* **Phone number**: Your Twilio number (e.g., +15551234567)
* **Friendly name**: "My Twilio number"

### SIP Trunk settings

* **Termination URI**: `your-trunk.pstn.twilio.com` (from step 3)
* **Username**: Leave empty (optional)
* **Password**: Leave empty (optional)

## Step 7: Test the configuration

1. In Rounded, create a simple voice agent
2. Assign it to your Twilio number
3. Test:
   * **Inbound call**: Call your Twilio number
   * **Outbound call**: Initiate a call from your agent

## Troubleshooting

### "403 Forbidden" error

* Check that the origination URI is correctly configured
* Make sure the trunk is active

### Inbound calls don't work

* Verify that the number is properly associated with the SIP trunk
* Check the webhook configuration in Twilio

### Degraded audio quality

* Check your internet connection
* Test with UDP protocol if TCP is problematic

## Pricing

Twilio charges:

* Inbound calls according to your plan
* Outbound calls at Twilio international rates
* Monthly fees for the SIP trunk (consult Twilio pricing)

## Support

For help:

* 📧 Rounded Support: [team@callrounded.com](mailto:team@callrounded.com)
* 📖 Twilio Documentation: [Twilio SIP Trunking](https://www.twilio.com/docs/sip-trunking)
* 🎫 Twilio Support: Twilio Console > Help & Support

<Warning>
  ⚠️ **Important**: Always test your configuration with non-critical calls before going into production.
</Warning>
