Upgrade 3CX to v18 and get it hosted free!

LDAP: Lightweight Directory Access Protocol

Author image

LDAP is an open-standard protocol for accessing X.500 directory services. The protocol runs over Internet transport protocols, such as TCP.

LDAP is a lightweight alternative to the X.500 Directory Access Protocol (DAP) for use on the Internet. It uses TCP/IP stack verses the overly complex OSI stack. It also has other simplications, such as the representing most attribute values and many protocol items as textual strings, that are designed to make clients easier to implement.

The directory is a database optimized for read operations.

You can access an LDAP directory in your dialplan with LDAPget.

You can use Asterisk::LDAP to generate Asterisk 1.0 compatible configuration files from LDAP.

Asterisk Ldap Realtime Usage

res_config_ldap.c is now part of the Asterisk 1.6.x Beta releases (as of Feb 2008). Download any asterisk 1.6.x beta release greater than 1.6.0beta2 and follow these:

Files you need to alter:

  • /etc/asterisk/extconfig
  • /etc/asterisk/res_ldap.conf
  • /etc/asterisk/extensions.conf (for realtime extensions)

Known Bugs:

  • Pattern matching extensions do NOT work
  • Queue Member lookup fails

To save on time, I am pasting my configuration files here. Please note that:

  • res_ldap.conf is a simple mapping of Asterisk Realtime values to ldap objects (you can name your ldap objectclasses/attributes whatever you want!)
  • Schema provided with the distribution does not conform to res_ldap.conf in the distribution.

A lite note: it is best to rename your current res_ldap.conf and replace it with the attachement here. or copy the content of this attachement into the res_ldap.conf

my extconfig:


[settings]
sipusers => ldap,"dc=emergen,dc=biz",sip
sippeers => ldap,"dc=emergen,dc=biz",sip
voicemail => ldap,"dc=emergen,dc=biz",voicemail
voicemail_data => ldap,"dc=emergen,dc=biz",voicemail
extensions => ldap,"dc=emergen,dc=biz",extensions
queues => ldap,"dc=emergen,dc=biz",queue
queue_members => ldap,"dc=emergen,dc=biz",queue_member
musiconhold => mysql,asterisk
queue_log => mysql,asterisk
meetme => ldap,"dc=emergen,dc=biz",meetme
; A little note: Copy this piece and place it at the bottom of the extconfig.conf

In extension.conf (For Realtime Extensions) you need to enable the switch to Realtime in that particular context:

For example:


[internal]
switch => Realtime/@

IMPORTANT NOTICE regarding res_ldap.conf: DON’T use quotes (“) for basedn=… and user=… configuration entries. Otherwise asterisk will include the quotes in DN which results in “Invalid DN syntax” error messages. I haven’t check the rest of the config file, but this is definitely an error in that (using asterisk 1.6.1.9). The following syntax worked for me:

basedn=dc=example,dc=com
user=cn=master,dc=example,dc=com

There is an auto install script available for installing asterisk 1.2 with realtime ldap driver support, check it out http://cyrenity.wordpress.com/2008/12/28/asterisk-12-with-realtime-ldap-driver/


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.