# SIP Domain Setup

### What is a SIP Domain?

A **SIP domain** is like the “address” where your phone service routes calls over the internet using the SIP (Session Initiation Protocol) standard. Instead of relying on traditional phone lines, SIP domains let you connect calls digitally through your provider.

When a call comes in, your SIP provider sends it to the SIP domain you configure — in this case, Alhena — so your Voice AI agent can answer.

***

### What is SIP Trunking?

**SIP trunking** is the technology that replaces physical phone lines with virtual connections. A SIP trunk connects your telephony provider (e.g., Twilio, Telnyx, Bandwidth) to your Alhena Voice AI agent.

Think of it as the digital pipeline that delivers incoming calls from your phone number to Alhena.

***

### Step 1: Navigate to Voice AI Settings

1. From the left navigation menu, go to **Integrations**.
2. Select **Voice AI Settings**.
3. Under **Connect Phone Number**, choose **Configure SIP domain**.

***

### Step 2: Add Allowed IP Ranges

For security, you need to define which IP ranges are allowed to connect to your SIP domain.

1. In the **Connect a SIP Line** dialog, click **Add IP Range**.
2. Enter the CIDR range or individual IP addresses provided by your SIP provider.
   * For example, if you’re using Twilio, you can find the required IP ranges here.
3. Repeat the process to add multiple ranges if necessary.

⚠️ **Important:** Only calls from the allowed IP ranges will be accepted.

***

### Step 3: Save Changes

1. After entering all required IP ranges, click **Save Changes**.
2. Your SIP domain will now be connected to Alhena.

***

### Step 4: Configure Your SIP Provider

Next, log in to your SIP provider’s console and configure your SIP trunk to send inbound calls to the SIP domain Alhena provides you.

* Set the Alhena SIP domain as the **Origination URI** (or equivalent setting) in your provider’s console.
* Assign your desired phone number(s) to this trunk so that when someone calls, the provider forwards the call to Alhena.

***

### Example: Twilio Elastic SIP Trunking

If you’re using **Twilio Elastic SIP Trunking**, here’s how to connect it with Alhena:

1. In the Twilio Console, go to **Elastic SIP Trunking → Trunks** and create a new trunk.
2. Under the **Origination** tab, add the **SIP domain provided by Alhena**.
   * This tells Twilio to forward inbound calls to Alhena.
3. Assign your Twilio phone number(s) to this trunk.
4. In Alhena, make sure you’ve whitelisted Twilio’s IP ranges under **Allowed IP Ranges**.

✅ Now, whenever someone calls your Twilio number, Twilio will send the call to Alhena, and your Voice AI agent will answer.

***

### Step 5: Test Your Setup

1. Place a test call to your number configured with the SIP trunk.
2. Verify that the call is correctly routed to your Alhena Voice AI agent.
3. Check logs or call records in both Twilio and Alhena if troubleshooting is needed.

***

### Notes

* If you don’t have a SIP provider, you can alternatively select **Get a free phone number** from the Voice AI settings to test without external setup.
* Twilio users: ensure your phone number is assigned to the trunk with Alhena as its origination URI.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alhena.gitbook.io/docs/features/voice-ai/sip-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
