<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><BR style="RIGHT: auto">[code]<BR>res_ldap.conf</div>
<div style="RIGHT: auto">[_general]<BR>;<BR>; Specify one of either host and port OR url.&nbsp; URL is preferred, as you can<BR>; use more options.<BR>;host=192.168.1.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; LDAP host<BR>host=lync-demo.local&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; LDAP host<BR>port=389<BR>url=ldap://ad.lync-demo.local:389<BR>protocol=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Version of the LDAP protocol to use; default is 3.<BR>basedn=dc=lync-demo,dc=local&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Base DN<BR>;user=cn=administrator,dc=lync-demo,dc=local&nbsp; ; Bind DN<BR>user=cn=administrator,cn=users,dc=lync-demo,dc=local&nbsp; ; Bind
 DN<BR>;user=dc=lync-demo,dc=local&nbsp; ; Bind DN<BR>pass=Esi888888 </div>
<div style="RIGHT: auto">&nbsp;</div>
<div style="RIGHT: auto">[extensions]<BR>;context&nbsp; =&nbsp; AstExtensionContext<BR>;context&nbsp; =&nbsp; givenname<BR>;exten&nbsp; =&nbsp; AstExtensionExten<BR>attribute=exten=givenname<BR>;priority = AstExtensionPriority<BR>;attribute=priority=givenname<BR>;app = AstExtensionApplication<BR>;appdata = AstExtensionApplicationData<BR>additionalFilter=(objectClass=user)</div>
<div style="RIGHT: auto">[/code]</div>
<div style="RIGHT: auto">[code]<BR>extconfig.conf<BR>extensions =&gt; ldap,"dc=lync-demo,dc=local",extensions<BR>[/code]<BR>[code]<BR>[from-internal]<BR>include =&gt; from-internal-xfer<BR>include =&gt; bad-number<BR>switch =&gt; <A href="mailto:Realtime/@extensions">Realtime/@extensions</A><BR>exten=&gt; William,1,Set(CHANNEL(secure_bridge_media)=1)<BR>exten=&gt; William,2,Set(_SIP_SRTP_SDES=1)<BR>exten=&gt; William,3,Set(_SIPSRTP=optional)<BR>exten=&gt; William,4,Set(_SIPSRTP_CRYPTO=enable)<BR>exten =&gt; William,5,Set(b="${REALTIME(extensions,givenname,William)}")<BR>exten =&gt; William,6,NoOp(${b})<BR>exten =&gt; William,7,Set(pair=${CUT(b,"|",1)});<BR>exten =&gt; William,8,Set(col_name=${CUT(pair,"=",2)});<BR>exten=&gt; William,n,Hangup()<BR>[/code]</div>
<div style="RIGHT: auto">I use realtime to connect ldap server at lync <BR>But When I query the ldap , I get below error in full log .<BR>I expect the ldap query will get back something according input givename=William .</div>
<div style="RIGHT: auto">The REALTiME function cannot retrevie the givename from lync and output null.<BR>There is this key/attribute in lync server .....</div>
<div style="RIGHT: auto">There is openration error .<BR>The lync ldap server is working and I can use the filter (&amp;(objectClass=user)(givenname=William)) to get the result by<BR>php ldap_Search .. it is work .</div>
<div style="RIGHT: auto">Please advice what is wrong in asterisk I use asterisk 1.8.11 ...</div>
<div style="RIGHT: auto">&nbsp;</div>
<div style="RIGHT: auto">[Oct 30 00:42:48] DEBUG[9260] app_queue.c: Device 'SIP/3200' changed to state '2' (In use) but we don't care because they're not a member of any queue.<BR>[Oct 30 00:42:48] WARNING[9264] res_config_ldap.c: Failed to query directory. Error: Operations error.<BR>[Oct 30 00:42:48] WARNING[9264] res_config_ldap.c: Query: (&amp;(objectClass=user)(givenname=William))<BR>[Oct 30 00:42:48] DEBUG[9264] pbx.c: Function result is '(null)'<BR>[Oct 30 00:42:48] DEBUG[9264] pbx.c: Launching 'Set'<BR>[Oct 30 00:42:48] VERBOSE[9264] pbx.c:&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [William@from-internal:5] Set("SIP/3200-00000000", "b=""") in new stack</div>
<div style="RIGHT: auto">&nbsp;</div>
<div style="RIGHT: auto">&nbsp;</div>
<div style="RIGHT: auto">Log for asterisk full<BR><A href="https://dl.dropbox.com/u/68357652/full.rar">https://dl.dropbox.com/u/68357652/full.rar</A></div>
<div style="RIGHT: auto"><VAR id=yui-ie-cursor></VAR>&nbsp;</div></div></body></html>