anchor.diff:      ReqInfo = dict:fetch(TxKey, State#sip_ua_state.requests),
       UserData = ReqInfo#req_info.user_data,
   
  -    % RFC3261 8.1.3.3 Vias
  -    Status = Msg#sip_message.kind#sip_response.status,
  -    Redirect = Status >= 300 andalso Status =< 399,
  -    ViasCount = count_via(Msg),
  -    if
  -        ViasCount =/= 1 ->
  +    % RFC 3261 8.1.3.3 Vias
  +    case count_via(Msg) of
  +        1 ->
  +            % handle response from transaction layer
  +            Mod:handle_response(UserData, Msg, State);
  +        _Other ->
               % discard response, too much/few Via's
               error_logger:warning_report(['message_discarded',
                                            {reason, wrong_vias},
                                            {msg, Msg}]),
  -            {noreply, State};
  -        Redirect ->
  -            % handle automatic redirect
  -            Mod:handle_redirect(UserData, Msg, State);
  -        true ->
  -            % handle response from transaction layer
  -            Mod:handle_response(UserData, Msg, State)
  +            {noreply, State}
       end;
  -handle_info({tx, TxKey, {request, Msg}}, #sip_ua_state{mod = Mod} = State) ->
  +handle_info({tx, _TxKey, {request, Msg}}, #sip_ua_state{mod = Mod} = State) ->
       % handle request from transaction layer
       Mod:handle_request(Msg#sip_message.kind#sip_request.method, Msg, State);
   handle_info({tx, TxKey, {terminated, normal}}, State) ->
  
positive.code:             Request2 = Request#sip_message{kind = Kind#sip_request{uri = URI}},
              Destinations = lookup_destinations(Request2),
              ReqInfo2 = ReqInfo#req_info{request = Request2, destinations = Destinations, target_set = TargetSet2},
              next_destination(Reason, ReqInfo2, State)
      end;
  next_destination(_Reason, #req_info{request = Request, destinations = [Top | Fallback]} = ReqInfo, State) ->
      % send request to the top destination
      {ok, TxKey} = sip_transaction:start_client_tx(self(), Top, Request),
  
  
negative.code: 
  
  -spec handle_response(term(), #sip_message{}, #sip_ua_state{}) -> any().
  handle_response(_UserData, #sip_message{kind = #sip_response{status = Status}} = Request, State)
    when Status >= 300, Status =< 399 ->
      % handle automatic redirect.
      process_redirect(Request, State);
  handle_response(_UserData, _Msg, State) ->
      {noreply, State}.
  
  %%-----------------------------------------------------------------
  %% Internal functions
  