# Create a SIP Trunk from a Template

A SIP (Session Initiation Protocol) trunk is the connection that carries calls between your phone system and your telephone provider over the internet. Cloud Voice ships with ready-made configuration templates for a wide range of internet telephony service providers (ITSPs) that have been tested and certified. When a template exists for your provider, most of the connection details are filled in for you, so you can stand up a working SIP trunk in a fraction of the time it takes to configure one by hand.

## Before you begin

- Confirm that your ITSP is among the providers Cloud Voice has tested and supports. If your provider isn't covered, you'll need to build the trunk manually instead of from a template.
- Make sure your system can reach the ITSP over the network.
- Verify that your account can add trunks.

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

## Create the trunk

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

2. Under **Basic**, fill in the following:

   - **Name**: A label that helps you recognize the trunk later.
   - **Trunk Status**: Set this to **Enabled**.
   - **Select ITSP Template**: Choose your country.
   - **ITSP**: Choose your provider.

   Once you pick the template, the matching connection settings appear automatically in the **Detailed Configuration** section. What you do next depends on the trunk type shown there:

   - **Register Trunk**: supply the credentials your ITSP gave you:
     - **Username**: The username from your ITSP.
     - **Password**: The password from your ITSP.
     - **Authentication Name**: Optional. Used for SIP authentication. Enter it only if your ITSP issued an authentication name.
   - **Peer Trunk**: leave the settings at their defaults.

   :::note
   The template decides the trunk type for you, so you don't choose it yourself. A **Register Trunk** logs in to the provider with a username and password (much like signing in to an account). A **Peer Trunk** is trusted by its network address instead, so no login credentials are needed.
   :::

   :::caution
   The username, password, and authentication name must match exactly what the ITSP issued, including capitalization. A single mismatch stops the trunk from registering and it will stay offline. If you were not given a value, leave that field as the template set it.
   :::

3. Optional: If you bought DID numbers from the ITSP, open the **DIDs/DDIs** tab to attach them to the trunk. A DID (Direct Inward Dialing) number, also written DDI (Direct Dialing In), is a public phone number that outside callers dial to reach you.

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

   a. Click **Add** and enter the numbers you need:

      - **To add one number**, set **Create Method** to **Single DID**, then complete:
        - **DID/DDI**: The DID number your provider assigned.
        - **DID/DDI Name**: Optional. A label that identifies inbound calls arriving on this number. When the number is dialed, this name shows on the called party's device.
      - **To add a block of numbers**, set **Create Method** to **DID Range**, then complete:
        - **DID Range**: The first and last number in the range.
        - **DID/DDI Name**: Optional. A label that identifies inbound calls arriving on these numbers. When a number is dialed, this name shows on the called party's device.

   b. Click **Confirm**.

   :::tip
   For a fuller explanation of DID options, see [Configure DID Numbers on a Trunk](/pbx/administrator-guide/configure-did-numbers-on-a-trunk/).
   :::

4. Click **Save**, then **Apply**.

   :::note
   Your changes are only staged until you click **Apply**. Nothing takes effect on the live system until you apply them.
   :::

## Check the result

Return to **Extension and Trunk > Trunk** and look at the trunk's status in the list.

A green status icon ![Registered trunk indicator](/images/pbx/trunk-ok.png) means the trunk registered successfully.

For details on what each state means, see [SIP Trunk status](/pbx/administrator-guide/sip-trunk-overview/#concept_kzd_png_tdb__section_b1z_1ft_wpb).

## Next steps

- To take inbound calls over this 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 this trunk, assign it to one or more outbound routes. See [Set up an Outbound Route](/pbx/administrator-guide/set-up-an-outbound-route/).
