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:     %% without requiring authorization in incomingproxy and appserver.
      URIstr = url_to_requristr(Address),
      Fun = fun() ->
  		  A = mnesia:match_object(#phone{number = SipUser,
  						 class = Class,
  						 requristr = URIstr,
  						 _ = '_'}),
  		  Delete = fun(O) ->
  				   mnesia:delete_object(O)
  			   end,
  
negative.code: 	 get_users_for_number/1,
  	 list_numbers/0,
  	 delete_phone/3,
  	 delete_phone_for_user/2,
  	 get_sipusers_using_location/1,
  
  	 test/0,
  	 test_create_table/0
  	]).
  
  %%--------------------------------------------------------------------
  