# Restrict Outbound Calls by PIN Codes

Attaching a PIN (Personal Identification Number) to an outbound route stops outbound calls from being placed until the caller supplies a valid code. This gives you a simple way to keep external calling reserved for the people who should have it, and to see afterward who placed each call. You can guard a route with one shared code or with a list of codes handed out to individual users.

:::tip
Pick codes that are hard to guess, and give each person their own instead of one shared code. Weak or widely shared PINs undermine the protection and can expose you to toll fraud (someone running up charges by placing unauthorized long-distance or international calls).
:::

## Guard a route with a single PIN code

When you want to limit an outbound route to a particular team or set of employees, assign it one PIN code. Anyone who knows the code can dial out through the route; everyone else is blocked.

1. In the PBX web portal, open **Call Control > Outbound Route**.
2. Click the edit icon ![Edit](/images/pbx/edit.png) next to the route you want to protect.
3. Scroll to the **Trunk** section and configure the password:

   ![Selecting Single PIN and entering a code in the outbound route's Trunk section](/images/pbx/set-a-single-pin-code.png)

   a. From the **Outbound Route Password** drop-down, choose **Single PIN**.

   b. In the **Single PIN** field, type the code you want to use.

   :::note
   A PIN code must contain digits only and be between 3 and 15 characters long.
   :::
4. Click **Save**, then **Apply**.

Once the route is saved, callers are prompted for the code whenever they dial an external number through it.

:::caution
If a caller enters the wrong code three times in a row, the system hangs up the call automatically.
:::

The code used on each call also appears in the call detail records (CDRs, the log of every call the system handles), so you can confirm the route was used with authorization. Find them under **Reports and Recordings > CDR**.

:::note
The **PIN Code** column is not shown by default, enable it in the CDR view first.
:::

![Enabling the PIN Code column in the CDR display settings](/images/pbx/show-pincode-in-cdr.png)

![A CDR entry showing the single PIN code used for an outbound call](/images/pbx/single-cdr-with-pin-code.png)

For a walk-through of what a caller experiences, see [Usage example](#usage-example).

## Guard a route with a PIN list

Sometimes several people share one extension number across different devices to place outbound calls. A single shared code can't tell them apart in your records. Instead, build a list of PIN codes, give each person their own, and attach the list to the route. Everyone can dial out, and each call is stamped with the individual code that placed it.

### Step 1: Create a PIN list

1. In the PBX web portal, open **Call Features > PIN List** and click **Add**.
2. Fill in the dialog that opens:

   ![Creating a PIN list with a name, codes, and CDR recording enabled](/images/pbx/record-pin-codes-in-cdr.png)

   | Setting | Description |
   |---------|-------------|
   | **Name** | A label that helps you recognize the list later. |
   | **PIN List** | The codes themselves. Press **Enter** after each code to add another. Codes must be numeric and between 3 and 15 characters. |
   | **Record in CDR** | Turn this on so the code used on each call is written to the call detail records. |
3. Click **Save**.

### Step 2: Attach the list to an outbound route

1. In the PBX web portal, open **Call Control > Outbound Route**.
2. Click the edit icon ![Edit](/images/pbx/edit.png) next to the route you want to protect.
3. Scroll to the **Trunk** section and configure the password:

   ![Selecting PIN List and choosing a saved list in the outbound route's Trunk section](/images/pbx/set-pin-list.png)

   a. From the **Outbound Route Password** drop-down, choose **PIN List**.

   b. From the **PIN List** drop-down, pick the list you created.
4. Click **Save**, then **Apply**.

Now callers must enter one of the codes from the assigned list to dial out through the route. Because each person uses their own code, you can tell their calls apart in the CDR even when they share an extension. Find the records under **Reports and Recordings > CDR**.

:::note
The **PIN Code** column is not shown by default, enable it in the CDR view first.
:::

![Enabling the PIN Code column in the CDR display settings](/images/pbx/show-pincode-in-cdr.png)

![A CDR list distinguishing outbound calls by the individual PIN codes used](/images/pbx/cdr-with-pin-code.png)

## Usage example

Here is how placing a call through a PIN-protected route plays out for the caller:

1. Extension 2000 dials an external number.
2. The caller hears the prompt "Please enter your password followed by the pound key," enters a PIN code, and presses `#`.
   - If the code is valid, the call goes out through the outbound route.
   - If the code is wrong, the caller hears "password incorrect" and is asked to try again. After three failed attempts, the system ends the call.
