Phone directory (LDAP)
Desk phones can search the company directory from the phone: by name while dialling, and by number when a call comes in, so the display shows who is calling. MonoPbx serves that directory itself over LDAP, and puts the settings, with a login of the phone's own, in every provisioned phone's file. Nothing has to be typed on the phones.
The directory holds:
- the company's people who have an extension (name, extension, job title, department, e-mail when you allow it, and the mobile number when its owner lets colleagues see it: see the Directory's mobile visibility);
- the company phonebook (Contacts > Company phonebook): name, company, number, mobile, e-mail.
Work e-mail addresses are not served unless you switch on Show work e-mail on phones (see below).
Not in the directory: people hidden from the directory, disabled accounts, disabled extensions and everyone's personal contacts. A phone only ever sees its own company. A person's mobile number is shown only when its owner shares it with colleagues.
Which phones use it, and how they get the settings, is in What the phone gets on the desk phone page.
On by default
The phone directory is on by default: every company has it on from the start, and each provisioned desk phone gets the directory settings, with a login of its own, in its file at its next download. Nothing has to be switched on or typed on the phones. This holds when the server runs the directory, which needs a TLS certificate (see below), and TCP port 636 must be reachable from the phones to the PBX (see Ports and encryption); without it phones show the directory but cannot connect.
Companies that had never saved these settings before the directory became the default were switched on with it; a company whose administrator had saved the directory off stays off. Plain LDAP stays off and work e-mail stays hidden until you allow them.
Change the settings
- Open Admin, then People and devices > Devices and phones > Desk phones (
/admin/phones). - Under Phone directory (LDAP), untick Desk phones search the phone directory to turn the directory off for the company (it is ticked by default). Choose whether phones look callers up on incoming calls and suggest names while dialling.
- Tick Show work e-mail on phones only if the phones should display e-mail addresses. It is off by default: until you switch it on, no entry carries a
mailattribute and a search onmailfinds nothing, so an address cannot be read or guessed from a phone. - Click Save. Each phone picks the settings up at its next download of its file (at reboot, or at its periodic check).
The panel also shows the company's base DN (ou=<company handle>,dc=mpbx) and the port phones use. If it says the server runs no phone directory, the server has no TLS certificate yet: see Certificates.
Changes to Show work e-mail on phones reach phones within half a minute, like the other directory data.
Turning the directory off refuses the phones' logins within half a minute; their files stop carrying the settings at the next download.
How fast changes show. The server keeps a successful login and the list of entries for about 30 seconds. A new colleague, a changed number or a person hidden from the directory appears on the phones within about half a minute, with no action on the phone.
Per-phone logins
Every provisioned phone gets its own directory login when it first downloads its file with the directory on: a bind DN like cn=phone-1a2b3c4d5e6f7a8b,ou=acme,dc=mpbx and a long random password. The PBX stores only a hash of the password and an encrypted copy for the phone's file; the login is never shown in the console, and a preview of the file shows ******** instead.
- Provision the phone again (new address and SIP password) and the phone also gets a new directory login at its next download; the old one stops working.
- Revoking or deleting the device, disabling its owner or removing its provisioning ends the login.
- Anonymous logins are always refused, and a login works only for its own company.
DECT bases
A DECT base has one directory login for the whole base, shared by all its handsets. It is made when the base first downloads its file with the directory on, stored the same way as a phone's (a hash and an encrypted copy), and is never shown in the console.
- Issue the base's URL again without "keep URL" and the base gets a new login at its next download; the old one stops working. Issuing it with "keep URL" keeps the login.
- Deleting the base ends its login. Turning the directory off refuses it within half a minute and removes the settings from the base's file.
- The company's settings apply to bases as to phones: plain LDAP only when allowed, work e-mail only when shown, and the incoming-call and dialling lookups where the base has them.
Ports and encryption
| Port | Protocol | Use | Default |
|---|---|---|---|
| 636 | TCP, LDAPS (TLS from the first byte) | The phone directory | On whenever the server has a TLS certificate. Inside a container the server listens on 10636 and the installer publishes it as 636. |
| set by you | TCP, plain LDAP | The phone directory for phones without LDAPS | Off |
LDAPS uses the same certificate as the web console (on Kubernetes, where TLS ends at the ingress, a certificate Secret is mounted instead: see Install on Kubernetes), so phones that check certificates need the name they fetch their files from to be covered by it. Allow inbound TCP 636 from the phones' networks in your firewall (see Network requirements); the port does not need to be open to the internet unless remote phones use the directory. An upgrade never opens it for you: when a release adds 636 to the default ports, the upgrade check lists it as a new default port, and you allow it if the directory is used.
Old phones and TLS
LDAPS offers TLS 1.3 and TLS 1.2 with the modern (AEAD) cipher suites. Certificates issued automatically use an ECDSA key, which some older desk phones cannot use. For them:
- An RSA certificate. Certificates issued automatically (ACME) come with an RSA 2048 twin for the same names, chained to ISRG Root X1 (see RSA certificate for old phones; on by default). With an uploaded certificate, upload an RSA certificate for the same name under Certificates, or set one for LDAPS with
tls_rsa_cert_filebelow. A phone that cannot take ECDSA (it lists no ECDSA signature algorithm, or it offers only RSA cipher suites in TLS 1.2) gets the RSA certificate; every other client keeps the ECDSA one. The same choice is made for SIP over TLS and for HTTPS provisioning. - The root. The RSA certificate chains to ISRG Root X1, which old firmware may also lack: when the provisioning check still reports
root_needs_firmware, update the phone's firmware. - Firmware. Phones that speak only TLS 1.0/1.1, SSLv3 or CBC-only cipher suites cannot use LDAPS: update their firmware, or use plain LDAP as below.
Every LDAPS connection that fails before the phone logs in is written to the server log (phone directory: TLS handshake failed, with the reason, the name the phone asked for and what it offered) and to the phone's provisioning log (Desk phones, the phone's log, or TLS handshake failures not tied to one phone with the source Phone directory (LDAPS)). Typical reasons:
| Reason in the log | Meaning | What to do |
|---|---|---|
plain_ldap_on_ldaps_port | The phone sent plain LDAP to port 636: its firmware ignores the LDAPS setting, or it is set to StartTLS | Set the phone's LDAP mode to LDAPS (Yealink ldap.tls_mode = 2), update its firmware, or use plain LDAP. The phone gets an LDAP notice saying the port is LDAPS. |
bad_client_hello | Not a TLS 1.2/1.3 hello: the phone speaks only an old TLS or SSL version | Update the phone's firmware, or use plain LDAP. |
handshake with ecdsa=false | The phone cannot use an ECDSA certificate and the server had no RSA certificate for the name | Check that the RSA twin is issued (Certificates, the certificate's RSA certificate for old phones), or upload an RSA certificate for the name (see above). |
handshake with an UnknownCA / BadCertificate alert | The phone does not trust the certificate's issuer | Update the phone's firmware (its list of trusted roots), or give it the root certificate. |
Plain LDAP (old phones)
Some older phones only speak plain LDAP. An operator can open a plain LDAP port in the server configuration, and an administrator then ticks Also allow plain LDAP (unencrypted) for the company.
Over plain LDAP, names, numbers and the phone's directory password cross the network unencrypted. Allow it only for phones that cannot use LDAPS, and only on a trusted network. A company that does not allow plain LDAP is refused on that port even with a valid login.
The built-in templates always use LDAPS. To point an old phone at the plain port, edit its vendor template: {{ldap.plain_port}} holds the plain port when the company allows it.
Server settings
Operators set the listeners and limits in the [ldap] section of the configuration (or MPBX__LDAP__* variables):
[ldap]
enabled = true # run the directory (each company still turns it on)
listen_tls = "0.0.0.0:636" # LDAPS; unset: 636, or 10636 when 636 cannot be used
listen_plain = "0.0.0.0:10389" # plain LDAP; unset: off
tls_cert_file = "/etc/mpbx/ldaps/tls.crt" # LDAPS certificate (PEM chain) from a file; with tls_key_file,
tls_key_file = "/etc/mpbx/ldaps/tls.key" # both or none. Unset: the server's certificate store. Re-read when changed.
tls_rsa_cert_file = "/etc/mpbx/ldaps/rsa.crt" # an RSA certificate (PEM chain) for phones that cannot use ECDSA;
tls_rsa_key_file = "/etc/mpbx/ldaps/rsa.key" # with tls_rsa_cert_file, both or none. Re-read when changed.
public_tls_port = 636 # the port phones are told, when a NAT or container maps it
public_plain_port = 389
max_size = 100 # entries per search
searches_per_minute = 120 # per phone, after a burst of `search_burst` (30)
max_connections = 512
max_per_address = 16
idle_timeout_secs = 120
What phones can search
The directory answers LDAP version 3 (and version 2) searches with simple bind. Entries are inetOrgPerson entries below the company's base DN with these attributes:
| Attribute | People | Company phonebook |
|---|---|---|
cn, displayName | name | name |
givenName, sn | first and last name | first and last name |
telephoneNumber | extension | number |
ipPhone | extension | - |
mobile | mobile (when visible to colleagues) | mobile |
mail | e-mail (only when Show work e-mail on phones is on) | e-mail (same) |
title, department (ou) | job title, department | - |
company (o) | - | company |
Names match without regard to case. Numbers match without regard to spaces, dashes, dots and brackets, so (telephoneNumber=*5512345678) finds +52 55 1234 5678. The built-in templates use these filters (% is what the user typed or the caller's number):
- name:
(|(cn=*%*)(sn=%*)(givenName=%*)) - number:
(|(telephoneNumber=*%)(mobile=*%)(ipPhone=%))
A search returns at most 100 entries (fewer when the phone asks for fewer); phones that page their searches can read up to 2,000. A phone that searches very fast is slowed down, and an address that fails to log in repeatedly is refused for a minute.
Phones
| Vendor | Name search | Incoming-call lookup | Notes |
|---|---|---|---|
| Yealink (T4x, T5x) | Yes | Yes | ldap.* settings, LDAPS (ldap.tls_mode = 2). |
| Fanvil (X series) | Yes | Yes | LDAP1 ... settings; names vary by firmware, check them on your model. |
| Snom (D3xx, D7xx) | Yes | Yes | ldap_* settings with ldap_over_tls. |
| Grandstream (GXP, GRP) | Yes | Yes | P8020 to P8037; connection mode LDAPS (P8037 = 1). |
| Cisco multiplatform (6800, 7800, 8800) | Yes, under Directories | Not set by the template | ldaps:// server address with simple authentication. |
| Poly (VVX, Edge E) | Yes, corporate directory | Yes (caller ID lookup) | dir.corp.* settings with an ldaps:// address. |
| Htek (UC8xx, UC9xx) | Yes | Yes | Yealink-like ldap.* settings. |
| Yealink W-series DECT bases (W60B, W70B, W80B, W90) | Yes, on every handset | Yes | The desk phone's ldap.* settings, once for the base. Not the W52P. |
| Gigaset N670, N870, N870E DECT bases | Yes, on every handset | Not set by the file | LDAPDir.0.* and Netdir.0.Activated; every handset uses directory 1 with the base's login. Not the N510. |
The Snom M-series, Cisco IP DECT and Grandstream DP75x bases do not get the directory yet; they use the company phonebook. See DECT bases.
Every setting of the built-in templates can be changed under Desk phones > Templates (variables ldap.host, ldap.port, ldap.url, ldap.base_dn, ldap.bind_dn, ldap.password, ldap.max_hits, ldap.tls_code, ldap.plain_port; flags ldap, ldap_tls, ldap_incoming_lookup, ldap_dial_lookup). Phones with old firmware may not support TLS 1.2 or ECDSA certificates: see Old phones and TLS.
Common problems
| What you see | Why | What to do |
|---|---|---|
| The phone shows no directory | The directory is off for the company, or the phone has not downloaded its file since it was turned on | Turn it on and reboot the phone. |
| "Connection failed" on the phone | Port 636 is closed between the phone and the PBX, or the phone does not trust the certificate | Open TCP 636 from the phones' network; use a certificate the phone trusts. |
| The directory entry shows but stays empty | The phone could not connect (see the server log line phone directory: TLS handshake failed and Old phones and TLS), or it searches only once you type | Type a few letters of a name; check the phone's provisioning log for an LDAPS failure. No log line at all means the phone never reached port 636 (firewall or NAT). |
| Login refused after re-provisioning | The phone still has its old file | Reboot the phone so it downloads the new file. |
| Plain LDAP refused | The company does not allow plain LDAP | Tick Also allow plain LDAP (see the warning above) or use LDAPS. |
| The phone connects but finds nobody | The person is hidden, disabled or has no extension; a personal contact is never in the directory | Check the person and extension in the console. A change takes up to 30 seconds. |
| A colleague's mobile number is missing | Its owner does not share it with colleagues | Ask the owner to share it (the Directory's mobile visibility). |
| A search shows only part of the people | One search returns at most 100 entries | Type more of the name, or use the incoming-call lookup by number. |
| The certificate is refused | The name the phone connects to is not covered by the server certificate, or the phone does not trust its issuer | Run the certificate check in Diagnostics on the phone, see Certificates and HTTPS. |
See also Desk phone provisioning and Network requirements (port 636). Error codes of the server side and the LDAP result codes phones get: Phone directory error codes.