anchor.diff:  %%====================================================================
   
   %%--------------------------------------------------------------------
  -%% Function: init/1
  -%% Description: Initiates the server
  -%% Returns: {ok, State}          |
  -%%          {ok, State, Timeout} |
  -%%          ignore               |
  -%%          {stop, Reason}
  +%% Function: init([Server])
  +%%           Server = string()
  +%% Descrip.: Initiates the server
  +%% Returns : {ok, State}
  +%% Note    : XXX we don't do timeout here. Accident, or to not produce
  +%%           work load if noone ever asks us anything?
   %%--------------------------------------------------------------------
   init([Server]) ->
       Handle = case Server of
   		 none -> none;
  -		 H when record(H, ldaphandle) -> H;
  +		 H when is_record(H, ldaphandle) -> H;
   		 _ ->
   		     case ldap_connect(Server) of
  -			 H2 when record(H2, ldaphandle) -> H2;
  +			 H2 when is_record(H2, ldaphandle) -> H2;
   			 {error, E} ->
   			     logger:log(error, "LDAP client: Could not connect to LDAP server ~p " ++
   					"at the moment : ~p", [Server, E]),
  
positive.code: %%% Internal functions
  %%--------------------------------------------------------------------
  
  should_reopen_connection(State) when record(State, state) ->
      QueryCount = State#state.querycount,
      Server = State#state.server,
      case State#state.handle of
  	H when record(H, ldaphandle) ->
  	    case util:safe_is_process_alive(H#ldaphandle.ref) of
  		{false, _} ->
  		    true;
  
negative.code: 	    Res
      end.
  
  %%--------------------------------------------------------------------
  %% Function: lookup_mail2uid(Mail)
  %%           Mail = string(), e-mail address
  %% Descrip.: Find the uid of a user that has Mail as mail-attribute in
  %%           LDAP.
  %% Returns : Value |
  %%           none  |
  %%           error
  %%           Value = string()
  %%--------------------------------------------------------------------
  lookup_mail2uid(Mail) ->
      case sipserver:get_env(ldap_server, none) of
  	none ->
  