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

# Twilio SIP Trunking Setup

> Step-by-step guide to connect your Twilio account via SIP trunking. Connect your existing Twilio phone numbers to Sell Agent using Elastic SIP Trunking for seamless call handling.

## Steps

<Steps>
  <Step title="Create Elastic SIP Trunk">
    1. Create the trunk, give it a name, and toggle some general settings

       * Name it (e.g., "sell agent trunk")

           <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/twilio-create-trunk.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=267521c115a73debf3edc1a44eb7dfe8" alt="Create SIP Trunk" width="810" height="617" data-path="images/twilio-create-trunk.png" />

    2. **Configure Termination (this is for outbound)**

       * the termination SIP URI here is important, we would use it in later steps. You might want to use a localized termination uri that’s near your region. You can expand and view your localized uris in the twilio console.:

           <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/twilio-termination.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=7ad4a4ed22d9b25006bd10a6297d3e38" alt="Termination Settings" width="1196" height="602" data-path="images/twilio-termination.png" />

    * For your elastic SIP trunk to accept our outbound request, you need to whitelist IP address or create a auth with username and password.
      * If you opt for the auth route, you need to specify the username and password in the next step when importing the number to **Sell Agent**.
            <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/auth.jpeg?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=dca3aeda7b8d64d21a4bf4ac61726c8e" alt="auth" width="603" height="406" data-path="images/auth.jpeg" />
      * Currently **Sell Agent** SIP server does not have a static IP, so if you opt for the IP route, you need to whitelist all the IP addresses in the range like following:
            <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/ACL-2.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=89537b60dfda6589e1732070e1424b99" alt="ACl 1" width="606" height="452" data-path="images/ACL-2.png" />
            <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/ACL-1.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=e7c47cdb94288f2ad7378efa2b3735aa" alt="ACl 2" width="605" height="440" data-path="images/ACL-1.png" />

    3. **Configure Origination (this is for Inbound)**
       * Here you will specify **Sell Agent's** SIP server address as the origination SIP URI:
         ```
         sip:2s79j8s14f9.sip.livekit.cloud
         ```

    <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/twilio-origination.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=4434a743586936b112f445248ea78463" alt="Origination Settings" width="1198" height="538" data-path="images/twilio-origination.png" />

    <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/twilio-origination-1.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=065d41da26546204af41f3a79de4dcef" alt="Origination" width="931" height="602" data-path="images/twilio-origination-1.png" />
  </Step>

  <Step title="Move numbers to Elastic SIP Trunking">
    You’ve created the elastic SIP trunk, now you would need to purchase numbers / move existing numbers to this trunk.

    <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/twilio-assign-numbers.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=37827387280287e403ee80ce60af9843" alt="Number Assignment" width="1305" height="519" data-path="images/twilio-assign-numbers.png" />
  </Step>

  <Step title="Import to Sell Agent">
    Now the number is set up with your elastic SIP trunking, you need to import the number to **Sell Agent** so that we will know how to route the call.

    <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/sellagent-import.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=ac6a28c2151ccd6edca2936bd5ea222b" alt="Sell Agent Import" width="354" height="119" data-path="images/sellagent-import.png" />

    Here you will supply the termination SIP URI you set up in Step 1. If you have set up auth via credentials, you will need to supply the username and password as well.

    <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/sellagent-uri.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=5ddb7b2323deb057de0ff2f11cf9a301" alt="SellAgent URI" width="808" height="568" data-path="images/sellagent-uri.png" />

    You can also import a number programmatically using the\
    ****[Create Phone Number API](/api-reference/phone/create)****.

    Now the number is imported, you can make and receive calls with this number — it will show up in your dashboard, and you can make phone calls from Dashboard directly. You can also use the  ****[Create Phone Call API](/api-reference/call/create-call)****. to create calls programmatically. If you wish to **Sell Agent** to stop using this number, you can delete it from the dashboard or via the  ****[Delete Phone Number API](/api-reference/phone/delete)****.
  </Step>
</Steps>

## Common Issues

**1. Inbound calls work, but outbound calls do not?**

* Check your Termination SIP URI ensure there are no spaces in your Termination SIP URI.  Also, make sure you’re using a localized URI appropriate for your region.\
  👉 Refer to [Twilio’s SIP Region Guide](https://www.twilio.com/docs/sip-trunking#termination-uri) to select the correct one.

* Make sure you're using the correct username and password from the SIP Credential List.\
  ⚠️ *Important:* The **username is not the friendly name** shown in the Twilio Console. Double-check you’re using the actual SIP credential username.

  <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/twilio-acl.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=395f3833df84958728a72ebceaadedbb" alt="Twilio ACL" width="2692" height="1166" data-path="images/twilio-acl.png" />

**2. How do I enable international calling?**

* In the Twilio Console, search for **"Geo"** to locate the **Voice Geographic Permissions** settings.

  <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/geo-permissions.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=16770d029c35278b04afdade9726b99a" alt="Geo Permissions" width="2136" height="1428" data-path="images/geo-permissions.png" />

* Under the Product Selector, choose **Elastic SIP Trunking** and then enable the countries you want to allow for outbound dialing.

  <img src="https://mintcdn.com/sellagent-f6a60d80/xwxOjUZ1cjk-9QCV/images/twilio-geo.png?fit=max&auto=format&n=xwxOjUZ1cjk-9QCV&q=85&s=6e9a618899a5da8dbb2b33a30bcf9ad8" alt="Twilio Geopermissions" width="3440" height="1614" data-path="images/twilio-geo.png" />

## 📘 Next Steps

<CardGroup cols={1}>
  <Card title="Create Twilio Trunk Video Tutorial" icon="phone" color="#6A5ACD" href="/pages/twilio-trunk-tutorial">
    Step-by-step video guide to set up a Twilio SIP trunk and connect it to **Sell Agent**.
  </Card>
</CardGroup>
