anchor.diff:  %%% Internal functions
   %%--------------------------------------------------------------------
   
  -should_reopen_connection(State) when record(State, state) ->
  +%%--------------------------------------------------------------------
  +%% Function: should_reopen_connection(State)
  +%% Descrip.: Determine if it is time to try and re-open our connection
  +%%           to the LDAP server.
  +%% Returns : true | false
  +%%--------------------------------------------------------------------
  +should_reopen_connection(State) when is_record(State, state) ->
       QueryCount = State#state.querycount,
       Server = State#state.server,
       case State#state.handle of
  -	H when record(H, ldaphandle) ->
  +	H when is_record(H, ldaphandle) ->
   	    case util:safe_is_process_alive(H#ldaphandle.ref) of
   		{false, _} ->
   		    true;
  
positive.code: 	    Res
      end.
  
  lookup_tel2name(Number) ->
      case sipserver:get_env(ldap_server, none) of
  	none ->
  
negative.code: %%%-------------------------------------------------------------------
  %%% File    : directory.erl
  %%% Author  : Magnus Ahltorp <ahltorp@nada.kth.se>
  %%% Descrip.: gen_server that caches connection to LDAP-server
  %%%           and do all the querying.
  %%%
  %%% Created : 15 Nov 2002 by Magnus Ahltorp <ahltorp@nada.kth.se>
  %%%
  %%% Note    : You have to give the server name to every query to make
  %%%           it possible for the server process to have cached
  %%%           connections to multiple servers in the future.
  %%%-------------------------------------------------------------------
  -module(directory).
  
  -behaviour(gen_server).
  
  %%--------------------------------------------------------------------
  %% External exports
  %%--------------------------------------------------------------------
  -export([start_link/0,
  	 start_link/1,
  	 ldapsearch_simple/4,
  	 ldapsearch/4,
  	 get_value/2,
  	 lookup_mail2tel/1,
  	 lookup_mail2uid/1,
  	 lookup_mail2cn/1,
  	 lookup_tel2name/1
  	]).
  
  %%--------------------------------------------------------------------
  %% Internal exports - gen_server callbacks
  %%--------------------------------------------------------------------
  -export([
  	 init/1, 
  	 handle_call/3, 
  	 handle_cast/2, 
  	 handle_info/2, 
  	 terminate/2, 
  	 code_change/3
  	]).
  
  %%--------------------------------------------------------------------
  %% Include files
  %%--------------------------------------------------------------------
  
  %%--------------------------------------------------------------------
  %% Records
  %%--------------------------------------------------------------------
  -record(state, {
  	  handle,
  	  server,
  	  querycount
  	 }).
  -record(ldaphandle, {
  	  ref
  	 }).
  
  %%--------------------------------------------------------------------
  %% Macros
  %%--------------------------------------------------------------------
  -define(TIMEOUT, 2 * 1000).
  
  %%====================================================================
  %% External functions
  %%====================================================================
  %%--------------------------------------------------------------------
  %% Function: start_link()
  %% Descrip.: Starts the server
  %% Returns : gen_server:start_link() result
  %%--------------------------------------------------------------------
  start_link() ->
      case sipserver:get_env(ldap_server, none) of
  