Project

General

Profile

Readme 0100 » History » Version 2

Jörg Ebeling, 03/31/2025 10:55 PM

1 1 Jörg Ebeling
<a id="readme-top"></a>
2
3
# LDAP-2-CardDAV Phone Book Gateway (l2cpbg)
4
5
An LDAP to CardDav (1 way read) Phone Book Gateway.
6
![Functional L2CPBG Diagram](https://projects.shbe.net/attachments/download/163/L2CPBG%200.9.5%20Diagram.svg "Functional L2CPBG Diagram")
7
8
## Use case
9
10
Most modern (business) voice phones have the capability to do
11
comfortable LDAP directory look-up like:
12
13
-   Directory search by alphabet letters
14
-   Reverse lookup for in- or out-bound calls
15
-   Reverse lookup by entering parts or the phone number
16
17
Unfortunately, most of the 'smaller' companies (i guess companies beyond
18
100 employee) don't have an 'enterprise' LDAP directory, much less than
19
private persons.
20
21
Most of such companies do have something like a cloud address book,
22
often based on WebDAV / CardDAV (i.e. Nextcloud, Ownlcoud, Baïkal,
23
Daylite, Synology Contacts, ...).
24
25
This is, where this Gateway might make your live easier.
26
27
If this program (daemon/service) get started on some kind of hardware (Windows, macOS, Linux, Raspberry or the like), it will do the following:
28
29
1.  Synchronize your CardDAV Server(s), to a small local database cache
30
2.  Wait and answer for LDAP requests from your voice/desktop phone(s)
31
32
<p align="right">(<a href="#readme-top">back to top</a>)</p>
33
34
## Features
35
36
-   Query the contacts of your CardDAV address book(s) by entering
37
    the alphabetic letters (or parts of the telephone number) in your (LDAP capable) phone (and dial one of the matching numbers)
38
-   Reverse lookup inbound calls and display matching contact
39
    informations on the phone
40
-   Work with local formatted (non- E.164) entered phone numbers
41
    like: '040-123456' or '001 807 1234567' as well as '+49 (0)40
42
    1234567-8', so that there's no need to format the phone numbers of your CardDAV contacts in a special notation
43
-   Supports short internal extension phone numbers as well as Fritz!Box specific **\<extension> or *\<line> format
44
-   Support dial prefix for external line
45
-   Support selection of a specific address book per phone, via "ou=\<address book>, \<BaseDN>"
46
-   Support the merge of multiple address books from a single or multiple CardDAV Server(s) into a specified LDAP address book
47
48
<p align="right">(<a href="#readme-top">back to top</a>)</p>
49
50
## Usage
51
52
You need some kind of 24/7 machine where this gateway live. Windows PC,
53
Linux, macOS, Raspberry or the like.
54
55
By default it will look for a configuration file in the following places (in the
56
given order):
57
58
1.  ./l2cpbg.conf
59
2.  /etc/l2cpbg.conf
60
3.  /usr/local/etc/l2cpbg.conf
61
4.  \<exec directory\>/l2cpbg.conf
62
63
It will write to a small local database directory (defaults to 'os.TempDir()/l2cpbg.db').
64
65
At the moment there's no "Admin GUI". But for miminimal infos like "uptime", "license", "number of search requests", "number of sent result records", as well as immediate CardDAV-Server sync trigger, you might send the l2cpbg process a `SIGHUP` signal and check the logs afterwards.
66
67
You might be also interested in the output of `l2cpbg --help`.
68
69
<p align="right">(<a href="#readme-top">back to top</a>)</p>
70
71
## License
72
73
On-Premise, one-time fee
74
75
| Version | max. phones [^1] | Version blaming in Phone Display | max. LDAP requests/h | max. phonebook entries [^2] | Gold features [^3] | Price/€ [^4] |
76
|:----------|:---------:|:--:|:---------:|:---------:|:---:|-------:|
77
|Free       | 2         | ✓  | 12        | 100       | ✗   |   0,00 |
78
|Max3       | 3         | ✗  | unlimited | 500       | ✗   |  29,00 |
79
|Max5       | 5         | ✗  | unlimited | 1000      | ✗   |  49,00 |
80
|Max10      | 10        | ✗  | unlimited | 2000      | ✗   |  79,00 |
81
|Pro10      | 10        | ✗  | unlimited | unlimited | ✓   | 149,00 |
82
|Pro50      | 50        | ✗  | unlimited | unlimited | ✓   | 299,00 |
83
|Enterprise | unlimited | ✗  | unlimited | unlimited | ✓   | 499,00 |
84
85
[^1]: Every device/phone which successful login to L2CPBG, lock a phone-slot (via IP) for 8 hours
86
87
[^2]: In real, the number of imported CardDAV contacts get limited
88
89
[^3]: Gold features are: Multi-instance capability, Multi-CardDAV Servers (or accounts), Multi-AddressBook-Merge
90
91
[^4]: Inkl. German VAT
92
93
Before deciding to buy a license, please ensure that L2CPBG work as expected with all your phones and your CardDAV server. If you can't test it because of a free limitations, or any other reason, don't hesitate to ask for a 60 day evaluation license. Simply drop me a mail to projects@shbe.net with your real name.
94
95
<p align="right">(<a href="#readme-top">back to top</a>)</p>
96
97
## Installation
98
99
### Linux
100
101
#### Debian ".deb" packages
102
103
`dpkg -i l2cpbg_<version>_<architecture>.deb` to install the package.
104
105
- A sample configuration get places at `/etc/l2cpbg.conf`.  
106
- Initial startup will fail due to wrong/missing settings in config section `[dav]`!  
107
- Adapt at least `[ldap]`, `[ldap.bind]`, `[dav]` as well as `[location]` sections (in /etc/l2cpbg.conf) to your need.
108
- Once done, restart l2cpbg by `systemctrl restart l2cpbg` and check startup by `systemctrl status l2cpbg`.  
109
- The full log can be read by `journalctl -u l2cpbg`.  
110
- To watch the actual/live logging, use `journalctl -fu l2cpbg`.
111
112
If l2cpbg started up, adapt your phone(s) to point their "LDAP Directory" lookup requests to l2cpbg with the settings you defined in /etc/l2cpbg.conf.
113
114
#### Linux binary "tar.gz" packages ("systemd" Systems)
115
116
1. Extract binary i.e. to /usr/local/bin: `sudo tar xvf l2cpbg_0.9.2_linux-amd64.tgz -C /usr/local/bin/ l2cpbg`
117
2. Extract config file, i.e. to /etc: `sudo tar xvf l2cpbg_0.9.2_linux-amd64.tgz -C /etc/ l2cpbg.conf`
118
3. Adapt config section `[ldap]`, `[ldap.bind]`, `[dav]` as well as `[location]` to your need.
119
4. Do a first foreground start via `l2cpbg` and check terminal output for any issues. \<Ctrl-c\>, edit config and start `l2cpbg` till terminal output is okay.
120
5. If terminal output is okay and everything work as expected. \<Ctrl-c\> to stop forground process.
121
6. Install L2CPBG as service/daemon via `sudo l2cpbg --service=install`. You should see a single "... 'install' succeed" message.
122
7. Now that L2CPBG got installed as a service/daemon you can use `sudo systemctrl start|stop|restart l2cpbg`. When booting next, L2CPBG should get started automatically and log output to systemd journal.
123
8. The full log can be read by `journalctl -u l2cpbg`.  
124
9. To watch the actual/live logging, use `journalctl -fu l2cpbg`.
125
126
Adapt your phone(s) to point their "LDAP Directory" lookup requests to l2cpbg with the settings you defined in /etc/l2cpbg.conf.
127
128
Uninstalling the service/daemon is simply done by `sudo l2cpbg --service=uninstall`
129
130
#### Linux binary "tar.gz" packages ("SysV" Systems)
131
132
1. Extract binary i.e. to /usr/local/bin: `sudo tar xvf l2cpbg_0.9.2_linux-amd64.tgz -C /usr/local/bin/ l2cpbg`
133
2. Extract config file, i.e. to /etc: `sudo tar xvf l2cpbg_0.9.2_linux-amd64.tgz -C /etc/ l2cpbg.conf`
134
3. Adapt config section `[ldap]`, `[ldap.bind]`, `[dav]` as well as `[location]` to your need.
135
4. Do a first foreground start via `l2cpbg` and check terminal output for any issues. \<Ctrl-c\>, edit config and start `l2cpbg` till terminal output is okay.
136
5. If terminal output is okay and everything work as expected. \<Ctrl-c\> to stop forground process.
137
6. Install L2CPBG as service/daemon via `sudo l2cpbg --service=install`. You should see a single "... 'install' succeed" message.
138
7. Now that L2CPBG got installed as a service/daemon you can use `sudo service l2cpbg start|stop|restart`. When booting next time, L2CPBG should get started automatically and log output get send to /var/log/l2cpbg.err|log.
139
140
Adapt your phone(s) to point their "LDAP Directory" lookup requests to l2cpbg with the settings you defined in /etc/l2cpbg.conf.
141
142
Uninstalling the service/daemon is simply done by `sudo l2cpbg --service=uninstall`
143
144
<p align="right">(<a href="#readme-top">back to top</a>)</p>
145
146
### macOS
147
148
#### Important macOS upgrade info:
149
If you already have l2cpbg versiom 0.9.2 installed, you need to deactivate your old l2cpbg instance via `l2cpbg --service=stop` and `l2cpbg --service=uninstall`, **before** installing the new version. After installing the new version, activate it again (via `l2cpbg --service=install` and `l2cpbg --service=start`)
150
151
#### MacOS "pkg" package ("launchd" System)
152
153
The package (pkg) installer does the following:
154
155
- Extract the L2CPBG package to '/opt/l2cpbg'.
156
- Place a l2cpbg command symlink into '/usr/local/bin' (which is in PATH), so that you're able to call the gateway binary 'l2cpbg' independent of your working directory.
157
- A sample l2cpbg configuration file get places in `/usr/local/etc/l2cpbg.conf`.
158
159
After installation, initial startup would fail due to wrong/missing settings in config section `[dav]`!
160
161
1. Change into installation directory via `cd /opt/l2cpbg`
162
2. Edit config by opening '/usr/local/etc/l2cpbg.conf' i.e. with TextEdit `open -a TextEdit /usr/local/etc/l2cpbg.conf`
163
3. Adapt at least `[ldap]`, `[ldap.bind]`, `[dav]` as well as your `[location]` sections to your need.  When done, don't forget to save!
164
4. Do a first foreground start via `l2cpbg` in Terminal, and check terminal output for any issues. \<Ctrl-c\> (abort l2cpbg), edit config and start `l2cpbg` again, till terminal output is okay.
165
5. If terminal output is okay and everything work as expected. \<Ctrl-c\> (abort l2cpbg) to stop forground process.
166
6. Install L2CPBG as service/daemon via `sudo l2cpbg --service=install`. You should see a single "... 'install' succeed" message.
167
7. Now that L2CPBG got installed as a service/daemon you can use `sudo l2cpbg --service=start|stop|restart`. When booting next time, L2CPBG should get started automatically and log output is send to /var/log/l2cpbg.err.log.
168
169
Adapt your phone(s) to point their "LDAP Directory" lookup requests to l2cpbg with the settings you defined in /usr/local/etc/l2cpbg.conf.
170
171
Uninstalling the service/daemon is simply done by `sudo /opt/l2cpbg/l2cpbg --service=uninstall`
172
173
Uninstalling the whole package is done by `sudo /opt/l2cpbg/uninstall.sh`
174
175
<p align="right">(<a href="#readme-top">back to top</a>)</p>
176
177
### Windows
178
179
#### Binary "zip" packages
180
181
1. Extract content of zip package to your preferred location, i.e. `C:\Program Files\LDAP2CardDAV-Gateway`. Take attention that the 32-bit version should be installted (by convention) somewhere under `C:\Program Files (x86)`!
182
2. Run "notepad" as Administrator, open `C:\Program Files\LDAP2CardDAV-Gateway\l2cpbg.conf` within Notepad, and adapt config section `[ldap]`, `[ldap.bind]`, `[dav]` as well as `[location]` to your need. When done, don't forget to save!
183
3. Now it's time to try a first start of the Gateway. Run a "Command" shell as Administrator and change to the installation directory, i.e. `cd C:\Program Files\LDAP2CardDAV-Gateway`, start it in foreground by `l2cpbg.exe` and check terminal output for any issues. \<Ctrl-c\>, edit config and start `l2cpbg.exe` till terminal output is okay.
184
4. If terminal output is okay and everything (your phones) work as expected. \<Ctrl-c\> to stop forground process.
185
5. Install L2CPBG as service/daemon via `l2cpbg.exe --service=install`. You should see a single "... 'install' succeed" message.
186
7. Now that L2CPBG got installed as a service you can use `l2cpbg.exe --service=start|stop|restart`. After 'start'ed as service, log entries can be viewed by Windows Event Viewer (eventvwr). When booting next time, L2CPBG should get started automatically.
187
188
Uninstalling the service/daemon is simply done by `l2cpbg.exe --service=uninstall`
189
190
<p align="right">(<a href="#readme-top">back to top</a>)</p>
191
192 2 Jörg Ebeling
### Synology Containerization
193
194
Please see [Synology Containerization Guide for L2CPBG](https://projects.shbe.net/projects/l2cpbg/wiki/Synology_Containerization)
195
196
<p align="right">(<a href="#readme-top">back to top</a>)</p>
197
198
199 1 Jörg Ebeling
## Configfile syntax
200
201
Since version 0.9.0 the config file syntax has changed from 'ini' to 'toml'. Not a big deal, but you need to adapt some entries. Mainly strings have to be entered within quotes!
202
203
Following a quick minimal sample:
204
```
205
# Comments get started with a hash character
206
207
#
208
# The Gateway will act as LDAP Server, listening
209
# for requests from your phone(s).
210
#
211
[ldap]
212
  host      = "0.0.0.0"
213
  #port     = 1389
214
  base      = "dc=example, dc=com"
215
216
[ldap.bind]
217
  dn   = "cn=pbx"
218
  pass = "your-password"
219
220
#
221
# Your CardDAV server where this Gateway get the contacts from
222
#
223
[dav]
224
  server       = "https://cloudserver.example.com/remote.php/dav"
225
  user         = "cloud-login-name"
226
  pass         = "cloud-login-password"
227
  #pass         = "[AES256]encrypted-cloud-login-password" # Please see command line option '--encryptPassword'
228
229
[location]
230
  int           = 1     # Your international code. 1 = US, 49 = Germany, ...
231
  area          = 807   # Your local area code (without a leading 0)
232
  maxarealength = 7
233
  country       = "EN"
234
```
235
236
### Config file description (by section)
237
238
#### \[ldap\] = LDAP Server settings
239
240
`host` : Which IP to listen for LDAP requests. Defaults to "0.0.0.0" = 'Listen on all interfaces'. You've to point your LDAP phone settings to this machines IP/hostname.
241
242
`port` : Which port to listen for LDAP requests. Defaults to port 1389. The standard LDAP port is 389, so you need to change your phone to the port you configure here.
243
244
`base` : This LDAP's 'base DN'. Choose whatever you want, but use the same settings within your phone's LDAP settings. Defaults to 'dc=example, dc=com'.
245
246
#### \[ldap.bind\] = LDAP bind/auth settings
247
248
`dn` : Distinguish name. Name, how the phone has to log into/authorize
249
to the gateway.
250
251
`pass` : Related 'dn' password, a phone has to use when logging in/authorize to the gateway.
252
253
#### \[dav\] or \[dav.xxx\]= WebDav/CardDav server settings
254
255
`server` : Your WebDAV/CardDAV server address/URL. Please see 'Limitations'!
256
257
`user` : WebDav username with read access to the relevant address book which shall be requested for phone book lookups. Might also be a 'shared' address book.
258
259
`pass` : Related user password. If you don't like to store your CardDAV-Server password in clear-text here, you've also the possibility to use the AES-256 encrypted variant of the password here. Please check l2cpbg's command line option `--encryptPassword` (see `l2cpbg --help`). If you already stored the encrypted password variant here, you can also check/validate it with command line option `--testDavPassword`.
260
261
`addressbooks` : Optional regular expression string of matchable address book(s)
262
used for phone book lookups. If unsure, enter something. l2cpbg will log
263
all found address books of the logged in CardDav user during startup and
264
log them as 'Non-matching' or 'Matching' address book(s).
265
266
`mergeas` : Optional multi CardDAV/account feature.<br>
267
Merge the configured CardDAV server section as 'ou=\<mergeas string\>' LDAP organization unit.<br>
268
With this option you've the possibility to merge multiple CardDAV server or accounts either into a single 'merged' LDAP address book, or in separate ones. However you like.<br>
269
When importing them into separate ones, you've the possibility to choose them within you phone's BaseDN option.<br>
270
By this you've i.e. the possibility to import a company wide phone book, as well as a (or multiple) private one(s).<br>
271
If this parameter is not given, LDAP attribute 'ou' get set to the name of the CardDAV address book.<br>
272
This feature is only useful when configuring multiple CardDAV server or accounts, which in turn requires a gold feature license (Pro or Enterprise).
273
274
`ldapattribute` give you the possibility to add one static LDAP 'attribute=value' pair, for each contact of the related address book (where this option is used).<br>
275
By this you've to possibility to give specific DAV server contacts, specific LDAP attributes with values like "headquarter", "houston", "baltimore", ... or even "finance", "sales", ...<br>
276
Later on, you can use this attribute within your phone's name-/number-filter to select only specific branches.
277
278
`syncinterval` : Interval of CardDav sync checks. Given as string with suffix 'm' for minutes, or 'h' as hours. Has to be greater than "2m".
279
280
`chunksize` : If an address book get loaded the first time, it get loaded in "chunks of contacts" in this given size. You may increase this value for quicker initial load, but if your CardDAV server answer with an "507 Insufficient Storage" error or similar, you need to lower this value. Default to 200. This option was added in L2CPBG version 0.8.1.
281
282
`insecurecert` controls whether a client verifies the server's certificate
283
chain and host name. If insecurecert is true, crypto/tls accepts any
284
certificate presented by the server and any host name in that certificate.
285
In this mode, TLS is susceptible to machine-in-the-middle attacks unless
286
custom verification is used. This should be used only for testing or in
287
trusted environments. Defaults to *false*. This option was added in L2CPBG version 0.9.1.
288
289
#### \[location\] = Local area settings
290
291
`int` : International area code (1 = North America, ..., 44 = United
292
Kingdom, 49 = Germany, ...) of your location.
293
294
`area` : Local area code without leading 0 (20 = London (UK), 40 =
295
Hamburg (DE), ...).
296
297
`areaPrefix` : Dial prefix for national calls. Mostly "0". Defaults to "0".
298
ATTENTION: Has to be entered as string like "0". 
299
300
`maxarealength` : Longest possible length of a telephone number within
301
your local area. If a CardDAV or incoming number is shorter or equal, it's
302
identified as a number within your local area.
303
304
`country` : Two-letter [ISO 3166-1 alpha-2](https://wikipedia.org/wiki/ISO_3166-1_alpha-2) country code (i.e. US, GB, DE, ...).
305
306
`maxintlength` : Maximum length of internal phone numbers. These numbers
307
don't get harmonized or E.164 converted as well as they don't get a possibly configured extdialprefix
308
309
`prettifyNums` : By default phone numbers loaded from CardDAV get prettified in two ways:
310
At first, if a CardDAV number is stored in international format, but you live in the same country, the international part get removed.
311
At second, the number get formatted in (spaced or braced) number groups as it's common in your country.
312
You can disable this prettifying by setting the value to false.
313
314
`prettifyNoAreaInSameArea` : Strip local area code from destination number when located in same area. Boolean true|false, defaults to true.
315
316
`prettifyRemoveSpaces` : Boolean (true|false) which will remove all spaces from a prettified phone number. Defaults to false.
317
318
`extdialprefix` : Optional external dial prefix for getting an external line. Get prefixed before the phone number for outgoing number length \> `maxintlength`
319
320
#### [log] = Logging
321
322
`level` : Log level. Might be one of "trace", "debug", "info", "warn", "error" or "fatal". Defaults to "info".
323
324
The log levels are organized as follows:
325
326
`trace` : This is the most verbose log level. It logs simply everything.
327
Never use it in production environment as it might produce an awful amount of log entries!
328
When started as Windows-Service, 'trace' messages doesn't get send to windows event console.
329
330
`debug` : Logs a lot internal stuff, probably interesting when searching
331
a solution for an issue. Should not be used in production environment as
332
it produce also a lot log entries!
333
When started as Windows-Service, 'debug' messages doesn't get send to windows event console.
334
335
`info` : This is the most usual log level. Logs only stuff which is relevant.
336
337
`warn` : Logs stuff which doesn't behave as expected. Not critical (generic functionality should be okay) but should be noticed/checked.
338
339
`error` : Something essential/critical happened. Functionality is limited or aborted at all.
340
341
`fatal` : Game over.
342
343
#### [db] = Internal database
344
345
`directory` : An own directory where to store the internal database. Defaults to
346
'os.TempDir()/l2cpbg.db' which is not very useful on Linux based systems as it normally get cleaned after each reboot.
347
348
Choose yourself where to store the database.
349
If you've a small CardDAV server with <= 200 contacts, let the DB in the default location.
350
An initial sync of 200 contacts (after a reboot) will be quickly done.
351
Not much storage space is needed. An CardDAV server with approx. 4 thousand contacts, take about 10 MByte storage.
352
353
ATTENTION: If you use one of the .deb packages, the binary get started as user=l2cpbg.
354
Thus, the given directory, manually need to made owned by l2cpbg via
355
`chown -R l2cpbg:l2cpbg /your/db/directory`! Otherwise the DB process will fail on missing read/write permissions!
356
357
#### [ldap.map...] = LDAP/CardDav mapping
358
359
Every LDAP attribute which is used within a phone(s) filter or response, need to have a corresponding CardDav mapping which get done as follows:
360
361
First you need to define a separate block for the LDAP attribute in the following syntax: `[ldap.map.<ldap attribute name (case sensitive)>]`
362
Within such a LDAP mapping block you have to define:
363
364
`dav` : Corresponding CardDav field/attribute name.
365
366
and optional define the following settings:
367
368
`itypes` : Case insensitive regular expression (RE2 syntax) of including relevant CardDav types or *Apple address book label* (Apple Adressbook extension: X-ABLabel).
369
370
`etypes` : Case insensitive regular expression (RE2 syntax) of **excluding** relevant CardDav types or *Apple address book label* (Apple Adressbook extension: X-ABLabel).
371
372
`index` : Zero based index in the case of a multi-value CardDav field.
373
374
For an overview of the predefined/default LDAP/CardDav mappings, take a
375
look into 'l2cpbg.sample.conf' file.
376
377
<p align="right">(<a href="#readme-top">back to top</a>)</p>
378
379
## Phone configuration
380
381
### Gigaset
382
383
Here's a configuration sample of a Gigaset N510 IP PRO:
384
![Gigaset N510 IP PRO settings sample for L2CPBG 0.7.0](https://projects.shbe.net/attachments/download/19/config_gigaset-n510-ip-pro_v070_de.jpg "Gigaset N510 IP PRO settings sample for L2CPBG 0.7.0")
385
Take attention that 'Server Address' point to the machine where this gateway lives (as well as 'Serverport')
386
387
'BaseDN', 'Common User Name' and 'Common Password' get filled with the same values as defined in your L2CPG config file.
388
389
<p align="right">(<a href="#readme-top">back to top</a>)</p>
390
391
### Mitel (Aastra)
392
393
At first, you need to know that Mitel's LDAP implementation is a little bit different than the one from the other phones.
394
While the other phones always do a live request to the LDAP server when searching for a contact or phone number,
395
Mitel does 36 initial "give me all contacts" for "sn=0*, 1*, ..., a*, b*, ..., z*" once it boot, or during configured schedule (but not more often than once a day?!).
396
397
So, once Mitel loaded all contacts, it handles all searches internally. Also reverse-lookup searches for incoming calls get handled internally.
398
This in turn means, that most of L2CPBG's number prettyfying might disturb i.e. Mitels reverse lookup logic.
399
Because of this, you better should disable the relevant prettyfying via L2CPBG's config entries:
400
```shell
401
[location]
402
  prettifyNoAreaInSameArea = false
403
  prettifyRemoveSpaces = true
404
```
405
This will result in more ugly phone numbers within the directory, but probably give better results for Mitel-internal reverse lookup searches.
406
407
Next:
408
409
Mitel's LDAP directory configuration can't be done within the Phone's or Web GUI. 
410
Instead of, it need to be done within the provisioning file(s) startup.cfg, \<model\>.cfg and/or \<MAC\>.cfg (please check your Mitel documentation how to provision).
411
412
Following the required Mitel provisioning entries, based on L2CPBG's default config.
413
Don't forget to adapt if you changed these within your L2CPBG's config:
414
415
```shell
416
# General LDAP Settings:
417
ldap enabled: 1
418
ldap name: CardDAV
419
ldap server: cn=phone:your-password@<L2CPBG's IP>:1389
420
ldap base dn: dc=example, dc=com
421
ldap search scope: subtree
422
423
# Reverse Lookup:
424
# For best results, use num of local phone number digit + number of area code digits, but not higher than 9
425
# Example:
426
#   You complete local phone number is: +49 8421 12345
427
#   Your local phone number is 5 nums long + area code length is 4 = 9
428
directory digits match: 9
429
430
# LDAP Attribute definitions
431
# (required because they seem to have no defaults)
432
ldap cn attribute: cn
433
ldap first name attribute list: givenName
434
ldap last name attribute list: sn
435
ldap company attribute list: company
436
ldap job title attribute list: title
437
ldap business street attribute list: street
438
ldap business city attribute list: l
439
ldap business state attribute list: st
440
ldap business postal code attribute list: postalCode
441
ldap business country attribute list: c
442
ldap home street attribute list: homeStreet
443
ldap home city attribute list: homeCity
444
ldap home state attribute list: homeState
445
ldap home postal code attribute list: homePostalCode
446
ldap home country attribute list: homeCountry
447
ldap business phone 1 attribute list: telephoneNumber
448
ldap home phone 1 attribute list: homePhone
449
ldap mobile phone attribute list: mobile
450
ldap business fax attribute list: facsimileTelephoneNumber
451
ldap email 1 attribute list: mail
452
ldap email 2 attribute list: homeMail
453
```
454
Reboot your phone and when it seem to be ready, wait further 2 to 3 minutes till it start to request all LDAP Addresses from L2CPBG's LDAP Server (see L2CPBG's log, journal or event messaages).
455
456
Go to the phone's web GUI and define a 'Directory' key (Left menue: Operation / Softkeys and XML)
457
458
<p align="right">(<a href="#readme-top">back to top</a>)</p>
459
460
### Snom
461
462
Contributed by Fredy:
463
464
```
465
==== Konfiguration Snom Telefonapparate D315, D335 ====
466
467
=== Advanced / Network - Abschnitt LDAP ===
468
469
^ Option                          ^ Einstellung                                                                 ^
470
471
| LDAP Name Filter                | (&(|(telephoneNumber=*)(mobile=*))(|(sn=*%*)(givenName=*%*)(company=*%*)))  |
472
| LDAP Number Filter              | (|(telephoneNumber=%)(mobile=%)(homePhone=%))                               |
473
| LDAP Name Filter During Call    | (&(|(telephoneNumber=*)(mobile=*))(|(sn=*%*)(givenName=*%*)(company=*%*)))  |
474
| LDAP Number Filter During Call  | (|(telephoneNumber=%)(mobile=%)(homePhone=%))                               |
475
| Server Address                  | <Hostname or IP of your L2CPBG>                                             |
476
| Port                            | 1389                                                                        |
477
| Base                            | dc=example, dc=com                                                          |
478
| Username                        | cn=pbx                                                                      |
479
| Password                        | <same as in config>                                                         |
480
| LDAP Name Attributes            | cn sn givenName company                                                     |
481
| LDAP Number Attributes          | telephoneNumber mobile homePhone                                            |
482
| LDAP Display Name               | %givenName %company                                                         |
483
| Country Code                    | (leave empty)                                                               |
484
| Area code                       | (leave empty)                                                               |
485
| LDAP over TLS                   | off                                                                         |
486
| Initial Query                   | on                                                                          |
487
| LDAP Sort Mode                  | None                                                                        |
488
| LDAP Sort Parameters            | (leave empty)                                                               |
489
490
=== Advanced / Behaviour - Abschnitt Phone Behavior ===
491
492
^ Option                   ^ Einstellung            ^
493
494
| Prioritise Asserted      | off                    |
495
| Contact Source Priority  | Ldap Tbook Sip Memory  |
496
```
497
498
<p align="right">(<a href="#readme-top">back to top</a>)</p>
499
500
### Yealink
501
502
Another configuration sample of a Yealink SIP-T52S:
503
![Yealink SIP-T52S settings sample for L2CPBG 0.7.0](https://projects.shbe.net/attachments/download/18/config_yealink-t52s_fw7084_v070_en.jpg "Yealink SIP-T52S settings sample for L2CPBG 0.7.0")
504
Take attention that 'Server Address' point to the machine where this gateway lives (as well as 'Port').
505
506
'Base', 'User Name' and 'Password' get filled with the same values as defined in your L2CPG config file.
507
508
<p align="right">(<a href="#readme-top">back to top</a>)</p>
509
510
## Special / Gold features
511
512
### Multi-Instances (Pro or Evaluation license required)
513
514
There might be special configuration requirements like different CardDAV Server/Phonebook combinations/permissions, or multi-locations requirements which can't yet configured in L2CPBG.
515
516
For such special cases, you might start multiple L2CPBG instances. Each with his own configuration or even with the more comfortable merge/overlay configuration loading.
517
518
Imagine: You already have a standard instance running, like described within the [Installation](https://projects.shbe.net/projects/l2cpbg/wiki/Readme_093#Installation) section. But now you've a special requirement like a office branch (which has access through your office VPN to your L2CPBG server) for which you need other [location] settings.
519
520
`--instance-suffix` functionality might solve this for you!
521
522
Do the following to configure and install a new instance:
523
524
1. We need to give the new instance some kind of meaningfull name. In the following we decide for 'foo'
525
2. Copy your l2cpbg.conf file (as described in [Installation](https://projects.shbe.net/projects/l2cpbg/wiki/Readme_093#Installation)) to l2cpbg-foo.conf, and open it in notepad (or whichever editor your prefer
526
3. Change the [ldap] port to a free port. I.e. from 1389 to 1390
527
4. If you have configured a [db] directory, give the new instance a separate (and exclusive) db directoy. If you don't have a configured [db] directory entry, you can leave it as it is. By default the db get stored at OS.Tempdir()/l2cpbg-\<instance-suffix\>.db
528
5. Change the configuration stuff why you where interested in a separate instance.
529
6. Test your new configuration in foreground (the same way as you did during the normal instance installation see [Installation](https://projects.shbe.net/projects/l2cpbg/wiki/Readme_093#Installation), but with '--config' option pointing to your new instance configuration.
530
7. Once the configuration is good, you can call `l2cpbg.exe --instance-suffix=foo --service=start|stop|restart` like during normal install (except the additional parameter --instance-suffix=foo)
531
532
When dealing with the configuration of multi-instances, you will heavily benefit from L2CPBG's possibility to do merge/overlay config loading, which is not more than loading each subsequent config on top of the previous one. 
533
By this you'll have i.e. your main configuration in l2cpbg.conf whereas your l2cpbg-foo.conf contains only the two or three config changes you're interested in. Then, by adding `--config=<your config directory>/l2cpbg.conf,<your config directory>/l2cpbg-foo.conf` as l2cpbg command option, it's done.
534
535
<p align="right">(<a href="#readme-top">back to top</a>)</p>
536
537
## Compatibility
538
539
L2CPBG got tested (or reported to work) with :
540
541
-   CardDAV Server:
542
    -   [Baïkal](https://sabre.io/baikal/) version 0.7.x
543
    -   [Daylite](https://www.marketcircle.com/)
544
    -   [Nextcloud](https://nextcloud.com/) version 13, 15, 16, 18, 20, 22, 25, 26, 27, 31
545
    -   [Synology Contacts](https://www.synology.com/dsm/packages/Contacts)
546
-   Desktop & Mobile Phones:
547
    -   [Gigaset](https://www.gigasetpro.com/) N510 IP PRO, N670 IP Pro
548
    -   [Grandstream](http://www.grandstream.com/) GXP2170, GRP2614, WP820, WP825
549
    -   [Mitel 6800](https://www.mitel.com/products/6800-sip-phones-business) and [6900](https://www.mitel.com/de-de/produkte/telefone-und-zubehoer/ip-telefone-und-peripherie/6900-ip-series) Series
550
    -   [Snom](https://www.snom.com/) 300, D315, D335
551
    -   [Yealink](https://www.yealink.com/) SIP-T52S, SIP-T54S, SIP-T54W, SIP-T57W, SIP-T58 (Android)
552
    -   [Fanvil](https://fanvil.com/) X3U, X7C, X210
553
-   Soft-Phones & Tools:
554
    - [PhoneSuite CTI](https://phonesuite.de)
555
-   Gateway Host OS:
556
    -   [Debian](https://www.debian.org/) 9.x-12.x (i386, amd64, arm64, armhf)
557
    -   [Gentoo](https://www.gentoo.org) amd64
558
    -   [Alpine Linux](https://www.alpinelinux.org/) x86_64 v3.x
559
    -   [macOS](https://www.apple.com/macos/) ™ Sierra 10.12.6, Catalina 10.15.7, Big Sur 11.6<!--, Ventura 13.1 -->
560
    -   [Ubuntu](https://ubuntu.com/) 20.04, 22.04
561
    -   [Windows](https://www.microsoft.com/windows) 10, Server 2016
562
563
<p align="right">(<a href="#readme-top">back to top</a>)</p>
564
565
## Limitations and Known Issues
566
567
- The internal LDAP Server doesn't support LDAPS (encrypted LDAP communication) at the moment. Therefore **it should not be used in an untrusted network!**<br>
568
  If you're interested to run it in an untrusted network, please drop me a short note.
569
570
## Support & getting help
571
572
For getting help or discussing l2cpbg, please browse the [L2CPBG Forum](https://projects.shbe.net/projects/l2cpbg/boards) or check/open the [Tickets](https://projects.shbe.net/projects/l2cpbg/issues) area.
573
574
## Footnotes