Upgrade 3CX to v18 and get it hosted free!

Asterisk cmd LDAPget

Author image

LDAPget

Synopsis

Retrieve a value from an LDAP directory server (e.g. OpenLDAP or ActiveDirectory).
LDAPget does not require you to use a specific LDAP schema.

Description

LDAPget(varname=config-file-section[/key1,key2,…])

To lookup the Caller-ID’s name you could configure your extensions.conf like this:

exten => 1234,1,LDAPget(CALLERIDNAME=cidname/${CALLERIDNUM},${CALLERIDNUM})

The corresponding section In the ldap.conf file could look like this:

[cidname]
host = ldap.mydomain.com
version = 3
user = cn=root,ou=People,o=mydomain.com
pass = secret
filter = (&(objectClass=person)(|(telephoneNumber=%s)(fax=%s)))
base = ou=Addressbook,o=mydomain.com

The “%s”s will be replaced by key1,key2, etc.
Asterisk variables in ‘filter’ and ‘base’ will also be evaluated. So you could also write the example above like this:

exten => 1234,1,LDAPget(CALLERIDNAME=cidname)

with the following filter in ldap.conf

filter = (&(objectClass=person)(|(telephoneNumber=${CALLERIDNUM})(fax=${CALLERIDNUM})))

TIP: On Mac OS you can use AddressBook2LDAP to Export your AddressBook to an LDAP directory.

Return values

Always returns 0. If the requested key is not found, jumps to priority n+101 if available.

Version information

LDAPget() is not included in Asterisk releases or CVS, it’s a third party application.

See also


Go back to Asterisk


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.