# Connect Your SIP Trunk

> Bring your own SIP trunk (BYOC) to the Edesy AI voice agent: add a carrier and its gateways, add your numbers, assign an agent, and check the call logs.

Source: https://edesy.in/docs/voice-agent/telephony/sip-trunk

If you already buy calling from a carrier over SIP, you can keep that carrier and put an Edesy AI voice agent on its numbers. This is called BYOC (bring your own carrier). You set it up in the voice agent dashboard under **Settings → SIP Trunks**.

> **Don't have a trunk yet?** You don't need one. [Buy an Indian number](https://edesy.in/docs/voice-agent/phone-numbers/purchasing) in the dashboard, or [connect a Twilio, Exotel, Plivo or Vobiz account](https://edesy.in/docs/voice-agent/phone-numbers/byop).

## Which path to use

| You have | Use |
|----------|-----|
| A SIP trunk from your own carrier or PBX | **Settings → SIP Trunks** (this page) |
| An account with Twilio, Exotel, Plivo or Vobiz | [BYOP setup](https://edesy.in/docs/voice-agent/phone-numbers/byop) |
| No numbers yet | [Purchasing numbers](https://edesy.in/docs/voice-agent/phone-numbers/purchasing) |
| An AI agent on another platform (LiveKit, Vapi, Retell, Pipecat) that needs an Indian number | [SIP trunk for AI voice agents](https://edesy.in/docs/sip-trunk-for-ai-voice-agents) |

**Phone Numbers → Add number → SIP trunk** is a different option. It puts a number on one of Edesy's own shared trunks. To use your own carrier, start from **Settings → SIP Trunks**.

## Before you start

From your carrier, collect:

- The **SIP host or IP address** of each gateway, plus its **port** and **transport** (UDP, TCP or TLS).
- Whether the trunk needs **registration**. If it does, you also need the username, password and SIP realm.
- Any **tech prefix** the carrier wants in front of dialled numbers.
- How the carrier sends keypad tones (**DTMF**). RFC 2833 is the most common.
- The numbers (DIDs) on the trunk, in E.164 format, e.g. `+919876543210`.

You need the **owner**, **admin** or **member** role in the workspace to manage SIP trunks.

## Step 1: Add the carrier

1. Open **Settings → SIP Trunks**. The **Carriers** tab opens first.
2. Create a carrier and fill in:

| Field | What to enter |
|-------|---------------|
| **Carrier Name** | Any label, e.g. `Telnyx Production` |
| **Description** | Optional |
| **Requires Registration** | Turn this on if your carrier authenticates with a username and password. Then fill in **Username**, **Password** and **SIP Realm** (e.g. `sip.telnyx.com`) |
| **Tech Prefix** | Optional dialling prefix the carrier asks for |
| **DTMF Type** | RFC 2833 (recommended), in-band or SIP INFO. Match your carrier |
| **E.164 Leading Plus** | Whether numbers are sent with a leading `+` |

3. Press **Create Carrier**.

## Step 2: Add gateways

A gateway is one SIP endpoint of the carrier. Add each one the carrier gives you:

| Field | What to enter |
|-------|---------------|
| **IP Address or Hostname** | e.g. `sip.telnyx.com` or an IP address |
| **Port** | Default `5060` |
| **Protocol** | UDP, TCP or TLS |
| **Inbound / Outbound** | Which direction this gateway carries. Turn on at least one |

Press **Add Gateway**. Add a second gateway if your carrier gives you a backup endpoint.

## Step 3: Add your numbers

1. Open the **Phone Numbers** tab.
2. Add each DID: **Phone Number** in E.164 format, an optional **Friendly Name** (e.g. `Main Support Line`), and pick the **Carrier** from step 1.

## Step 4: Assign a voice agent

On the **Phone Numbers** tab, press **Assign** next to a number and choose the agent. Inbound calls to that number now go to the agent. Use **Change Agent** to switch later.

The **Applications** tab is for a different job. It sends calls on a number to your own webhook URL instead of to an Edesy agent. You don't need it to put an agent on your trunk.

## Step 5: Test and check the logs

1. Call the number from a phone and talk to the agent.
2. Open the **Call Logs** tab to confirm the call arrived over your trunk.
3. Review the conversation, transcript and timing in **Call History**.

If calls don't arrive, check the carrier side first: the number must point at your Edesy trunk in the carrier's portal. Then check the gateway host, port and transport, and the registration credentials.

## Common problems

| Symptom | Check |
|---------|-------|
| Calls never reach the agent | The carrier routes the DID to the trunk; the gateway has **Inbound** on; the number is added and has an agent assigned |
| Registration fails | Username, password and **SIP Realm** match what the carrier issued |
| Keypad presses are ignored | **DTMF Type** matches the carrier (try RFC 2833) |
| One-way or no audio | Usually NAT or a SIP ALG on your network. See [one-way audio and NAT](https://edesy.in/docs/sip-trunking/troubleshooting/one-way-audio-and-nat) and [SIP ALG](https://edesy.in/docs/sip-trunking/troubleshooting/sip-alg) |
| Numbers rejected by the carrier | Toggle **E.164 Leading Plus**, or set the **Tech Prefix** the carrier expects |

## Related

- [Telephony overview](https://edesy.in/docs/voice-agent/telephony)
- [BYOP setup](https://edesy.in/docs/voice-agent/phone-numbers/byop) for Twilio, Exotel, Plivo and Vobiz accounts
- [Latency optimization](https://edesy.in/docs/voice-agent/advanced/latency), including calls in India
- [Calling compliance in India](https://edesy.in/docs/voice-agent/advanced/calling-compliance-india)
- [Edesy SIP trunking](https://edesy.in/docs/sip-trunking) if you need a SIP trunk for Indian numbers
- [Pricing](https://edesy.in/ai-voice-assistant/pricing)
