anchor.diff:  %% Descrip.: find all users (#phone.number) that use a cretain sip url
   %% Returns : {atomic, Users} | {aborted, Reason}
   %%           Users = list() of #phone.number values
  -%% XXX this function is inefficient, as no keys are used during search
   %%--------------------------------------------------------------------
   get_sipusers_using_location(URI) when is_record(URI, sipurl) ->
       ReqURIstr = url_to_requristr(URI),
       F = fun() ->
  -		[ E#phone.number || E <- mnesia:match_object(#phone{requristr = ReqURIstr,
  -								    _ = '_'}) ]
  +		[ E#phone.number || E <- mnesia:index_read(phone, ReqURIstr, #phone.requristr) ]
   	end,
       mnesia:transaction(F).
   
  
positive.code: 	  end,
      mnesia:transaction(Fun).
  
  %%--------------------------------------------------------------------
  %% Function: delete_record(Obj)
  %%           Obj = phone record()
  
negative.code: %%           Entries = list() of siplocationdb_e record()
  %%--------------------------------------------------------------------
  get_sipuser_locations(SipUser) when is_list(SipUser) ->
      F = fun() ->
  		 mnesia:read({phone, SipUser})
  	end,
      {atomic, L} = mnesia:transaction(F),
  
      Now = util:timestamp(),
  
      %% Remove expired entrys and convert into siplocationdb_e record().
      %% Convert the location strings stored in the database to sipurl record format.
      %% We can't store the locations as sipurl records in the database in case we
      %% have to change something in the sipurl record.
      Rewrite =
  	[ #siplocationdb_e{address	= sipurl:parse(E#phone.address),
  			   flags	= E#phone.flags,
  			   class	= E#phone.class,
  			   expire	= E#phone.expire
  			  }
  	  || E <- L, E#phone.expire > Now orelse E#phone.expire == never],
       {ok, Rewrite}.
  
  %%--------------------------------------------------------------------
  %% Function: get_phone(SipUser)
  