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

# Connect Twilio to Bolna with a SIP trunk

> Bring your Twilio numbers to Bolna over Elastic SIP Trunking: set termination and origination on a Twilio trunk, then create a Twilio SIP trunk in Bolna.

[Twilio](https://www.twilio.com/) connects your numbers to Bolna through an Elastic SIP Trunk. On the Twilio trunk, **Termination** carries the calls Bolna places, and **Origination** carries calls to your numbers into Bolna.

> [!NOTE]
>
> This page connects Twilio over a SIP trunk. To connect your Twilio account to Bolna as a telephony provider instead, see [Using Twilio](https://www.bolna.ai/docs/twilio).

## Before you begin

* **A Twilio account and at least one Twilio phone number.** On a trial account, Twilio only lets you call verified numbers.

## Set up Twilio

**1. Create the trunk and set termination**

In the [Twilio Console](https://console.twilio.com/), open **Elastic SIP Trunking** and create a trunk. On its **Termination** tab, enter a **Termination SIP URI**, for example `acme.pstn.twilio.com`. This is the host Bolna dials.

**2. Let Twilio recognise Bolna**

Under **Authentication** on the **Termination** tab, add at least one of:

* **Credential list:** create one with a username and password, and save both; you enter them in Bolna. Twilio recommends credentials.
* **IP access control list:** create one with Bolna's signalling IPs `15.252.21.46` and `13.206.230.198`.

If you add both, Twilio checks both.

**3. Set origination**

On the **Origination** tab, add an origination URI:

| Field | Value |
| - | - |
| Origination SIP URI | `sip:trunk.bolna.ai:5060` |

Twilio sends calls over UDP. To use TCP, enter `sip:trunk.bolna.ai:5060;transport=tcp`. Do not use `transport=tls`.

**4. Add your numbers to the trunk**

On the trunk's **Numbers** tab, add the Twilio numbers you want on Bolna.

## Create the trunk in Bolna

**1. Pick Twilio**

In the sidebar, under **Deploy**, open **SIP Trunks** and click **Create trunk**. If your account still has legacy SIP trunks, click **Open new SIP trunks** first. On the **Provider** step, pick **Twilio**, enter a **Trunk name** and the number of **Channels**, and enter your Termination SIP URI in **Gateway we dial**. Click **Continue**.

**2. Add Twilio's IPs and credentials**

On the **Carrier IPs** step, add every signalling range Twilio [publishes](https://www.twilio.com/docs/sip-trunking/ip-addresses). Twilio asks you to allow all of them, because a call can arrive from any region:

| Twilio region | Range |
| - | - |
| North America Virginia | `54.172.60.0/30` |
| North America Oregon | `54.244.51.0/30` |
| Europe Ireland | `54.171.127.192/30` |
| Europe Frankfurt | `35.156.191.128/30` |
| Asia Pacific Tokyo | `54.65.63.192/30` |
| Asia Pacific Singapore | `54.169.127.128/30` |
| Asia Pacific Sydney | `54.252.254.64/30` |
| South America São Paulo | `177.71.206.192/30` |

If you created a credential list, enter its **Username** and **Password** under **Carrier credentials (optional)**. Click **Continue**.

**3. Add your Twilio numbers**

On the **Numbers** step, enter each Twilio number in E.164 format, for example `+14155550100`, and click **Add**. Click **Continue**, check the summary and click **Create trunk**.

**4. Turn on Dial with leading plus**

Twilio rejects a called number without the leading `+` with `400 Bad Request`. Open the trunk's **Connection** tab and, under **Outbound: gateways**, turn on **Dial with leading plus**.

The caller ID on an outbound call must be a Twilio number on your account or a caller ID you verified in Twilio. For every field on these steps, see [Connect your carrier](https://www.bolna.ai/docs/sip-trunking/connect-carrier.md).

## Assign an agent and test

* **Inbound:** open the trunk's **Numbers** tab and, in the **Agent** column, pick an agent for your Twilio number. Then call the number. See [Receive inbound calls](https://www.bolna.ai/docs/sip-trunking/inbound-calls.md).
* **Outbound:** on the agent's **Calling** tab, set **Telephony Provider** to **SIP Trunk**. In the agent's outbound call dialog, pick your Twilio number as the caller ID, enter the number to call and click **Place call**. See [Make outbound calls](https://www.bolna.ai/docs/sip-trunking/outbound-calls.md).

If a call does not connect, see [Troubleshooting](https://www.bolna.ai/docs/sip-trunking/troubleshooting.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.