anchor.diff:  	    util:casegrep(Domain, HostnameList)
       end.
   
  -get_remote_party_number(URL, DstHost) when record(URL, sipurl) ->
  +%%--------------------------------------------------------------------
  +%% Function: get_remote_party_number(URL, DstHost)
  +%%           URL     = sipurl record(), From:
  +%%           DstHost = term(), chosen destination for request
  +%% Descrip.: This function is used by the pstnproxy to provide a PSTN
  +%%           gateway with usefull caller-id information. PSTN networks
  +%%           typically gets upset if the "A-number" (calling party) is
  +%%           a SIP URL. Different gateways might want the number
  +%%           formatted differently, thus the DstHost parameter (a TSP
  +%%           gateway to PSTN might only handle E.164 numbers, while a
  +%%           PBX might be expecting only a 4-digit extension number).
  +%% Returns : {ok, Number} |
  +%%           none
  +%%           Number = string()
  +%%--------------------------------------------------------------------
  +get_remote_party_number(URL, DstHost) when is_record(URL, sipurl), is_list(DstHost) ->
       case local:get_users_for_url(URL) of
   	[User] ->
   	    case local:get_telephonenumber_for_user(User) of
  -		Number when list(Number) ->
  +		Number when is_list(Number) ->
   		    local:format_number_for_remote_party_id(Number, URL, DstHost);
   		nomatch ->
   		    logger:log(debug, "Lookup: No telephone number found for user ~p", [User]),
  
positive.code: -module(lookup).
  -export([lookupregexproute/1,
  	 lookupuser/1,
  	 lookup_url_to_locations/1,
  
negative.code: 	_ -> []
      end,	
      lists:append([Standard, Addr1, Addr2]);
  lookup_url_to_addresses(_Src, URL) when record(URL, sipurl) ->
      % Make a list of all possible addresses we
      % can create out of this URL
      Tel = local:canonify_numberlist([URL#sipurl.user]),
      lists:append([sipurl:print(sipurl:set([{pass, none}, {port, none}, {param, []}], URL))], Tel).
  
  lookup_addresses_to_users(Addresses) ->
      case local:get_users_for_addresses_of_record(Addresses) of
  