# SIP trunking

Source: https://docs.usetone.ai/sip-trunking

> Bring your own carrier trunk or PBX. Tone agents answer and dial on the numbers you already own.

*You already have phone numbers on a licensed Indian carrier — an Airtel or Tata enterprise
trunk, an Exotel or Vobiz account, or a PBX that fronts one of those. This page is how you point
that trunk at Tone so a Tone agent answers your inbound calls and places your outbound ones,
without moving a single number.*

## What Tone is, and is not, on a trunk

Tone is an application platform: in regulatory terms, a cloud EPABX. Your carrier stays the
licensed operator that interconnects with the phone network; Tone never terminates a call onto
the PSTN itself. Every packet of audio stays in Mumbai (`ap-south-1`). Every outbound dial
still passes the pre-dial compliance gate, and every call is recorded in your call log with the
same webhooks, transcripts and recordings a Tone-number call gets.

What you keep: your numbers, your carrier contract, your rates. What Tone runs: the agent, the
compliance gate, recording, billing.

## Connection details

| Setting | Value |
|---|---|
| SIP address | `sip.usetone.ai` |
| Ports | `5061` TLS (recommended) · `5060` TCP or UDP |
| Signalling IPs to allowlist | shown on your trunk's page in the dashboard |
| Media | RTP, UDP `16384–32768`, from the same IPs |
| Codecs | PCMA (G.711 A-law), PCMU, G.722, Opus — in that order of preference |
| DTMF | RFC 2833 |
| Registration | not required; Tone identifies your trunk by source IP or by digest credentials |

## Two ways your trunk can identify itself

- **IP allowlist** — you tell Tone the public IPv4 ranges your carrier or PBX sends from. This is
  how Exotel vSIP and most enterprise SBCs work. `/24` or narrower; private ranges are refused.
- **Digest credentials** — Tone issues a username and a password, shown **once** when the trunk
  is created (or rotated). Use this when your side has no fixed address, or in addition to the
  allowlist.

For outbound calls Tone dials *your* carrier. You give Tone the host, port and transport your
carrier publishes for termination, and either allowlist Tone's IPs at the carrier or give Tone a
username and password to present.

## Create a trunk

Trunks are an organization-level resource and need a verified (KYC) organization and the
**SIP trunking** capability enabled by Tone support.

```http
POST /v1/sip-trunks
{
  "name": "Airtel HQ trunk",
  "inboundAuth": "ip_acl",
  "ipAcl": ["203.0.113.0/28"],
  "outboundHost": "sbc.example.com",
  "outboundPort": 5061,
  "outboundTransport": "tls",
  "outboundAuthUsername": "tone",
  "outboundAuthPassword": "…",
  "outboundNumberFormat": "e164",
  "maxConcurrent": 20
}
```

The response carries the trunk and, **once**, the connection block your carrier console needs —
including the digest password if you chose credentials:

```json
{
  "trunk": { "id": "…", "status": "pending_verification", "…": "…" },
  "connection": {
    "host": "sip.usetone.ai", "port": 5061, "transport": "tls",
    "ips": ["…"], "realm": "sip.usetone.ai",
    "username": "t_9f2c…", "password": "…"
  }
}
```

A new trunk is `pending_verification` until Tone staff approve it; approval is usually same-day.
Rotate credentials with `POST /v1/sip-trunks/{id}/credentials/rotate` (the old ones stop working
immediately). `POST /v1/sip-trunks/{id}/test` sends a SIP `OPTIONS` ping to your outbound host
and reports reachability and round-trip time.

## Add your numbers

Each number your carrier will send to Tone becomes an ordinary Tone phone number — with an agent,
recording switch and call log — but with no rental, because you already pay your carrier for it.

```http
POST /v1/sip-trunks/{id}/numbers
{ "e164": "+918044001234", "agentId": "…" }
```

Inbound calls to the number are answered only when they arrive **on that trunk**. A call for
your number arriving from another trunk is refused, which is what stops one tenant's
misconfiguration from reaching another's agent.

## Outbound calls and campaigns

Nothing changes on the API: `POST /v1/calls` with a trunk number as `numberId`, or a campaign
using it, dials through your carrier with the number as caller ID. The compliance gate (calling
window, your DNC list, consent) runs before every dial exactly as it does for Tone numbers.
Busy, no-answer and failed outcomes reach your webhooks with the same dispositions.

Your carrier decides which caller IDs it accepts; Tone presents the trunk number in
`From` and `P-Asserted-Identity`. Some Indian carriers want the destination in national format
with a leading zero rather than `+91`: set `outboundNumberFormat` to `national0` if your first
test call is rejected with a number-format error.

## Billing

A call on your own trunk bills the **agent + platform** components — ₹5.50 per minute list —
and no telephony component, because the carrier minute is yours. If the number is also routed to
your own voice stack (`byo_ws`), only the platform component applies. There is no monthly rental
on trunk numbers.

## Refusals you may see

| SIP response | Meaning |
|---|---|
| `403 Forbidden` | Source IP not on the allowlist, wrong credentials, trunk disabled or not yet approved, or the number is not on this trunk |
| `404 Not Found` | The dialled number is not registered on Tone |
| `503 Service Unavailable` | The trunk or your organization is at its concurrent-call limit, or Tone could not reach its own API and refused rather than guess |

Each refusal is also visible on the trunk's page in the dashboard with the reason spelled out.

## Carrier guides

- [Exotel vSIP](/sip-trunking/exotel-vsip) — PoPs and transports, the `X-Exotel-AccountSid` header
  you must send, and the Exophone rule that rejects outbound calls.
- [Vobiz](/sip-trunking/vobiz) — digest or IP identity, and the number format that usually needs
  changing.
- [Tata Smartflo](/sip-trunking/tata-smartflo) — what to put on the provisioning form, since Tata
  configures the trunk rather than you.
- [Airtel (via your SBC)](/sip-trunking/airtel) — front the trunk with your own SBC and route
  selected DIDs to an agent.
- [Asterisk and FreePBX](/sip-trunking/asterisk-freepbx) — PJSIP config, the FreePBX fields that
  generate it, and the three settings that are load-bearing.

Any standards-compliant SIP trunk that can send `INVITE` to a hostname over TLS, and accept
`INVITE` from a fixed IP, works with the details above — these pages just save you the round trips.

## Tone numbers to your hosted platform

If instead you want a **Tone** +91 number delivered to Retell, Vapi, ElevenLabs or LiveKit over
SIP, that is the per-number trunk described in [Tone Media Streams](/tone-media-streams#sip-trunking-for-hosted-platforms).
