Feature #24
closedAdd some mappings from VCard to LDAP
0%
Description
VCard specifies also
ROLE in company (LDAP ?)
ORG with department (LDAP department?)
N with prefix (LDAP personalTitle?) and suffix (AD generationQualifier?)
Is it possible to add those too?
Updated by Jörg Ebeling about 4 years ago
Yes, it's already in.
Please check section "[ldap.map...] = LDAP/CardDav mapping" of Readme as well as the config.sample of the package file.
Within the config.sample you see the current default mapping in commented form. If you wanna change something of it, simple copy the relevant mapping to your config and adapt as you like.
Updated by Andreas Vitting about 4 years ago
Hm, If I look into first read from CARDDAV server (debug), nothing of those is mapped by default.
Just looked again ;-)
Example
N:Müller;Klaus;;Dr.;hc
only sn = Müller and givenName = Klaus mapped, Dr. and hc is not mapped...
Next one
Microsoft,Support
results in
company = Microsoft; but no department.
Perhaps I did'n get your point, but to which LDAP field is prefix and suffix mapped?
;[ldap.map.??]
;dav = N
;index = 3
;[ldap.map.??]
;dav = N
;index = 4
And which ldap fields I can choose? Every name?
Updated by Jörg Ebeling about 4 years ago
Yes, you can choose any valid LDAP name, whereas valid only means that they must not contain dashes or some of the other forbidden LDAP characters, but take into account that ldap names are case sensitive!
With your cardDav sample:
N:Müller;Klaus;;Dr.;hc
"sn" and "givenName" already have a default mapping as shown in config.sample.
If you're now i.e. also interested in "Dr." and wanna get it in LDAP attribute "title", adding the following to your config should do the trick:
[ldap.map.title]
dav = N
index = 3
Which means the fourth (index=3 because count starts by 0) ";" separated entry of vCards "N" field shall be mapped to LDAPs "title" attribute.
Place it into your config, restart L2CPBG, add it to your phones config i.e. "LDAP Display Name = %cn %company %title" should do it ;-)
Does it work as expected?
Updated by Andreas Vitting about 4 years ago
..in addition.
Jut tried in config file
[ldap.map.initials]
dav = N
index = 2
;
[ldap.map.personalTitle]
dav = N
index = 3
;
[ldap.map.generationQualifier]
dav = N
index = 4
none of them worked.
Updated by Andreas Vitting about 4 years ago
Just tried it again. There was an "error?" in VCard, which contains only CR, not CRLF. After correction config file and all ldap mappings worked as expected.
So no "new feature" needed.