# Auto Provision IP Phones Remotely with Proxy

An Onsite Proxy lets you provision several IP phones at a remote site without exposing them to the public internet. Instead of each phone reaching Cloud Voice directly, the proxy sits in the phones' local subnet and carries provisioning and registration traffic through an encrypted tunnel. This page walks through auto provisioning for both PnP (Plug and Play) and Non-PnP phones, and shows how to assign a user extension to each device.

:::note
The steps below provision a phone and bind a specific user's extension to it. To configure a shared phone for hot desking instead, see [Set up a Hot Desking Phone](/pbx/administrator-guide/set-up-a-hot-desking-phone/).
:::

## Requirement

Your Cloud Voice system must be running firmware version `84.23.0.24` or later.

## Auto provision PnP IP phones

When a phone supports PnP provisioning, an Onsite Proxy in the same subnet finds it automatically. The proxy detects the phone, reports its details back to the PBX (Private Branch Exchange, your hosted Cloud Voice phone system), and passes the SIP (Session Initiation Protocol) NOTIFY message, which carries the provisioning link, from the PBX down to the phone.

The phone then pulls its configuration file from the server named in that link and sends its extension registration request back through the Onsite Proxy, which relays it to the PBX to finish registration.

The example below uses a Yealink SIP-T53W running firmware 96.86.0.81 to illustrate PnP provisioning through an Onsite Proxy.

### Prerequisites

- An Onsite Proxy is deployed in the **same** subnet as the phone and is connected to the PBX. See [Onsite Proxy Overview](/pbx/administrator-guide/onsite-proxy-overview/).
- The phone is on the list of models supported for auto provisioning. See [Auto Provisioning - Supported Devices](/pbx/administrator-guide/cloud-auto-provisioning-supported-devices/).
- The phone supports PnP provisioning.
- You have downloaded the provisioning template for the phone model, at **Auto Provisioning > Resource Repository > Default Templates**. See [Update a Default Auto Provisioning Template](/pbx/administrator-guide/update-a-default-auto-provisioning-template/).

### Procedure

1. If the phone has been used before, reset it to factory defaults.

   :::danger
   A factory reset erases everything on the phone, including its current configuration and any registered account, and it cannot be undone. It also drops any call the phone is on. Only reset a phone you are certain is safe to wipe.
   :::
2. Sign in to your Cloud Voice management portal and open **Auto Provisioning > Phones**.

   Every phone the Onsite Proxy has discovered appears in the list, along with its MAC (Media Access Control) address, IP address, vendor, and model.

   :::note
   If a phone is missing from the list, restart it and check again.
   :::

   ![Discovered IP phones listed on the auto provisioning page](/images/pbx/pnp-detect-via-onsite-proxy.png)
3. Click the edit icon ![Edit](/images/pbx/edit.png) next to the phone you want to provision.
4. Under **Options**, pick a template from the **Template** drop-down list.

   :::note
   The template supplies every setting except the extension assignment. Choose the default template that matches the phone model, or build your own. See [Create a Custom Auto Provisioning Template](/pbx/administrator-guide/create-a-custom-auto-provisioning-template/).
   :::
5. Under **Assign Extension**, choose the extension to register on the phone.

   :::tip
   If the extension you want is not in the list, it may already be tied to another phone or gateway. You can either:
   - Free it from the current device, see [Release an Extension from a Provisioned IP Phone/Gateway](/pbx/administrator-guide/release-an-extension-from-a-provisioned-ip-phone-or-gateway/).
   - Register the same extension on more than one phone, see [Allow Multiple Registrations for One Extension Number](/pbx/administrator-guide/allow-multiple-registrations-for-one-extension-number/).
   :::
6. Click **Save**.
7. Restart the phone.

### Result

- The template settings are applied to the phone automatically.
- The extension registers on the phone through the Onsite Proxy. You can confirm the registration state on **Auto Provisioning > Phones**:
  - ![Registered](/images/pbx/registered.png) The assigned extension is registered on the phone.
  - ![Unregistered](/images/pbx/unassigned.png) The assigned extension is not registered on the phone.

  ![Provisioned PnP phone showing its registration status](/images/pbx/provisioned-phones-pnp-via-onsite-proxy.png)

## Auto provision Non-PnP phones

Phones that do not support PnP can't be discovered automatically, so you add them to the PBX by hand and then publish the provisioning link where the phones can reach it.

Once the link is reachable, each phone downloads its configuration file from the server named in the link, and the Onsite Proxy in its subnet relays the extension registration request to the PBX.

The example below uses a Grandstream GHP621W running firmware 1.0.1.71, provisioned through an Onsite Proxy together with a DHCP (Dynamic Host Configuration Protocol) server.

### Prerequisites

