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

# BYO SIP trunk

> Connect your own SIP provider and use your existing numbers

Already have numbers and a SIP provider (Telekom, sipgate, Twilio, Telnyx, Plivo, or any standards-compliant trunk)? Connect them directly — calls flow between your provider and the platform's voice infrastructure without porting anything.

## Setup checklist

1. **Copy the platform SIP URI** from **Settings → Phone numbers → Add SIP integration** (or Carrier import). Pick a **SIP region** (default: global) so inbound signaling terminates where you need it (e.g. EU).
2. At your provider, set that URI as the **origination / forwarding destination** for your numbers.
3. Create the trunk in the platform (form below) — inbound auth + outbound termination.
4. Assign numbers to assistants and test inbound, then one outbound test call.

## Trunk type

| Type                   | When to use                                                                 | Numbers                                                                                                                                                                                                            |
| ---------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Phone number (DID)** | Most carriers (recommended)                                                 | One E.164 DID on the trunk; listed under **Numbers**                                                                                                                                                               |
| **SIP Extension**      | Carrier sends many DIDs to one trunk; you authenticate by credentials or IP | Inbound accepts any DID. Optional **Primary DID** for outbound caller ID — full E.164 (`+…`) **or** national digits without country code (e.g. `0741926265`). National-only primaries are not listed under Numbers |

## Inbound (receiving calls)

* **Your phone number (DID)** — public E.164 customers dial; must match what the carrier forwards to the platform SIP URI.
* **Inbound authentication**
  * **SIP username/password** (recommended) — digest auth.
  * **Provider source IPs** — only if the carrier cannot do digest and publishes stable SIP source IPs/CIDRs. Do not use overly wide ranges.
* At the provider: forward / originate to the platform SIP URI you copied.

Incoming calls are matched to the assistant you assign, exactly like marketplace numbers.

## Outbound (calling out)

* **Termination address** — provider SIP host only (e.g. `sip.telnyx.com`). No `sip:` prefix, no port.
* **Transport** — `AUTO` (recommended), `UDP`, `TCP`, or `TLS`. Secure trunking always uses TLS.
* **Outbound region** — where the platform originates the call. Prefer **Automatic**, or the country closest to your customers / carrier POP.
* **Outbound calling number format** — how the FROM number is sent to the carrier. Must match the carrier’s setting (e.g. Telnyx Origination Number Format):
  * International with `+` (recommended for most)
  * International without `+`
  * National (no country code)
* **Credentials**
  * **Shared** (recommended) — one username/password for inbound and outbound.
  * **Separate** — distinct inbound vs outbound secrets when the carrier requires it.
* **Outbound authentication** — username/password (recommended). The platform has **no static outbound IPs**, so carrier IP allowlists usually fail. Use “no credentials” only if the carrier explicitly allows unauthenticated outbound.

Outbound calls and campaigns can then use your trunk and your caller IDs.

## Advanced

Expand **Advanced** when creating or editing a BYO trunk:

| Setting                               | Meaning                                               | Recommendation                                                                                               |
| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **Secure trunking (TLS + SRTP)**      | Encrypted signaling + media                           | Enable when the carrier supports Secure Trunking / TLS+SRTP                                                  |
| **Media encryption**                  | Allow (prefer SRTP) or Require SRTP                   | Allow unless compliance requires Require                                                                     |
| **Custom outbound headers**           | X-\* on outbound INVITEs (max 10)                     | Empty unless carrier docs require a header                                                                   |
| **Inbound headers (200 OK)**          | Custom X-\* in the SIP 200 OK                         | Usually empty                                                                                                |
| **Header → attribute maps**           | Map SIP headers into call attributes for agents/tools | Only if you need carrier metadata                                                                            |
| **Include SIP headers as attributes** | None / all X-\* / all headers                         | **None** (map only what you need)                                                                            |
| **Media codecs**                      | Extra SDP codecs (PCMU, PCMA, G.722, AMR-WB)          | Leave platform defaults; add AMR-WB only if required. Avoid “Only listed codecs” unless you know peer codecs |
| **Media / ringing timeouts**          | Optional overrides (seconds)                          | Leave empty (platform defaults) unless troubleshooting                                                       |

**HD Voice (G.722):** enable on the **Telnyx** connection/codec settings when needed (supported with Telnyx, not Twilio).

## Edit later

Existing trunks are edited from **Numbers → Configure → Carrier Settings** (not from a separate trunk list on Add SIP integration).

## EU routing

For EU customers, SIP traffic can terminate on the platform's **EU-pinned SIP endpoint**, keeping media and signaling inside the EU — relevant for GDPR documentation. Media/agent processing runs in Frankfurt (eu-central).

## Limits and behavior

* E.164 numbers on BYO trunks count against the same plan limit as purchased numbers (`max_own_numbers`).
* Calls over your own trunk avoid the platform's per-destination carrier surcharge — your provider bills termination directly. Plan minutes are still consumed; see [billing](/billing/minutes).
* All assistant features — flows, warm transfer, recording, monitoring — work identically on BYO trunks.

## API

Create and manage trunks via the Public API (`POST /sip-trunks` and related endpoints in the API reference). The same fields as the UI (`trunk_kind`, `calling_number_format`, `transport`, Advanced maps, etc.) are accepted on create; passwords are never returned.

<Tip>
  Test inbound first: call one of your numbers and check it appears in **Calls** with the right assistant. Then verify outbound with a single test call before wiring the trunk into campaigns.
</Tip>
