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

# 22. Telephony

> Routes on a SIP trunk: an inbound number, an outbound route, a transfer subgroup and caller ID selection.

# Telephony: trunk and routes

> [!NOTE]
>
> **Module goal:** set up your organization's routes on a SIP trunk and understand how an inbound route differs from an outbound one.

![The Telephony section: a trunk with inbound and outbound routes](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-44-telephony-list_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=c2f1aadb8acb0a229552f38f54564939)

Telephony — a trunk with an inbound number that has an agent bound to it, and an outbound route. The Call button is a quick check with a live call; Routes opens the route settings window.

The model has two levels, and it is worth understanding once:

* **Trunk** — the connection to the carrier. The platform connects it and provides it to your organization together with a number pool and a quota: in the table such a trunk carries the **granted** badge.
* **Routes (subgroups)** — what you configure yourself, with the **Routes** button:
  * **inbound** = a number + **exactly one** agent that answers calls to this number (published only — live calls run the published version). When inbound handling is configured for the number, its rules choose the agent, and the card shows **Inbound handling: N agents**;
  * **outbound** = a four-digit dialing prefix + a set of caller IDs from the granted pool + any number of agents + allowed destinations and limits (concurrent calls and calls per minute) + the number selection policy;
  * **transfer** = the same as outbound, but only for calls to an operator: its own numbers, its own limits, its own five-digit prefix. Campaign settings do not apply to transfers. This subgroup is chosen in the transfer node — see [Transfer to a human](https://docs.hubtalk.ai/v4/tutorial/transfer.md).

Every field is described in [Telephony](https://docs.hubtalk.ai/v4/platform/telephony.md).

## Which number the call goes out from

If an outbound subgroup has several caller IDs, the choice between them is made by the **Outgoing number selection** setting on the subgroup card: **Random from the list** (the default) or **Round-robin over the list**.

The policy applies wherever no number is set explicitly: a test call from the **Call** button, the public API without a number, and every campaign attempt. Call and campaign forms offer **By subgroup policy** for this.

The chosen number is fixed for the whole call. A call never gets a number outside the subgroup pool: such a request is refused with a clear reason instead of going out from someone else's number.

> [!NOTE]
>
> **Number rotation does not switch itself on.** A pool of hundreds of numbers calls the way the subgroup policy says — if you need rotation, check that the card has Random from the list or Round-robin over the list selected.

![The SIP trunk routes window: inbound routes, outbound routes, transfer subgroups](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-45-telephony-trunk-form_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=c848ccbb6e7dd6bd0430ce448f1331cf)

The trunk routes window: inbound routes with X-headers passed to session variables, outbound routes with caller IDs, allowed destinations and limits, transfer subgroups.

> [!WARNING]
>
> **Three mistakes that cost a day of debugging**
>
> * **Allowed destinations left empty.** Empty = "call anywhere". Restrict by country prefix: `1` for the USA, `7` for Kazakhstan — this protects against calls to the wrong place when the contact file has an error.
> * **Route limits above what the line can carry.** On a provided trunk the limit fields show the grant quota, and a value above it is not saved. But even within the quota the limit must match what the line really carries — otherwise some calls simply won't go out.
> * **The agent is not published.** Only a published agent can be bound to a route — if the agent you need is not in the list, publish it first.

> [!NOTE]
>
> **What to agree on before the first call**
>
> The trunk, the numbers in the pool, the quota and the transfer prefix (it is set up on the trunk side in advance) come from the platform: contact the platform administrator or HubTalk AI support. On your side, check the number format in your files and in the API: the dialing prefix is set in the outbound route, not in the agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.