anchor.diff:  		none ->
   		    logger:log(debug, "userdb-ldap: No user found for address ~p in LDAP (server ~p)", [Address, Server]),
   		    nomatch;
  -		[{dn, Dn, attributes, EAttributes}] ->
  -		    case directory:get_value({dn, Dn, attributes, EAttributes}, UserAttribute) of
  +		[LDAPres] when is_record(LDAPres, ldapres) ->
  +		    case directory:get_value(LDAPres, UserAttribute) of
   			QRes when is_list(QRes) ->
  +			    Dn = LDAPres#ldapres.dn,
   			    logger:log(debug, "userdb-ldap: Found LDAP user for ~p, dn ~p: ~p", [Address, Dn, QRes]),
   			    QRes;
   			Foo ->
  
positive.code: %% Include files
  %%--------------------------------------------------------------------
  -include("siprecords.hrl").
  
  %%====================================================================
  %% External functions
  
negative.code: %%% Created : 09 Oct 2003 by Fredrik Thulin <ft@it.su.se>
  %%%-------------------------------------------------------------------
  -module(sipuserdb_ldap).
  
  -behaviour(sipuserdb).
  
  %%--------------------------------------------------------------------
  %% External exports
  