> This page is for Cloud Call Center.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.hams.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.hams.ai/_mcp/server.

# Trunks

> Add the SIP connections between the call center and your carriers, and set how each connection carries calls.

A trunk is the SIP connection between the call center and a carrier. Without a trunk, no call comes in or goes out. This page describes how to add, change, and delete a trunk. To learn how a trunk reaches Hams, see [SIP connection](/platform/integration/sip).

> **Note**
>
> Only administrators can see and change trunks.

![The Trunks tab. Each trunk shows its host, transport, direction, recording policy, status, and connection.](/_fern-img/5ec8c66d107d99690e664d6bd6f3e2355cbd0fc7a5ef3e51609a7a2be639000d.webp)

## Fields

| Field                                          | What it does                                                                                                                         | Rules                                                                                                                                                                                                        |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Name**                                       | Names the trunk in lists.                                                                                                            | Required. 1 to 128 characters. Each trunk in the account needs a different name.                                                                                                                             |
| **Domain**                                     | Sets the SIP domain of the trunk.                                                                                                    | Required. You choose it when you create the trunk. You cannot change it later.                                                                                                                               |
| **Host**                                       | Sets the address of the SIP server of your carrier.                                                                                  | Required. 1 to 255 characters. Use a hostname or an IP address.                                                                                                                                              |
| **Transport**                                  | Sets the protocol for SIP signaling.                                                                                                 | **UDP**, **TCP**, or **TLS**. The default is **UDP**. **TLS** encrypts the signaling.                                                                                                                        |
| **Direction**                                  | Sets which calls the trunk carries.                                                                                                  | **Inbound**, **Outbound**, or **Both**. The default is **Both**.                                                                                                                                             |
| **Port**                                       | Sets the SIP signaling port.                                                                                                         | A whole number from 1 to 65535. The default is `5060`.                                                                                                                                                       |
| **Register**                                   | Makes the trunk register with the carrier. If your carrier needs registration before it sends or receives calls, turn it on.         | Off by default. If you turn it on, you must fill in **Auth username**, **Auth secret**, and **Auth realm**.                                                                                                  |
| **Auth username**                              | Sets the SIP user name that your carrier gave you.                                                                                   | Shows only when **Register** is on. Up to 128 characters. Set **Auth username**, **Auth secret**, and **Auth realm** together, or set none of them.                                                          |
| **Auth secret**                                | Sets the SIP password that your carrier gave you.                                                                                    | Shows only when **Register** is on. Up to 255 characters. The system never shows a saved secret. When you edit a trunk, leave the field blank to keep the current secret.                                    |
| **Auth realm**                                 | Sets the authentication realm of your carrier.                                                                                       | Shows only when **Register** is on. Up to 255 characters. Many carriers use the SIP host as the realm.                                                                                                       |
| **Monitor connection (SIP OPTIONS keepalive)** | Sends probes to the trunk and reports its live status.                                                                               | Off by default. It has no effect on an **Inbound** trunk.                                                                                                                                                    |
| **Trust identity headers**                     | Takes the caller from the SIP header `P-Asserted-Identity`. Also lets call flows read who forwarded the call and why.                | Off by default. The field does not show for an **Outbound** trunk. See [Trust identity headers](#trust-identity-headers).                                                                                    |
| **Default caller ID**                          | Sets the number that an outbound call shows when the extension has no outbound caller ID.                                            | Optional. The field does not show for an **Inbound** trunk. Use an optional `+`, then 3 to 15 digits, `*`, or `#`.                                                                                           |
| **Codecs**                                     | Limits the audio codecs that the trunk can use.                                                                                      | Choose from `PCMU`, `PCMA`, `G722`, `G729`, `GSM`, `G723`, `iLBC`, `opus`, `speex`, `AMR`, and `AMR-WB`. The list is in priority order. To accept the codecs that your carrier offers, leave the list empty. |
| **Max inbound channels**                       | Limits the calls that arrive on the trunk at the same time.                                                                          | A whole number from 1 to 10000. Leave it empty for no limit. The trunk rejects calls over the limit.                                                                                                         |
| **Max outbound channels**                      | Limits the calls that leave through the trunk at the same time.                                                                      | A whole number from 1 to 10000. Leave it empty for no limit. The trunk rejects calls over the limit.                                                                                                         |
| **Allowed source CIDRs**                       | Lists the IP ranges that can send calls to the trunk.                                                                                | One CIDR range or IP address for each line. Up to 100 entries. A single IP address becomes a range of one address. IPv4 and IPv6 both work.                                                                  |
| **Track carrier IP via DNS**                   | Resolves the host name and trusts the IP addresses that it returns for inbound calls. Use it for a carrier whose IP address changes. | Off by default. The field does not show for an **Outbound** trunk. It is a convenience, not a security control. The **Resolved IPs** list shows the result.                                                  |
| **Call recording**                             | Sets the recording decision for calls on the trunk.                                                                                  | **Inherit**, **On**, or **Off**. The default is **Inherit**. See [Call recording](#call-recording).                                                                                                          |
| **Active**                                     | Turns the trunk on or off.                                                                                                           | On by default.                                                                                                                                                                                               |

## Add a trunk

Before you start, make sure that the account has at least one SIP domain. See [SIP domains](/cloud-call-center/settings/sip-domains).

#### Open the Trunks tab

Click **Settings** in the Cloud Call Center sidebar. Click the **Trunks** tab.

#### Open the form

Click **Create Trunk**. The **Create trunk** drawer opens.

#### Fill in the carrier values

Enter the **Name**. Select the **Domain**. Enter the **Host** and the **Port**. Select the **Transport** and the **Direction**.

#### Add the credentials

If your carrier needs registration, turn on **Register**. Enter the **Auth username**, the **Auth secret**, and the **Auth realm**.

#### Save the trunk

Click **Create**. The drawer closes and the trunk shows in the list.

To change a trunk, click its row. Change the fields. Click **Save**. You cannot change the **Domain** of an existing trunk.

## Trust identity headers

A carrier or PBX can tell the call center who calls and who forwarded the call. It does this in SIP headers. The call center believes these headers only when you turn on **Trust identity headers** on the trunk.

> **Warning**
>
> Turn on **Trust identity headers** only for a carrier or PBX that you trust. The setting decides the caller number that call flows and call history show. A false sender can show a false number.

When **Trust identity headers** is on, these changes apply to inbound calls on the trunk:

* The caller number comes from the header `P-Asserted-Identity`. If the header is missing or not valid, the caller number comes from the header `From`.
* The header `Diversion` or `History-Info` gives the number that forwarded the call and the reason. A call flow reads them as `call.redirected_from` and `call.redirect_reason`. See [Redirected calls](/cloud-call-center/call-flows#redirected-calls).

When the setting is off, the system ignores these headers. The values `call.redirected_from` and `call.redirect_reason` are empty.

The field does not show for an **Outbound** trunk, because the trunk gets no inbound calls.

![The Trust identity headers switch in the trunk drawer.](/_fern-img/c5319fdfdd1111c00a03f232980dcbe9b2fa4a11859001a8cdb847783aa31fb7.webp)

## Registered trunks

If **Register** is on, the call center registers with your carrier. The carrier can then send calls to the contact that the call center registered. These calls enter the call flow of the DID. The system takes the DID from the header `To`, or from the header `P-Called-Party-ID`.

## Default caller ID

The **Default caller ID** is the number that an outbound call shows when the extension has no **Outbound Caller ID**. If the trunk has none either, the call shows the extension number. The `caller_out` rewrite rules of the outbound route still apply to this number. For the rules, see [Outbound routes](/cloud-call-center/settings/outbound-routes).

![The Default caller ID field of a trunk.](/_fern-img/770079e5d4d798fbe8f9929f865b76aedf18d674ca894aea32bd554868821e26.webp)

## Status and connection

The **Status** column shows **Active** or **Inactive**. The **Connection** column shows the live state of the trunk. The page checks the state every 20 seconds. A change can take up to 90 seconds to show.

| Connection        | Meaning                                                                       |
| ----------------- | ----------------------------------------------------------------------------- |
| **Online**        | The carrier answers the probes. The badge also shows the response time.       |
| **Unreachable**   | The carrier does not answer the probes.                                       |
| **Not monitored** | **Monitor connection (SIP OPTIONS keepalive)** is off. The trunk still works. |
| **N/A**           | The trunk is **Inbound**. It has no outbound side to probe.                   |
| **Unknown**       | The system cannot read the state of the trunk.                                |

If **Register** is on, the drawer of the trunk also shows **Registered** or **Not registered**.

## Call recording

The **Call recording** setting decides if the system records calls on the trunk. The trunk is the first level of the decision. A DID or an outbound route can change the decision. A queue can change it in the middle of a call.

| Setting     | What happens                                                                                                   |
| ----------- | -------------------------------------------------------------------------------------------------------------- |
| **Inherit** | The trunk makes no decision. The next level decides. If no level decides, the system does not record the call. |
| **On**      | The system records the call. A later level can change this, unless you lock the decision.                      |
| **Off**     | The system does not record the call. A later level can change this, unless you lock the decision.              |

Turn on **Lock this decision** so that no later level can change the decision. Use it where the law makes recording mandatory.

The lock has no effect while the setting is **Inherit**. People listen to recordings in [Call history and recordings](/cloud-call-center/call-history).

## Change the direction

If you narrow the **Direction**, the DIDs and outbound routes stay on the trunk. Only the removed side stops.

If you remove **Inbound**, the DIDs on the trunk do not get calls any more. If you remove **Outbound**, the outbound routes on the trunk do not send calls any more.

The **Change trunk direction?** dialog shows how many DIDs and outbound routes this affects. Click **Change anyway** to save the change.

## Delete a trunk

> **Warning**
>
> Move all DIDs and outbound routes to another trunk before you delete a trunk. The system does not delete a trunk that a DID or an outbound route uses. You cannot undo a delete.

To delete a trunk, open the actions menu of its row. Click **Delete**. Click **Delete** again in the dialog.

## Related

* [SIP connection](/platform/integration/sip)
* [SIP domains](/cloud-call-center/settings/sip-domains)
* [DIDs](/cloud-call-center/settings/dids)
* [Outbound routes](/cloud-call-center/settings/outbound-routes)
* [Call history and recordings](/cloud-call-center/call-history)