©2004,2005,2006,2007 Sven Slezak <sunny at mezzo.net>
LDAPget is an Asterisk application for data retrieval from LDAP
directories (e.g. OpenLDAP or ActiveDirectory).
LDAPget does not require you to use a specific LDAP schema.
If the requested data is found in the directory it is assigned
to a given variable an the priority is increased by 101.
The syntax for LDAPget in extensions.conf is as follows:
LDAPget(VARIABLE=config-file-section[/lookup-key1,lookup-key2,...])
Example:
If you would like to lookup the caller-id's name you could
configure your extensions.conf like this:
exten => 1234,1,LDAPget(CALLERID(name)=cidname)
exten => 1234,2,Dial(Zap/11/${EXTEN},15)
Then you have to configure the corresponding section in your
[cidname]
host = ldap.mydomain.com; (default: localhost)
port = 3389; (default: 389)
timeout = 5; (default: 10 sec)
version = 3; (default: 2)
user = cn=root,ou=People,o=mydomain.com
pass = secret
base = ou=Addressbook,o=mydomain.com
filter = (&(objectClass=person)(|(telephoneNumber=${CALLERID(num)})(mobile=${CALLERID(num)})(homePhone=${CALLERID(num)})(fax=${CALLERID(num)})))
attribute = displayName; (default: commonName)
convert = UTF-8,ISO-8859-1
note: the variable names in Asterisk 1.2 were CALLERIDNUM and CALLERIDNAME
Another Example for LDAPGet usage can be found in the
O'REILLY® Book Switching to VoIP Chapter 14
tar -xzf app_ldap-release.tgzin the app_ldap directory run:
make installRestart Asterisk or load the application module with:
load app_ldap.sodone!
show application LDAPgetshould print the description.
Mac version included in Asterisk PBX for Mac OS X
2.0rc1 - new version for Asterisk 1.4
1.0rc6 - bug fix: handle base=null. thanks to John Todd
1.0rc5 - fix for asterisk 1.2
1.0rc4 - fixed setting of CIDNAME in CVS. thanks to Stefan Lang, OrgaNet GmbH.
1.0rc3 - CVS support.
1.0rc2 - some debugging output removed.
1.0rc1 - added configuration for ldap version. thanks to Renan Prates Lopes de Campos
0.9.9.2 - fixed another memory leak. thanks to Craig Guy, zettaserve.com
0.9.9 - fixed memory leak and CVS_HEAD support. thanks to Alexander Litvin, goldentele.com
0.9.6 - added asterisk variables support in filter and base parameter
0.9.5 - added timeout configuration
0.9.3 - fixed allocation for filter. thanks to John B Dunning, Wayne State College
0.9.2 - fixed memory allocation for character conversion.
0.9.1 - asterisk api changed: chan->callerid to chan->cid.cid_num
0.9 - added ldap_unbind for unsuccessful searches. thanks to Hugh Blandford, Island Internet.
- added support for multiple keys in search filter.
0.8 - initial release
\ | /
- :-) -
/ | \