anchor.diff:          {ok, TargetIp} -> IsNumeric = true;
           _ -> TargetIp = IsNumeric = false
       end,
  -    Proto1 = case nksip_lib:get_value(<<"transport">>, Opts) of
  +    Proto = case nksip_lib:get_value(<<"transport">>, Opts) of
           Atom when is_atom(Atom) -> 
               Atom;
           Other -> 
  
positive.code:          handle_info/2]).
  
  -define(CHECK_INTERVAL, 60).    % secs
  
  
  
  %% ===================================================================
  
negative.code:                 Atom -> Atom
              end
      end,
      Resolve = fun(FProto) -> 
          Port1 = case Port > 0 of
              true -> Port;
              false -> nksip_transport:default_port(FProto)
          end,
          Addrs = case IsNumeric of
              true -> [TargetIp];
              false -> get_ips(Target)
          end,
          {ok, [{FProto, Addr, Port1} || Addr <- Addrs]} 
      end,
      case {Scheme, Proto} of
          {sip, udp} -> Resolve(udp);
          {sip, tcp} -> Resolve(tcp);
          {sip, tls} -> Resolve(tls);
          {sip, sctp} -> Resolve(sctp);
          {sip, ws} -> Resolve(ws);
          {sip, wss} -> Resolve(wss);
          {sip, undefined} when IsNumeric; Port>0 -> Resolve(udp);
          {sip, undefined} -> {naptr, sip, Target};
          {sips, udp} -> {ok, []};
          {sips, tcp} -> Resolve(tls);
          {sips, tls} -> Resolve(tls);
          {sips, sctp} -> {ok, []};
          {sips, ws} -> Resolve(wss);
          {sips, wss} -> Resolve(wss);
          {sips, undefined} when IsNumeric; Port>0 -> Resolve(tls);
          {sips, undefined} -> {naptr, sips, Target};
          _ -> {ok, []}
      end.
  