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

# Twilio Integration

> A step by step guide to connect your Twilio phone numbers via Elastic SIP Trunking

This guide walks you through connecting your Twilio phone numbers using Elastic SIP Trunking. You'll create a SIP trunk in Twilio, assign your numbers to it, and import them into the platform.

<Tip>
  **One-time setup:** You only need to create the Elastic SIP Trunk once (Step 1). For each additional phone number after that, you simply add it to your existing trunk (Step 2) and import it (Step 3).
</Tip>

## Step 1: Create Elastic SIP Trunking

1. Log in to your [Twilio Console](https://console.twilio.com)

2. In the **search bar** at the top of the dashboard, type **"Elastic SIP Trunking"** and click the result

   Alternatively, click the **"..."** menu on the left sidebar for **All Products & Services**, then scroll down and click **Elastic SIP Trunking**

3. Click **Create new SIP Trunk** and give it a **Friendly name** (e.g., `autocalls`)

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-create-elastic-sip1.jpeg?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=f2c364d01e577f2a2bdde3806c68600f" alt="Create Elastic SIP Trunking" width="837" height="863" data-path="resources/twillio-create-elastic-sip1.jpeg" />
   </Frame>

### Configure Termination (for outbound calls)

4. In the left sidebar, click **Termination**
5. In the **Termination SIP URI** field, enter only a unique name — for example, `yourcompany`

   Twilio automatically appends `.pstn.twilio.com`, so your full URI will be: `yourcompany.pstn.twilio.com`

   <Frame>
     <img src="https://mintcdn.com/autocalls/NTucEGcRBAQ_UqK1/resources/twillio-setup-termination1.jpeg?fit=max&auto=format&n=NTucEGcRBAQ_UqK1&q=85&s=c423bfddcffd046a25bcd47d0354a03c" alt="Setup Termination" width="859" height="868" data-path="resources/twillio-setup-termination1.jpeg" />
   </Frame>

<Warning>
  **Only enter the name part** (e.g., `yourcompany`). The `.pstn.twilio.com` suffix is pre-filled by Twilio. Do not paste a full URI or a localized URI (like `london-ix`) into the input field — this will create a malformed address that won't work. The general URI automatically routes traffic to the nearest region.
</Warning>

<Note>
  **Save this URI** — you will need the full Termination SIP URI (`yourcompany.pstn.twilio.com`) later when importing the number in Step 3.
</Note>

6. For your SIP trunk to accept outbound requests, you need to set up authentication. Scroll down to **Authentication** and configure IP Access Control Lists:

   Currently the SIP server does not have a static IP, so you need to whitelist all the IP addresses in the range:

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-new-access-control.jpeg?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=f7440cd0d5b644ab66079eacb837a474" alt="Twilio New Access Control" width="606" height="452" data-path="resources/twillio-new-access-control.jpeg" />
   </Frame>

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-new-access-control2.jpeg?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=d13e87661e24ea940d414dfe549bec9a" alt="Twilio New Access Control" width="605" height="440" data-path="resources/twillio-new-access-control2.jpeg" />
   </Frame>

### Configure Origination (for inbound calls)

7. In the left sidebar, click **Origination**
8. Click **Add new Origination URI** and enter the SIP server address:

   ```
   sip:5wed79aeavr.sip.livekit.cloud
   ```

   <Frame>
     <img src="https://mintcdn.com/autocalls/NTucEGcRBAQ_UqK1/resources/twillio-setup-origination1.jpeg?fit=max&auto=format&n=NTucEGcRBAQ_UqK1&q=85&s=bc97b5e47f0dc4ee92705689ed321541" alt="Setup Origination" width="1158" height="447" data-path="resources/twillio-setup-origination1.jpeg" />
   </Frame>

## Step 2: Assign Numbers to Your SIP Trunk

Now assign your Twilio phone numbers to the trunk you just created.

1. In your SIP trunk, click **Numbers** in the left sidebar
2. Click **Add a Number** and select the phone number(s) you want to use

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-move-numbers1.jpeg?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=420e869d75c3550e0680f86f4b1eb158" alt="Move numbers to Elastic SIP Trunking" width="2010" height="474" data-path="resources/twillio-move-numbers1.jpeg" />
   </Frame>

<Tip>
  For future numbers, you only need to repeat this step and Step 3 below. The trunk configuration from Step 1 is already done.
</Tip>

## Step 3: Import Numbers to the Platform

Now import the number so the platform knows how to route calls.

1. Go directly to the Phone Numbers page in your dashboard:

   **[https://app.autocalls.ai/phone-numbers](https://app.autocalls.ai/phone-numbers)**

   If it takes you to the login page, log in first — it will automatically redirect you to the Phone Numbers page.

2. Click **"Integrate SIP trunk"** (top-right corner of the page)

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-import-autocalls-sip1.png?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=338b36aec229ba2b26b88299775c20c4" alt="Import numbers via SIP trunk" width="1482" height="684" data-path="resources/twillio-import-autocalls-sip1.png" />
   </Frame>

3. Fill in your phone number and SIP credentials:

   ```
   Phone number: e.g., +1 555 0123
   Username: Your extension username
   Password: Your extension password
   ```

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-autocalls-auth-integration.png?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=dab0a7589fef32f5db41f93ea458e235" alt="Fill in your details based on your integration type" width="1117" height="402" data-path="resources/twillio-autocalls-auth-integration.png" />
   </Frame>

4. Enter the **Termination SIP URI** you created in Step 1:

   ```
   Server address: e.g., yourcompany.pstn.twilio.com
   ```

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-outbound-settings.PNG?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=983b6dedba0d30c44e82b7b830096de1" alt="Twilio Connect Number via SIP" width="1109" height="344" data-path="resources/twillio-outbound-settings.PNG" />
   </Frame>

5. Select the **Authorization type**. If you configured IP-based authentication in Step 1, select IP and add these addresses:

   ```
   54.244.51.0
   54.244.51.1
   54.244.51.2
   54.244.51.3
   54.172.60.0
   54.172.60.1
   54.172.60.2
   54.172.60.3
   ```

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-autocalls-credentials-ip-type1.png?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=271dad2b5a388c9a1d587fa13ebdd666" alt="Credentials IP Type" width="1104" height="466" data-path="resources/twillio-autocalls-credentials-ip-type1.png" />
   </Frame>

6. Select the **country** where your SIP trunk is located.

   <Frame>
     <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-autocalls-sip-country.png?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=e70ef65dcff84f4b72c3ccf5dbd7a264" alt="SIP Country selection" width="1108" height="98" data-path="resources/twillio-autocalls-sip-country.png" />
   </Frame>

## Step 4: Verify Setup

After configuration:

1. Make a test call to your number
2. Check that the AI assistant answers
3. Use the test call feature to verify outbound calling

## Security Requirements

Your SIP credentials need to be secure:

* **Username**: Your extension number or provider-supplied username
* **Password must have**:
  * 12 or more characters
  * Numbers
  * Upper and lowercase letters
  * Special characters recommended

## Common Issues

<AccordionGroup>
  <Accordion title="Do I need to set up Elastic SIP Trunking for every new number?">
    No. You only create the Elastic SIP Trunk once (Step 1). For each new number, simply assign it to your existing trunk (Step 2) and import it into the platform (Step 3).
  </Accordion>

  <Accordion title="After connecting, inbound works but outbound does not work?">
    * **Check your Termination SIP URI** — make sure there are no spaces and it reads correctly (e.g., `yourcompany.pstn.twilio.com`). Verify you only entered the name part in Twilio and didn't accidentally include a localized URI or duplicate the `.pstn.twilio.com` suffix.
    * **Check your username and credentials** — the username is **not** the same as the "Friendly name" in the credential list. Double-check you entered the actual username.

    <Frame>
      <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-outbound-not-work.png?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=7bf58aeb7bdbbdc308ceb0c8b065c4a6" alt="Twilio outbound not work" width="2692" height="1166" data-path="resources/twillio-outbound-not-work.png" />
    </Frame>
  </Accordion>

  <Accordion title="How do I set up dialing to international countries?">
    1. In the Twilio Console search bar, search for **"geo"** to find **Voice Geographic Permissions**.

    <Frame>
      <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-setup-dialing-international.png?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=7f56c5c4f7d9ee3f24feda9b0fe7b559" alt="Twilio setup dialing international" width="2136" height="1428" data-path="resources/twillio-setup-dialing-international.png" />
    </Frame>

    2. Choose **"Elastic SIP Trunking"** in the selector, then select the countries you want to dial.

    <Frame>
      <img src="https://mintcdn.com/autocalls/4HqigDDGk78CcVK_/resources/twillio-choose-elastic-sip-trunking.png?fit=max&auto=format&n=4HqigDDGk78CcVK_&q=85&s=a4fa02f34debab2971a547c73f4b8aeb" alt="Twilio choose Elastic SIP Trunking for international dialing" width="3440" height="1614" data-path="resources/twillio-choose-elastic-sip-trunking.png" />
    </Frame>
  </Accordion>
</AccordionGroup>

***

<Note>
  Need help setting up? Our support team specializes in helping customers
  integrate their phone systems. We'll guide you through the entire process,
  ensuring a smooth setup with your specific phone system configuration.
</Note>
