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

# SIP trunks

> Bringing your own carrier.

Wixzel Voice does not sell phone numbers or minutes. You connect a SIP trunk
from a carrier you choose, and your carrier bills you directly at your rates.

That is a deliberate trade. It means one more step before your first call, and
it means we are never between you and your telephony provider — no markup, no
resale margin, and no reason for us to care which carrier you pick.

## What you need

Any SIP provider will do. From them you need:

* a **host** — `sip.carrier.example`
* **credentials** — username and password, if they use registration
* your numbers, and whether inbound calls are delivered to that trunk

## Connecting it

```bash theme={null}
curl https://api.voice.wixzel.com/v1/sip-trunks \
  -H "Authorization: Bearer $WIXZEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My carrier",
    "host": "sip.carrier.example",
    "port": 5060,
    "transport": "udp",
    "username": "acct123",
    "password": "…"
  }'
```

`transport` is `udp`, `tcp` or `tls`.

<Note>
  The password is encrypted at rest and is never returned by the API again —
  including to you. Store it wherever you keep the rest of your carrier
  credentials.
</Note>

## Registering a number

A number must belong to a trunk before it can place a call:

```bash theme={null}
curl https://api.voice.wixzel.com/v1/phone-numbers \
  -H "Authorization: Bearer $WIXZEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+14155550100",
    "sip_trunk_id": "st_01HXYZ"
  }'
```

Give it an `inbound_agent_id` and calls **to** that number are answered
automatically by that agent.

## Carrier-side setup

Your carrier needs to know where to send traffic. Point the trunk at the IP of
your Wixzel Voice deployment on the SIP port, and allowlist that IP if your
carrier requires it.

<Warning>
  An open SIP port is scanned for toll fraud within hours of appearing. Only
  endpoints matching a trunk you have configured are accepted — there is no
  anonymous endpoint — but keep your carrier's own fraud controls on regardless.
</Warning>

## When a call fails

`400 number_not_on_trunk` means the number has no `sip_trunk_id`. Calls are
placed over your trunk, so a number that is not on one has nowhere to go.

If calls connect but there is no audio, the usual cause is RTP not reaching the
server — check that your firewall allows the media port range, not just the
signalling port.
