# Connect Cloud Voice and a TG400 Gateway

A TG400 gateway is a four-channel 4G (fourth-generation mobile) VoIP (Voice over Internet Protocol) gateway. Pairing it with your Cloud Voice PBX (Private Branch Exchange, your phone system) lets you route calls over mobile carrier networks, giving the PBX up to four cellular (4G) trunks. A trunk is a line that carries calls between your PBX and an outside network. You build the link in two halves: an **account trunk** on the PBX and a matching **register trunk** on the gateway. The two sides talk over SIP (Session Initiation Protocol, the signaling used to set up calls). The gateway registers to the PBX using the account trunk's credentials.

## Requirements

Your Cloud Voice PBX must be running version 84.10.0.30 or later.

## Step 1. Create an account trunk on the PBX

1. Sign in to the Cloud Voice PBX portal and go to **Extension and Trunk > Trunk**, then click **Add**.
2. Fill in the trunk settings:

   ![Account trunk form with the trunk type, transport, and credential fields filled in](/images/pbx/sip-account-trunk-tg400.png)

   - **Name**: A label that helps you recognize the trunk, such as `TG400`.
   - **Trunk Status**: Choose **Enabled**.
   - **Select ITSP Template**: Choose **General**. (ITSP means Internet Telephony Service Provider; the template applies a set of provider defaults, and **General** works for this gateway.)
   - **Trunk Type**: Choose **Account Trunk**.
   - **Transport**: Choose **UDP** (User Datagram Protocol, the transport SIP uses here).
   - **Username**: Set a username for the trunk.
   - **Password**: Set a password to go with that username.
   - **Use User Name as Account Trunk's Authentication Name**: Turn this on so the username also serves as the authentication name.

   :::note
   The username you enter here is treated as the trunk number. You will need both the username and password again when you configure the gateway, so keep them handy.
   :::

3. Click **Save**, then **Apply**.

## Step 2. Create a register trunk on the gateway

1. Sign in to the gateway's web interface and go to **Gateway > VoIP Settings > VoIP Trunk**, then click **Add VoIP Trunk**.
2. In the dialog that opens, enter the trunk settings:

   ![Register trunk dialog on the gateway with the PBX domain and account credentials entered](/images/pbx/tg400-register-trunk-cloud.png)

   - **Trunk Type**: Choose **Register Trunk**.
   - **Type**: Choose **SIP**.
   - **Provider Name**: A label that helps you recognize the trunk.
   - **Hostname/IP**: Your Cloud Voice PBX domain followed by its SIP port, for example `pbx.example.izt.company` and the default SIP port `5060`.
   - **Domain**: Your Cloud Voice PBX domain, for example `pbx.example.izt.company`.
   - **User Name**: The username you set on the account trunk in Step 1, for example `6700`.
   - **Authorization Name**: The same username from the account trunk, for example `6700`.
   - **Password**: The password you set on the account trunk in Step 1.

   :::caution
   The **User Name**, **Authorization Name**, and **Password** on the gateway must match the account trunk from Step 1 exactly, and the **Hostname/IP** and **Domain** must point at the correct PBX domain and SIP port. If any value differs, the gateway will not register and no calls will pass over the trunk.
   :::

3. Click **Save**, then **Apply Changes**.

## Confirm the connection

Once both sides are saved, check that the trunk has come up:

- On the PBX portal, open **Extension and Trunk > Trunk**. The trunk's status shows a connected icon ![Connected trunk indicator](/images/pbx/trunk-ok.png).

  ![PBX trunk list showing the gateway trunk in a connected state](/images/pbx/pce-trunk-status(tg400).png)

- On the gateway, open **Status > System Status > Trunk Status**. The trunk reads **Registered**.

  
  ![Cloud Voice, gateway trunk status page showing the trunk registered](/images/pbx/tg400-trunk-status-ce.png)

When both statuses look right, the PBX and gateway are linked, and four 4G trunks are now available on your Cloud Voice PBX.

## What to do next

- To place outbound calls over a specific 4G trunk, see [Make Outbound Calls through a Designated 4G Trunk](/pbx/integrations/cloud-voice-tg/make-outbound-alls-through-a-designated-4g-trunk/).
- To send inbound calls from each carrier to its own destination, see [Route Calls from Different Carriers to Different Destinations](/pbx/integrations/cloud-voice-tg/route-calls-from-different-carriers-to-different-destinations/).
