# Create a SIP Peer Trunk

A SIP (Session Initiation Protocol) peer trunk links your phone system, also called the PBX (private branch exchange), to an internet telephony service provider (ITSP) that identifies your system by its domain name or IP address rather than by a login. Use this type of trunk when the provider gives you connection details but no account credentials. The steps below walk through a typical setup that applies to any peer trunk.

## Before you start

This example assumes you have a SIP service from an ITSP called ABC with the following details:

- **Provider domain**: abc.provider.com
- **Protocol**: SIP
- **Registration port**: 5060
- **Transport**: UDP (User Datagram Protocol)

Make sure the following are true before you begin:

- You have a SIP service from an ITSP that supplies a domain name or IP address only, with no username or password.
- Your phone system can reach the ITSP over the network.
- Your account can add trunks.

:::note
If the **Add** button under **Extension and Trunk > Trunk** is greyed out, your account does not have permission to add trunks. Contact your service provider to request it.
:::

## Add the trunk

1. Sign in to the phone system web portal and go to **Extension and Trunk > Trunk**, then click **Add**.

2. In the **Basic** section, fill in these fields:

   - **Name**: A label that helps you recognize the trunk.
   - **Trunk Status**: Choose **Enabled**.
   - **Select ITSP Template**: Choose **General**.

3. In the **Detailed Configuration** section, pick the trunk type and enter the SIP details your ITSP provided.

   - **Trunk Type**: Choose the peer trunk option that matches how your provider routes calls:
     - **Peer Trunk (DID Based)**: Use this when the ITSP routes calls by DID number. DID (Direct Inward Dialing) is a phone number that connects an outside caller straight to a specific trunk or extension.
     - **Peer Trunk (Port Based)**: Use this when the ITSP routes calls by SIP registration port.
     - **Peer Trunk (Private Network)**: Use this when the ITSP and the phone system share the same private network.

     After you select a type, the phone system shows its own **Static IP Address** and **Port** on the page.

     :::note
     A **Peer Trunk (DID Based)** trunk requires at least one DID rule (see the DID step below).
     :::

   - **Transport**: Select the transport your ITSP uses. In this example, choose **UDP**.
   - **Hostname/IP**: Enter the ITSP domain name or IP address. In this example, enter *abc.provider.com*.
   - **Port**: Enter the registration port your provider gave you. In this example, enter *5060*.
   - **Domain**: Enter the domain used in the SIP URI (Uniform Resource Identifier, the address of a SIP endpoint) of headers such as From and To. In this example, enter *abc.provider.com*.

     :::note
     If the ITSP did not give you a domain, use the same value you entered for **Hostname/IP**.
     :::

   :::caution
   A peer trunk has no username or password, so the ITSP authorizes calls by recognizing your phone system instead. The **Transport**, **Hostname/IP**, and **Port** must match exactly what the provider gave you, and the provider must have your phone system's **Static IP Address** on file. If any value is wrong, the trunk will not register.
   :::

4. Optional: If you bought DID numbers from the ITSP, open the **DIDs/DDIs** tab to add them to the trunk. (DDI, or Direct Dialing Inward, is the term used outside North America for a DID.)

   :::note
   This step is required when the trunk type is **Peer Trunk (DID Based)**.
   :::

   a. Click **Add**, then enter your DID numbers.

      - To add one number, set **Create Method** to **Single DID**, then configure:
        - **DID/DDI**: The DID number from your provider.
        - **DID/DDI Name**: Optional. A label that distinguishes inbound calls by DID number. When someone dials the number, this name appears on the called party's device.
      - To add a block of numbers, set **Create Method** to **DID Range**, then configure:
        - **DID Range**: The first and last numbers in the range.
        - **DID/DDI Name**: Optional. A label that distinguishes inbound calls by DID number. When someone dials the number, this name appears on the called party's device.

   b. Click **Confirm**.

   :::tip
   For more detail on DID configuration, see [Configure DID Numbers on a Trunk](/pbx/administrator-guide/configure-did-numbers-on-a-trunk/).
   :::

5. Click **Save**, then **Apply**.

   :::note
   Your changes do not take effect until you click **Apply**. **Save** stores the trunk, and **Apply** activates it on the phone system.
   :::

## Check the result

Go to **Extension and Trunk > Trunk** and review the trunk status on the trunk list.

If the status shows ![Registered trunk indicator](/images/pbx/trunk-ok.png), the trunk registered successfully.

For an explanation of every trunk state, see [SIP Trunk status](/pbx/administrator-guide/sip-trunk-overview/#concept_kzd_png_tdb__section_b1z_1ft_wpb).

## Next steps

- To receive inbound calls over the trunk, assign it to one or more inbound routes. See [Set up an Inbound Route](/pbx/administrator-guide/set-up-an-inbound-route/).
- To place outbound calls over the trunk, assign it to one or more outbound routes. See [Set up an Outbound Route](/pbx/administrator-guide/set-up-an-outbound-route/).
