anchor.diff:      end.
   
   %%--------------------------------------------------------------------
  -%% Function: dst2str/1
  -%% Description: Turn a sipdst into something printable (for debugging)
  -%% Returns: DstString
  +%% Function: dst2str(Dst)
  +%%           Dst = sipdst record()
  +%% Descrip.: Turn a sipdst into something printable (for debugging)
  +%% Returns : DstString, Dst as string()
   %%--------------------------------------------------------------------
   
   %%
   %% URI present
   %%
  -dst2str(Dst) when record(Dst, sipdst), Dst#sipdst.uri /= undefined ->
  -    lists:flatten(io_lib:format("~p:~s:~p (~s)", [Dst#sipdst.proto, Dst#sipdst.addr, Dst#sipdst.port,
  -						  sipurl:print(Dst#sipdst.uri)]));
  +dst2str(Dst) when is_record(Dst, sipdst), Dst#sipdst.uri /= undefined ->
  +    lists:flatten(io_lib:format("~p:~s:~p (~s)",
  +				[Dst#sipdst.proto, Dst#sipdst.addr, Dst#sipdst.port,
  +				 sipurl:print(Dst#sipdst.uri)]));
   
   %%
   %% No URI, for example Response sipdst record
  
positive.code: 
  
  %%--------------------------------------------------------------------
  %% Function: url_to_dstlist_not_ip/3
  %% Description: Called from url_to_dstlist/1 when the Host part of the
  %%              URI was not an IP address
  %% Returns: ListOfDsts | {error, Reason}
  %%--------------------------------------------------------------------
  
  %%
  %% URL port specified
  %%
  url_to_dstlist_not_ip(URL, ApproxMsgSize, ReqURI) when record(URL, sipurl), integer(ApproxMsgSize), URL#sipurl.port /= none ->
      case URL#sipurl.proto of
  	_ when URL#sipurl.proto == tls ; URL#sipurl.proto == tls6 ->
  	    TLS = host_port_to_dstlist(tcp, URL#sipurl.host, URL#sipurl.port, ReqURI),
  	    logger:log(debug, "Resolver: Port was explicitly supplied and URL protocol is TLS - only try TCP"),
  	    TLS;
  	_ ->
  	    TCP = host_port_to_dstlist(tcp, URL#sipurl.host, URL#sipurl.port, ReqURI),
  	    UDP = host_port_to_dstlist(udp, URL#sipurl.host, URL#sipurl.port, ReqURI),
  	    case ApproxMsgSize of
  		_ when ApproxMsgSize > 1200 ->
  		    logger:log(debug, "Resolver: Port was explicitly supplied, and size of message is > 1200. Try TCP and then UDP."),
  		    lists:append(TCP, UDP);
  		_ ->
  		    %% RFC3263 4.1 says we SHOULD use UDP as default in this case, since UDP was the only thing
  		    %% mandated by RFC2543. Sucks.
  		    logger:log(debug, "Resolver: Port was explicitly supplied, and size of message is <= 1200. Try UDP and then TCP."),
  		    lists:append(UDP, TCP)
  	    end
      end;
  
negative.code: 		R ->
  		    R
  	    end;
  	_Res ->
  	    %% There was no received= parameter. Do the same checks but on the Via
  	    %% hostname (which is then almost certainly an IP-address).
  	    case address_to_address_and_proto(Host, Proto) of
  