Asterisk config ldap.conf
Created by: szunny,Last modification on Sun 05 of Jun, 2005 [21:30 UTC] by JustRumours
ldap.conf - config file for LDAPget
[section-name]
host = <hostname> ; default: localhost
port = <port> ; default: 389
user = <user dn> ; default: anonymous bind
pass = <password>
base = <base dn>
scope = <sub | base | one> ; default: sub
filter = <ldap filter pattern> ; default: (&(objectClass=person)(telephoneNumber=%s))
attribute = <ldap attribute> ; default: commonName
convert = <source charset>,<destination charset>
Example
[cidname]
host = samplehost
user = cn=root,ou=People,o=sampledomain
pass = secret
base = ou=Addressbooks,o=sampledomain
filter = (&(objectClass=person)(|(telephoneNumber=%s)(mobile=%s)(fax=%s)))
attribute = displayName
convert = UTF-8, ISO-8859-1
corresponding part in extensions.conf:
exten => 1234,1,LDAPget(CIDNAME=cidname/${CALLERIDNUM},${CALLERIDNUM},${CALLERIDNUM}) ; for telefon, mobile and fax
exten => 1234,2,SetCIDName(${CIDNAME})
exten => 1234,3,Dial(Zap/11/${EXTEN},15)
See also
- Asterisk cmd LDAPget
- LDAP
- Asterisk LDAP - a totally different, unrelated approach
- Authenticate_ldap
Go back to Asterisk
Comments
333
for search the user account in AD,I add the following two lines to /etc/openldap/ldap.conf
HOST 172.31.0.173
BASE dc=wks,dc=com
then the command is works fine,it list more information about the account ben:
ldapsearch -x -D "cn=Administrator,cn=Users,dc=wks,dc=com" -W "sAMAccountName=ben"
now I want to use the LDAPget , I configure the /etc/asterisk/ldap.conf like this:
cidname
host = 172.31.0.173
version = 3
user = cn=administrator,cn=Users
pass = 111111
base = dc=wks,dc=com
filter = (&(objectClass=person)(|(samaccountname=ben)))
attribute = telephoneNumber
convert = UTF-8,ISO-8859-1
in the extension.conf
exten => 1000,1,LDAPget(a=cidname)
But when I use a extension phone to dial the 1000, the asterisk terminate and output the following info:
== Parsing '/etc/asterisk/ldap.conf': Found
> LDAPget: ldap://172.31.0.173/dc=wks,dc=com?telephoneNumber?sub?(&(objectClass=person)(|(samaccountname=ben)))
— LDAPget: ldap://172.31.0.173/dc=wks,dc=com?telephoneNumber?sub?(&(objectClass=person)(|(samaccountname=ben)))
ben*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
Asterisk cleanly ending (0).
What can I do?
333which LDAP to use?
I wonder if any one who has done work with both has a pointer for me.
Thanks.
Jason Sjobeck