# Connect Two Cloud Voice Systems

You can join two separate Cloud Voice systems so their extensions can reach each other, for example to connect a headquarters site with a branch office. This page walks through the SIP (Session Initiation Protocol) trunk pairing that establishes the link, using each system's fully qualified domain name (FQDN) to locate the far end. A trunk is simply the signaling path that carries calls between the two systems.

The connection is built from two matched trunks. One system publishes an **Account Trunk** that acts as the registration host, and the other system points a **Register Trunk** at that host and signs in. In the example below, the headquarters system hosts the Account Trunk and the branch system registers to it.

| System | What to create |
| --- | --- |
| Headquarters Cloud Voice | An Account Trunk |
| Branch Cloud Voice | A Register Trunk |

:::note
The two trunks are two halves of one link. The Account Trunk defines the login (username, password, and authentication name) that the far end will use. The Register Trunk uses that same login to sign in and reach the host. Build the Account Trunk first, then the Register Trunk.
:::

## Create the Account Trunk on the headquarters system

1. Sign in to the PBX (private branch exchange) web portal of the headquarters system and go to **Extension and Trunk > Trunk**.
2. Click **Add** to start a new trunk.
3. Under **Basic**, set the following:

   ![The Basic section of a new trunk with name, status, and template fields](/images/pbx/account-trunk-for-p570.png)

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

   :::note
   ITSP stands for Internet Telephony Service Provider. The template pre-fills settings for a specific carrier. Because you are connecting to another Cloud Voice system rather than an outside carrier, **General** is the correct choice.
   :::

4. Under **Detailed Configuration**, define the account the branch system will use to register:

   ![Detailed trunk settings including type, transport, and account credentials](/images/pbx/account-trunk-for-p570-detail.png)

   - **Trunk Type**: Choose **Account Trunk**.
   - **Transport**: Choose **UDP** (User Datagram Protocol).
   - **Username**: Set a username for the trunk.

     :::note
     The username also serves as the trunk number.
     :::

   - **Password**: Set a password to go with the username.
   - **Authentication Name**: Set the authentication name the branch system will use when it registers.

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

Note the username, password, authentication name, and transport you entered here. You will re-enter the same values on the branch system in the next section.

## Create the Register Trunk on the branch system

1. Sign in to the PBX web portal of the branch system and go to **Extension and Trunk > Trunk**.
2. Click **Add** to start a new trunk.
3. Under **Basic**, set the following:

   ![The Basic section of a new trunk with name, status, and template fields](/images/pbx/register-to-p-cloud.png)

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

4. Under **Detailed Configuration**, point the trunk at the headquarters system:

   ![Detailed trunk settings for a register trunk with hostname, port, and credentials](/images/pbx/register-trunk-to-p-cloud.png)

   - **Trunk Type**: Choose **Register Trunk**.
   - **Transport**: Choose **UDP**.
   - **Hostname/IP**: The FQDN of the headquarters system, for example `hq.example.com`.
   - **Port**: The SIP registration port of the headquarters system, typically `5060`.
   - **Domain**: The FQDN of the headquarters system again, for example `hq.example.com`.
   - **Username**: The username you set on the headquarters Account Trunk.
   - **Password**: The password you set on the headquarters Account Trunk.
   - **Authentication Name**: The authentication name you set on the headquarters Account Trunk.

   :::caution
   The **Transport**, **Username**, **Password**, and **Authentication Name** must match exactly what you set on the headquarters Account Trunk, and these values are case-sensitive. A single mismatch stops the trunk from registering and blocks every call between the two systems.
   :::

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

## Confirm the connection

Once both trunks are applied, check that they have come up on each system. A healthy trunk shows a green status indicator (![Trunk connected indicator](/images/pbx/trunk-ok.png)).

- On the headquarters portal, go to **Extension and Trunk > Trunk** and review the Account Trunk's status.

  ![The trunk list on the headquarters system showing the account trunk connected](/images/pbx/account-trunk-for-p570-ce.png)

- On the branch portal, go to **Extension and Trunk > Trunk** and review the Register Trunk's status.

  
  ![Cloud Voice, the trunk list on the branch system showing the register trunk connected](/images/pbx/register-to-pcloud-ce.png)

:::tip
If a trunk does not turn green, confirm that the headquarters FQDN resolves to the correct address (a DNS, or Domain Name System, check) and that the SIP port (5060 by default) is reachable through any firewall between the two systems. Then re-check that the credentials and transport match on both ends.
:::

## Next steps

The trunk only carries the link between the systems. To let extensions place calls across it, add routes on each system:

- [Set up communication from headquarters to branch](/pbx/integrations/cloud-voice/set-up-communication-from-headquarters-pbx-to-branch-pbx/)
- [Set up communication from branch to headquarters](/pbx/integrations/cloud-voice/set-up-communication-from-branch-pbx-to-headquarters-pbx/)
