anchor.diff:      end.
   
   %%--------------------------------------------------------------------
  -%% Function: get_remote_party_number(URL, DstHost)
  -%%           URL     = sipurl record(), From:
  +%% Function: get_remote_party_number(User, Header, DstHost)
  +%%           User    = string(), SIP authentication username
  +%%           Header  = keylist record()
  +%%           URI     = sipurl record(), outgoing Request-URI
   %%           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
  
positive.code: %%--------------------------------------------------------------------
  lookup_addresses_to_users(Addresses) when is_list(Addresses) ->
      case local:get_users_for_addresses_of_record(Addresses) of
  	[] ->
  	    [];
  	nomatch ->
  	    [];
  	Users when is_list(Users) ->
  	    Res = lists:sort(Users),
  	    logger:log(debug, "Lookup: Addresses ~p belongs to one or more users : ~p", [Addresses, Res]),
  	    Res;
  	Unknown ->
  	    logger:log(error, "Lookup: lookup_addresses_to_users: unknown result from"
  		       " local:get_users_for_addresses_of_record(~p) : ~p",
  		       [Addresses, Unknown]),
  	    []
      end.
  
  %%--------------------------------------------------------------------
  
negative.code: 		URL when is_record(URL, sipurl), URL#sipurl.user == none, URL#sipurl.pass == none ->
  		    {forward, URL};
  		_ ->
  		    logger:log(error, "Lookup: Failed parsing configured appserver '~p', "
  			       "responding '500 Server Internal Error'", [AppServer]),
  		    {response, 500, "Server Internal Error"}
  	    end
      end.
  