anchor.diff:  	    none
       end.
   
  -format_number_for_remote_party_id(Number, ToURI, DstHost) when record(ToURI, sipurl) ->
  +%%--------------------------------------------------------------------
  +%% Function: format_number_for_remote_party_id(Number, URL, DstHost)
  +%%           Number  = string(), the number to format
  +%%           URL     = sipurl record(), From:
  +%%           DstHost = term(), destination for request
  +%% Descrip.: Hook for the actual formatting once
  +%%           get_remote_party_number/2 has found a number to be
  +%%           formatted.
  +%% Returns : {ok, Number}
  +%%           Number = string()
  +%%--------------------------------------------------------------------
  +format_number_for_remote_party_id(Number, ToURI, _DstHost) when is_list(Number),
  +								is_record(ToURI, sipurl) ->
       case rewrite_potn_to_e164(Number) of
   	error ->
   	    none;
   	Res ->
  -	    Res
  -    end.
  -
  -get_remote_party_name(Key, URI) when list(Key), record(URI, sipurl) ->
  +	    {ok, Res}
  +    end.
  +
  +%%--------------------------------------------------------------------
  +%% Function: get_remote_party_name(Key, URI)
  +%%           Key = string(), number we should turn into a name
  +%%           URI = term(), destination for request
  +%% Descrip.: When pstnproxy receives a request from a PSTN gateway,
  +%%           this function is called to see if we can find a nice
  +%%           Display Name for the calling party.
  +%% Returns : {ok, DisplayName} |
  +%%           none
  +%%           DisplayName = string()
  +%%--------------------------------------------------------------------
  +get_remote_party_name(Key, URI) when is_list(Key), is_record(URI, sipurl) ->
       case directory:lookup_tel2name(Key) of
   	none ->
   	    none;
   	[DisplayName] when is_list(DisplayName) ->
  -	    [DisplayName];
  +	    {ok, DisplayName};
   	L when is_list(L) ->
   	    logger:log(debug, "Lookup: Got more than one name back for number ~p. Since I have no way " ++
   		       "of choosing a name from a list, I'm not going to try.", [Key]),
  
positive.code: 	    util:casegrep(Domain, HostnameList)
      end.
  
  get_remote_party_number(URL, DstHost) when record(URL, sipurl) ->
      case local:get_users_for_url(URL) of
  	[User] ->
  	    case local:get_telephonenumber_for_user(User) of
  		Number when 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]),
  
negative.code: 				_ ->
  				    {relay, URL}
  			    end;
  			_ ->
  			    logger:log(error, "Lookup: Rewrite of number ~p did not result in a parseable URL : ~p",
  				       [Number, Res]),
  			    error
  