anchor.diff:             % otherwise, make SRV query
              Domain = service_proto(Transport, TLS) ++ Host,
              Dest = #sip_destination{transport = Transport, params = Params},
  -           resolve_dest_srv(Domain, Dest)
  +           resolve_dest_srv(Host, Domain, Dest)
       end.
   
  -resolve_dest_srv(Domain, Dest) ->
  -    [Res || {_Pri, _Weight, Port, Host} <- lookup_srv(Domain),
  -             Res <- resolve_dest_a(Host, Dest#sip_destination{port = Port})].
  -
  -%% @doc Sort according to RFC 2782
  +%% @doc Determine Port and IP address by SRV queries
  +%% @end
  +resolve_dest_srv(Target, Domain, Dest) ->
  +    case lookup_srv(Domain) of
  +        [] ->
  +            % FIXME: hard-coded default port
  +            Port = 5060,
  +            [Res || Res <- resolve_dest_a(Target, Dest#sip_destination{port = Port})];
  +        SRVs ->
  +            [Res || {_Pri, _Weight, Port, Host} <- SRVs,
  +                    Res <- resolve_dest_a(Host, Dest#sip_destination{port = Port})]
  +    end.
  +
  +%% @doc Lookup SRV records and sort them according to RFC 2782
   %% @end
   lookup_srv(Domain) ->
       SRVs = inet_res:lookup(Domain, in, srv),
  
positive.code:             % Transport is provided explicitly, make SRV query
              Domain = service_proto(Transport, TLS) ++ Target,
              Dest = #sip_destination{transport = Transport, params = Params},
              resolve_dest_srv(Domain, Dest);
          true ->
              % make NAPTR query
              select_bynaptr(Target, TLS)
  
negative.code:             [{Service, Name} | _Rest] = List2,
  
              Dest2 = service_dest(Service),
              resolve_dest_srv(Host, Name, Dest2)
      end.
  
  %% @doc Create `#sip_destination{}' for given NAPTR service
  