# Auto Provision LDAP for IP Phones

LDAP (Lightweight Directory Access Protocol) is a standard way for a device to look up contacts in a shared directory over the network. Instead of programming the LDAP directory into each handset by hand, you can deliver the settings to your supported IP phones (network-connected desk phones) through Auto Provisioning. Auto Provisioning pushes configuration to the phone for you, so once the phone reprovisions, users can search the shared contacts stored on your Cloud Voice PBX straight from the device.

## Supported IP phones

The steps below apply to the models listed in [Auto Provisioning - Supported Devices](/pbx/administrator-guide/cloud-auto-provisioning-supported-devices/).

## Prerequisites

Before you begin, confirm the following:

- Your PBX is running version **84.6.0.24** or later.
- You have [set up the PBX as an LDAP server](/pbx/administrator-guide/set-up-pbx-as-an-ldap-server/). This is where the phone reads its contacts from, so it must exist before Auto Provisioning has anything to point the phone at.
- The phone is already connected to Cloud Voice through Auto Provisioning and has an extension assigned. For details, see [Auto Provision IP Phones Remotely via RPS Method](/pbx/administrator-guide/auto-provision-ip-phones-remotely-rps-method/) or [Auto Provision IP Phones Remotely with Proxy](/pbx/administrator-guide/auto-provision-ip-phones-remotely-with-proxy/).

## Procedure

1. Sign in to the PBX web portal and go to **Auto Provisioning > Phones**, then click the edit icon ![Edit a provisioned phone](/images/pbx/wizard-previous.png) next to the phone you want to configure.

2. On the **Phone** tab, scroll to the **LDAP Directory** section and configure the fields to suit your directory.

   ![LDAP Directory settings for a provisioned phone](/images/pbx/cloud-autop-ldap.png)

   | Setting | Description | Example |
   |---------|-------------|---------|
   | Enable LDAP Directory | Turn the LDAP directory feature on or off. | Enable |
   | Directory Name | A name for the LDAP directory. | PBX_Contacts |
   | LDAP Server Address | The LDAP server address of your Cloud Voice PBX. Use the address shown on your PBX LDAP server page. | example.proxy1.cloudvoice.example.com |
   | LDAP Mode | The connection mode between the LDAP server and the phone. LDAPs is the encrypted version (LDAP over TLS). | LDAPs |
   | LDAP Name Filter | Name attributes used when the phone looks up a contact by name. | `(\|(displayName=%)(givenName=%)(sn=%)(mail=%)(company=%))` |
   | LDAP Number Filter | Number attributes used when the phone searches by number. | `(\|(telephoneNumber=%)(mobile=%)(homePhone=%)(facsimileTelephoneNumber=%))` |
   | LDAP Name Attributes | Name attributes each record returns. Separate multiple attributes with a space. | displayName |
   | LDAP Number Attributes | Number attributes each record returns. You can list more than one. | telephoneNumber mobile homePhone |
   | LDAP Display Name | The name shown for each record on the phone's screen. | %displayName |
   | Max Number of Search Results | The maximum number of results the server returns. | 50 |
   | LDAP Lookup for Incoming Call | Whether the phone runs an LDAP search when a call comes in. | Enabled |
   | LDAP Lookup for Callout | Whether the phone runs an LDAP search when placing a call. | Enabled |
   | LDAP Sorting Results | Whether the phone sorts results in alphabetical and numerical order. | Enabled |

   :::note
   - In the **LDAP Name Filter** and **LDAP Number Filter** fields, `*` matches any character and `%` represents the string a user types, used as the prefix of the filter condition.
   - The **LDAP Display Name** value must begin with the `%` symbol.
   :::

   :::caution
   Set **LDAP Mode** to the same mode your PBX LDAP server is configured to accept. If the phone uses LDAPs but the server only offers plain LDAP (or the reverse), directory lookups will fail. Prefer **LDAPs** where both ends support it so contact data is encrypted in transit rather than sent in clear text.
   :::

3. Click **Save**. The page returns to **Auto Provisioning > Phones**.

4. Click the reprovision icon ![Reprovision the phone](/images/pbx/refresh.png) beside the phone to push the new settings.

   :::caution
   Reprovisioning applies the new configuration to the phone and can briefly take it offline. Do it when the phone is idle so you do not interrupt a call in progress.
   :::

5. In the confirmation dialog, click **OK**.

## Result

Users can now search the shared directory directly on the phone under **Menu > Directory**.

![Directory contacts displayed on the phone](/images/pbx/autop-phone-directory.png)
