Polycom Corporate Directory
From FreeSWITCH Wiki
Polycom offers configuration of a "corporate directory", where the entries are fetched from a LDAP-Server. This page tries to describe how to set up a minimalistic OpenLDAP-based contacts directory on Debian and it's aimed at LDAP-noobs like me.
This documentation is based on UC Admin Guide 3.3.4, Corporate Directory Best Practices and Polycom UC Software Version 3.3.4 obviously.
Contents |
Setup of slapd with Debian Squeeze
Configure the server
Basic installation and configuration
Install slapd and ldap-utils
# apt-get install slapd ldap-utils
Reconfigure slapd
# dpkg-reconfigure -plow slapd
The package configuration will ask you a few questions:
- Omit OpenLDAP server configuration? No
- DNS domain name: my_domain
- Organization name: my_organization
- Adminstrator password: my_secret
- Database backend to use: HDB
- Do you want the database to be removed when slapd is purged?: Yes(I actually had to purge once, so this makes for a clean start)
- Move old database: Yes (If you reconfigure a second time, it will complain that there's already a backup-file in /var/backups/*.ldapd and reconfiguration will fail - it's safe to delete this file, then restart reconfiguration)
- Allow LDAPv2 protocol?: No
Add caseIgnoreOrderingMatch to core.schema
We now have to add "ORDERING caseIgnoreOrderingMatch" to the surname- and givenName-Attributes, because Polycom uses simple search expressions like '>=' and '<=' when querying the LDAP-addressbook.
# /etc/init.d/slapd stop
# vim /etc/ldap/slapd.d/cn\=config/cn\=schema/cn\=\{0\}core.ldif
In this file, substitute
olcAttributeTypes: {1}( 2.5.4.4 NAME ( 'sn' 'surname' ) DESC 'RFC2256: last (f
amily) name(s) for which the entity is known by' SUP name )
with
olcAttributeTypes: {1}( 2.5.4.4 NAME ( 'sn' 'surname' ) DESC 'RFC2256: last (f
amily) name(s) for which the entity is known by' SUP name ORDERING caseIgnoreOrderingMatch)
and
olcAttributeTypes: {35}( 2.5.4.42 NAME ( 'givenName' 'gn' ) DESC 'RFC2256: fir
st name(s) for which the entity is known by' SUP name )
with
olcAttributeTypes: {35}( 2.5.4.42 NAME ( 'givenName' 'gn' ) DESC 'RFC2256: fir
st name(s) for which the entity is known by' SUP name ORDERING caseIgnoreOrderingMatch)
If someone knows how to do this properly with a ldif-file and ldapmodify, please update this page! --Peletiah 14:43, 25 March 2012 (UTC)
Start slapd
# /etc/init.d/slapd start
Add contact information to the directory
Go to your home-directory and create a some ldif-files with the content we want to add to LDAP:
# cd # mkdir directory_files # cd directory_files
Create a file for the organizationUnit "people" that holds a user-account we need for the phones to login:
# vim people.ldif dn: ou=people,dc=my_domain ou: people description: holds users of the directory objectClass: organizationalUnit
Create a file for the polycom-User which we use for the phone-login:
# vim polycom_user.ldif dn: uid=polycom,ou=people,dc=my_domain changetype: add displayName: polycom cn: polycom givenname: polycom objectclass: top objectclass: person objectclass: organizationalPerson objectclass: inetorgperson uid: polycom sn: polycom userPassword: supersecret #Change the password!
Create a file for the organizationalUnit "contacts", that holds the contact-information:
# vim phonebook.ldif dn: ou=contacts,dc=my_domain ou: contacts description: lists all contacts objectClass: organizationalUnit
Create a file for the contaction-information of contact "John Doe" of "ACME Corporation". Attention: The phones don't seem to understand parenthesis and don't show a contact if any attribute-value has a parenthesis in them(Might apply to other special characters too):
# vim phonebook.ldif dn: cn=John Doe,ou=contacts,dc=my_domain changetype: add givenName: John sn: Doe cn: John Doe o: ACME Corporation telephoneNumber: 0043123456789 objectClass: inetOrgPerson objectClass: top
Parse files with ldapadd to add their content to the database(Change "my_domain", Password is the one you entered during reconfiguration):
# ldapadd -x -D "cn=admin,dc=my_domain" -W -v -f people.ldif ldap_initialize( <DEFAULT> ) Enter LDAP Password: add ou: contacts add description: lists all contacts add objectClass: organizationalUnit adding new entry "ou=contacts,dc=my_domain" modify complete
(Repeat with all the files you've created, in order)
Configure the phone
Assuming you are already using the excellent file-based Polycom provisioning, add these entries to your sip.cfg(Or custom-config):
<dir>
<dir.corp
dir.corp.address="$server_ip"
dir.corp.port="389"
dir.corp.transport="TCP"
dir.corp.baseDN="ou=contacts,dc=my_domain"
dir.corp.scope="sub"
dir.corp.filterPrefix=""
dir.corp.user="uid=polycom,ou=people,dc=my_domain"
dir.corp.pageSize="32"
dir.corp.password="supersecret"
dir.corp.cacheSize="128"
dir.corp.leg.pageSize="8"
dir.corp.leg.cacheSize="32"
dir.corp.autoQuerySubmitTimeout="1"
dir.corp.viewPersistence="0">
dir.corp.leg.viewPersistence="0">
dir.corp.sortControl="0"
<dir.corp.attribute
dir.corp.attribute.1.name="sn"
dir.corp.attribute.1.label="last name"
dir.corp.attribute.1.type="last_name"
dir.corp.attribute.1.searchable="1"
dir.corp.attribute.1.filter=""
dir.corp.attribute.1.sticky="0"
dir.corp.attribute.2.name="givenName"
dir.corp.attribute.2.label="first name"
dir.corp.attribute.2.type="first_name"
dir.corp.attribute.2.filter=""
dir.corp.attribute.2.sticky="0"
dir.corp.attribute.2.searchable="1"
dir.corp.attribute.3.name="telephoneNumber"
dir.corp.attribute.3.label="phone number"
dir.corp.attribute.3.type="phone_number"
dir.corp.attribute.3.filter=""
dir.corp.attribute.3.sticky="0"
dir.corp.attribute.3.searchable="0"
dir.corp.attribute.4.name="o"
dir.corp.attribute.4.label="company name"
dir.corp.attribute.4.type="other"
dir.corp.attribute.4.filter=""
dir.corp.attribute.4.sticky="0"
dir.corp.attribute.4.searchable="1"
</dir.corp.attribute>
<dir.corp.backGroundSync
dir.corp.backGroundSync.period="3600">
</dir.corp.backGroundSync>
<dir.corp.vlv
dir.corp.vlv.allow="1"
dir.corp.vlv.sortOrder="sn givenName telephoneNumber">
</dir.corp.vlv>
</dir.corp>
</dir>
<feature feature.corporateDirectory.enabled="1"/> <softkey softkey.feature.directories="1" />
Adapt the values in bold according to your personal settings and preferences. Use the password of the user "polycom", not "admin". All parameters are documented in detail in the aforementioned UC Admin Guide 3.3.4. YMMV if you use version 4 of the UC-software
Reboot your phones to fetch the configuration. Press the new softkey "Dir"(Or the "Directories"-button if you have one and you should see a menu-item "Corporate Directory...". Enter it and you can use the search-function to search for firstname, lastname and companyname(Unfortunately the companyname is only displayed in the contact-details).
Of course you can add additional attributes(email, address, hair colour, whatnot) to be able to search for them.
Debugging
Search the directory:
ldapsearch -D "uid=polycom,ou=people,dc='my_domain" -b "ou=contacts,dc=my_domain" -w supersecret -h 127.0.0.1 "(sn=*)"

