login | register
Sat 30 of Aug, 2008 [01:40 UTC]

voip-info.org

Discuss [2] History

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



Go back to Asterisk


Comments

Comments Filter
222

333

by benz, Thursday 22 of November, 2007 [10:06:17 UTC]
I have a AD named wks.com, it's ip is :172.31.0.173
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?

222

333which LDAP to use?

by sjobeck, Wednesday 03 of May, 2006 [23:20:42 UTC]
this looks great & I certainly love the fact that the code is inside an actual Asterisk application, all things being equal, compared to inside an external perl script. However, the Asterisk::LDAP seems to have some great functionality inside it.

I wonder if any one who has done work with both has a pointer for me.

Thanks.

Jason Sjobeck