# Receive Inbound Calls through the Extended E1/T1/PRI Trunk

Once your Cloud Voice TE100 gateway is linked to Cloud Voice, incoming calls arriving on the extended E1/T1/PRI trunk still need somewhere to go. An E1, T1, or PRI trunk is a digital phone line from your carrier that carries many voice channels at once (E1 carries 30 channels, T1 carries up to 23, and PRI, short for Primary Rate Interface, is the ISDN signaling that runs over either). This page walks through the two inbound routes that carry those calls from the gateway into Cloud Voice and on to the correct extension.

:::note
The TE100 is a gateway: it sits between your carrier's physical E1/T1/PRI line and Cloud Voice, converting the carrier's digital trunk signaling into SIP (Session Initiation Protocol), the protocol Cloud Voice uses to carry calls over the network. That is why the calls have to pass through two routes: one on the gateway, one on Cloud Voice.
:::

## Scenario

Suppose your E1 provider has assigned you two Direct Inward Dialing (DID) numbers, `505525301` and `505525302`. A DID is a public phone number that routes straight to a specific internal extension. You want each one to reach a dedicated extension: `505525301` to extension `2001`, and `505525302` to extension `2002`. With the routes in place, a caller who dials a DID number lands directly on the matching extension.

![Cloud Voice, call flow from an E1 provider through the TE100 gateway to Cloud Voice extensions](/images/pbx/te-gateway+p-series-receive-calls-ce.png)

You will build this in three parts: an inbound route on the gateway, a matching inbound route on Cloud Voice, and a test call to confirm the path works.

## Step 1: Add an inbound route on the TE100 gateway

Start on the gateway, where you tell it to forward calls arriving on the E1/T1/PRI trunk over to Cloud Voice.

1. Sign in to the gateway web interface and go to **Gateway > Route Settings > Route List**, then click **Add New Route**.
2. Fill in the route in the dialog that appears:
   - **Simple Mode**: Choose **No**. Simple Mode hides the DID matching fields, and you need those fields to map the DID numbers, so leave it off.
   - **Route Name**: Give the route a recognizable name.
   - **Call Comes in From**: Pick the E1/T1/PRI trunk that receives the calls. This example uses **Trunk--E1Trunk1**.
   - **DID Number**: The number the gateway matches against incoming calls. Enter `505525301-505525302` here.
   - **DID Associated Number**: Set this to the same range, `505525301-505525302` in this example.
   - **Send Call Through**: Select the SIP trunk that connects to Cloud Voice. This example uses **Trunk - PCE**.

   :::tip
   Name the route after what it does (for example, include the trunk name or the DID range). A descriptive name saves you time when you have several routes to scan through later.
   :::

   :::caution
   The **DID Number** and **DID Associated Number** on the gateway must exactly match the Direct Outward Dialing (DOD) number set on the matching Cloud Voice trunk. DOD is the caller ID that Cloud Voice presents when it sends calls out over this trunk. If the two ends do not match, the gateway cannot line the call up with the right route and inbound calls will fail.
   :::

   ![TE100 gateway inbound route matching the DID range and forwarding over the SIP trunk to Cloud Voice](/images/pbx/te100-to-ce-route.png)
3. Click **Save**, then **Apply Changes**.

## Step 2: Add an inbound route on Cloud Voice

Next, create a matching route in Cloud Voice so the system accepts the calls handed off by the gateway.

1. Sign in to the Cloud Voice portal and go to **Call Control > Inbound Route**, then click **Add**.
2. Configure the following, and leave everything else at its default value:
   - **Name**: Enter a name that identifies the route.
   - **DID Pattern**:
     - **DID Matching Mode**: Select **Match DID Range to Extension Range**.
     - **DID Range**: Enter the first and last numbers of the range. In this example, enter `505525301` and `505525302`.

       :::note
       **Match DID Range to Extension Range** maps the two ranges to each other in order: the first DID goes to the first extension, the second DID to the second, and so on. Here `505525301` reaches `2001` and `505525302` reaches `2002`.
       :::

       ![DID range mapped to an extension range in the Cloud Voice inbound route](/images/pbx/match-did-to-extension.png)
   - **Trunk**: Choose the SIP trunk that connects to the TE100 gateway. This example uses **Connect-to-TE100-Gateway**.

     ![Selecting the SIP trunk connected to the TE100 gateway on the Cloud Voice inbound route](/images/pbx/p-cloud-edition-outbound-route-te100.png)
   - **Default Destination**: Select **Match Extension Range** and enter the range `2001` - `2002`.

     :::caution
     The DID range and the extension range must hold the same count of numbers so they can line up one to one. If the ranges are different sizes, some DIDs will have no extension to ring and those calls will not connect.
     :::

     ![Inbound route destination set to match the extension range 2001 to 2002](/images/pbx/p550-inbound-route-destination.png)
3. Click **Save**, then **Apply**.

## Step 3: Place a test call

Confirm the routing end to end. For example, call `505525301`, extension `2001` should ring.

:::tip
If the extension does not ring, check that the DID number on the gateway matches the DOD number on Cloud Voice, and that both routes point at the correct SIP trunk. A mismatch on either side is the most common reason inbound calls stop at the gateway.
:::