- An Onsite Proxy is deployed in the **same** subnet as the phone and is connected to the PBX. See [Onsite Proxy Overview](/pbx/administrator-guide/onsite-proxy-overview/).
- The phone is on the list of models supported for auto provisioning. See [Auto Provisioning - Supported Devices](/pbx/administrator-guide/cloud-auto-provisioning-supported-devices/).
- You have the phone's vendor, model, and MAC address.
- You have downloaded the provisioning template for the phone model, at **Auto Provisioning > Resource Repository > Default Templates**. See [Update a Default Auto Provisioning Template](/pbx/administrator-guide/update-a-default-auto-provisioning-template/).

The process has two parts:

- [Step 1. Generate a configuration file for the phone on the PBX](#step-1-generate-a-configuration-file-for-the-phone-on-the-pbx)
- [Step 2. Make the configuration file reachable by the phone](#step-2-make-the-configuration-file-reachable-by-the-phone)

### Step 1. Generate a configuration file for the phone on the PBX

1. If the phone has been used before, reset it to factory defaults.

   :::danger
   A factory reset erases everything on the phone, including its current configuration and any registered account, and it cannot be undone. It also drops any call the phone is on. Only reset a phone you are certain is safe to wipe.
   :::
2. Sign in to your Cloud Voice management portal and open **Auto Provisioning > Phones**.
3. Click **Add** to create a new phone entry.
4. Under **IP Phone**, enter the device details:
   - **Vendor**: Select the phone's vendor.
   - **Model**: Select the phone's model.
   - **MAC Address**: Enter the phone's MAC address.
5. Under **Options**, configure the following:
   - **Template**: Select a template from the drop-down list.

     :::note
     The template supplies every setting except the extension assignment. Choose the default template that matches the phone model, or build your own. See [Create a Custom Auto Provisioning Template](/pbx/administrator-guide/create-a-custom-auto-provisioning-template/).
     :::
   - **Provisioning Link**: A provisioning server URL is generated for you and shown on the page.

     :::note
     Copy this provisioning link somewhere handy, you'll need it in Step 2.
     :::
   - **Register via Onsite Proxy**: Select the checkbox.
   - **Onsite Proxy**: Select the Onsite Proxy that serves the phone's subnet.
6. Under **Assign Extension**, choose the extension to register on the phone.

   :::tip
   If the extension you want is not in the list, it may already be tied to another phone or gateway. You can either:
   - Free it from the current device, see [Release an Extension from a Provisioned IP Phone/Gateway](/pbx/administrator-guide/release-an-extension-from-a-provisioned-ip-phone-or-gateway/).
   - Register the same extension on more than one phone, see [Allow Multiple Registrations for One Extension Number](/pbx/administrator-guide/allow-multiple-registrations-for-one-extension-number/).
   :::
7. Click **Save**.

### Step 2. Make the configuration file reachable by the phone

Set up a DHCP server on the phone's network and point DHCP option 66 at the provisioning link. The steps below use the Tftpd32 DHCP server as an example.

:::note
DHCP is the recommended way to distribute the provisioning link when you have several phones. For a single phone, you can type the link directly into the phone instead.
:::

:::caution
Only turn on this DHCP server if the network does not already have one. Two DHCP servers on the same subnet hand out conflicting addresses and can knock other devices offline. If the network already runs DHCP, add option 66 to that existing server rather than starting Tftpd32's.
:::

1. Launch [Tftpd32](https://pjo2.github.io/tftpd64/) and click **Settings** at the bottom of the window.

   ![Tftpd32 main window with the Settings button](/images/pbx/dhcp-tftpd32-settings.png)
2. In the window that opens, go to the **GLOBAL** tab and select the **DHCP Server** checkbox.

   ![Enabling the DHCP Server option on the GLOBAL tab](/images/pbx/dhcp-tftpd32-select-dhcp-server.png)
3. Go to the **DHCP** tab and set the server parameters.

   ![DHCP tab with the address pool and option settings](/images/pbx/dhcp-tftpd32-dhcp-settings-cloud.png)
   - **IP pool start address**: The first IP address to hand out.
   - **Size of pool**: How many addresses are available.
   - **Lease time**: How long each address stays assigned.
   - **Def. Router (Opt 3)**: The gateway IP address.
   - **Mask (Opt 1)**: The subnet mask for the address range.
   - **DNS Server (Opt 6)**: The DNS (Domain Name System) server address.
   - **Additional Option**: Set the option number to `66` and paste the PBX provisioning link from Step 1 next to it.
4. Click **OK**.
5. Restart the phone.

### Result

- The phone receives an IP address and the provisioning link from the DHCP server, then downloads its configuration file from that link to complete auto provisioning.
- The extension registers on the phone through the Onsite Proxy. You can confirm the registration state on **Auto Provisioning > Phones**:
  - ![Registered](/images/pbx/registered.png) The assigned extension is registered on the phone.
  - ![Unregistered](/images/pbx/unassigned.png) The assigned extension is not registered on the phone.

  ![Provisioned Non-PnP phone showing its registration status](/images/pbx/provisioned-phones-no-pnp-via-onsite-proxy.png)
