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

# Trunks

> The carriers that carry your calls.

A trunk is a carrier connection: inbound, outbound, or both.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/firetone/images/trunks-list.png" alt="Trunks" />

<Note>
  **No credential is ever rendered.** A trunk's password is stored encrypted and
  never returned by the API, so this screen shows what a trunk *is* and never
  what it authenticates with.
</Note>

## Your own carrier

You may bring your own trunk. Calls over it cost the platform nothing, so:

* It is **preferred** over the operator's when both could carry the call.
* It works **even when your balance is empty**.

A tenant's own trunk is never selectable by another tenant. That is enforced in
carrier selection rather than hidden in the interface — otherwise it would be
unmetered calling on somebody else's account.

## What a carrier may need from you

Five settings exist because carriers differ, and all five are on the trunk:

* **Dial prefix** — digits this carrier wants in front of the number, added on
  the way out. Not the same as your organisation's outside-line prefix, which
  is what staff dial to reach a line and is stripped on the way in.
* **Accept national-format numbers** — for a carrier that hands over
  `09216217231` rather than `+919216217231`. List the **Countries** its
  numbers belong to: `AU`, or `AU, IN` for a carrier that delivers both. A
  national number is tried in each country, in order. Only a number you own
  can match, so two readings of the same digits can't both ring. If you own
  both, the first-listed country wins.
* **Outbound channel limit** — reserves part of the trunk for calls coming in,
  so a burst of outgoing calls cannot fill it.
* **Number format** — international digits (the default), international with
  a `+`, or national (`0412345678`) for a carrier that takes its own country's
  numbers that way. With several countries, only the **first** (the
  carrier's home country) is sent in national form. Every other country's
  numbers go in full international form, so the carrier never has to guess
  which country a `0` number belongs to.
* **Default caller ID** — the number shown to this carrier when neither the
  extension nor your organisation has one; usually the number the carrier
  account is registered as. Without any, a call presents the extension number
  and is usually refused.

Your own trunk carries **only your numbers** inbound: a call to another
organisation's number over it is refused.

If a carrier sells several service levels (tech prefixes), list them on the
trunk's page and choose between them by destination with outbound rules on
**Outbound routing** — `+91` at one level, everything else at another.

Its page also shows what it is doing right now: whether it is registered, how
many channels are up, who is allowed to call in on it, and what it has carried.

## Failover

Trunk groups try carriers in order and fall through on refusal. A call that no
carrier will take ends with the reason on the call record rather than as
silence: the call's page shows **Far end**, the carrier's own answer (`403`,
`503`), and the caller hears that the call cannot be completed.

## WhatsApp calls (Meta)

Meta delivers WhatsApp calls over SIP like any other carrier:

* **The trunk:** Transport **SIP**, authentication **by IP address**, with
  Meta's SIP source addresses as allowed addresses. Meta connects over TLS,
  normally to port 5061.
* **Codecs:** WhatsApp audio is Opus, so tick **Opus** and keep it first in the
  order; G.711 behind it does no harm. Do **not** leave the codecs unticked: an
  empty selection means G.711 only, which a WhatsApp call cannot use.
* **Encryption:** in Meta's calling settings for the number, set the SIP
  server's SRTP key exchange (`srtp_key_exchange_protocol`) to **SDES**.

<Warning>
  With Meta's default, DTLS, the call connects on the caller's phone and they
  hear nothing. The switch sends its answer and then waits for Meta's DTLS
  handshake, which does not complete. FireTone gives up after 15 seconds and
  logs `call had no audio` with `leg=dtls_not_completed` and the fix. The call's
  trace shows the same under **media**.
</Warning>

A call that was answered but never got its audio up for another reason is
logged as `answer_not_completed`, with what the far end offered: its transport,
encryption and codecs. Compare those with the trunk's codec list.
