> ## 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.

# Outbound routing

> Which carrier an organisation's outgoing call uses, in the order the switch decides it.

The **Outbound routing** screen answers one question: *how do this
organisation's calls go out?* Choose an organisation in the header and the page
is that answer, in the order the switch works through it.

## The order a call is decided in

<Steps>
  <Step title="A rule that covers the number">
    The **most specific pattern wins** — `+9192` beats `+91` beats `*` — and an
    organisation's own rule beats a shared one for the same pattern. Only the
    winning rule's carriers are tried: a call never falls back onto another
    rule's.
  </Step>

  <Step title="…otherwise the organisation's own carriers">
    A number no rule covers goes out only through a carrier the organisation
    owns. **The operator's shared carriers are never used without a rule.**
  </Step>

  <Step title="…otherwise the call is refused">
    The caller hears that the call cannot be completed, and the daemon logs
    which rule was tried and which carriers were passed over.
  </Step>
</Steps>

A rule for `*` is therefore the organisation's **default carrier**, and an
organisation with neither a `*` rule nor a carrier of its own can call only the
numbers its other rules cover.

## What a rule is

A rule is a **pattern** and the carriers it names. Each entry is a **carrier at
a service level** — the same carrier may appear twice at two levels, which are
priced separately. A level's tech prefix replaces the carrier's own dial prefix
for that call; an entry with no level sends no prefix.

Patterns are stored with the `+`: type `+91`, or `91`, and both are kept as
`+91`. `*` is the only wildcard; `+9*` is refused.

### The three kinds

| Kind           | The carriers are tried                                                        |
| -------------- | ----------------------------------------------------------------------------- |
| **Simple**     | one carrier at one service level                                              |
| **Failover**   | in the order you set — the next only when the one before cannot take the call |
| **Least cost** | cheapest **for the number dialled** first, then the rest                      |

**Least cost** compares what each carrier charges *you*, per minute, for that
number at that service level. So one rule can send India through one carrier and
Australia through another, and can choose between two service levels of a single
carrier. A carrier **nobody has priced** is tried **last**, never first: an
unknown price is not a low one.

The kind belongs to the whole rule. Adding a second carrier asks which it
becomes; the rule's editor changes it afterwards. `firetonectl doctor` reports a
rule whose entries ever disagree (`outbound-rule-mixed-kind`), because then the
order depends on which entry is read first.

## Try a number

At the top of the screen, and worth using before anything else: it runs **the
same code a real call runs** and says what happened — the rule that matched, the
carriers tried, and **the ones passed over, with why**.

A carrier is passed over when:

* **its price list does not cover the number.** A carrier's deck is also the list
  of where it can send a call, so a trunk with a list of its own is not offered a
  number the list leaves out. Add the destination under *Trunks → the carrier →
  Destinations & pricing*, or clear that list to fall back to the shared cost
  card.
* **this organisation cannot use it** — it is disabled, not a SIP trunk, or it
  belongs to another organisation.

If every carrier of the matching rule is passed over, the call is refused. That
is a different fault from "no rule covers this number", and the screen says
which.

<Note>
  Until 2026-09-21 it said the same sentence for both, so a rule that had matched
  was reported as a rule that did not exist. If you remember the screen telling
  you "no outbound rule covers this number" about a number you had just written a
  rule for, that was this.
</Note>

## Offers

An **offer** is a (carrier, service level) pair under a name an organisation
sees — they never see the carrier. When an organisation admin picks one under
*Choose how calls go out*, that **writes a rule** for their organisation. An
offer by itself routes nothing.

## Trunk groups

A group orders an organisation's **own** carriers — step 2 — and decides which
organisations may use a shared carrier. Within a group the order is: a carrier
the organisation supplies itself first, then the priority you set, then the
cheaper one. A group does **not** order a rule's carriers; that is the rule's
kind.
