anchor.diff:  
   
   -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}.
  -
  -%% @doc Automatic handling of 3xx responses (redirects)
  -%% @end
  --spec handle_redirect(term(), #sip_message{}, #sip_ua_state{}) -> any().
  -handle_redirect(_UserData, Msg, State) ->
  -    % automatic handling of redirects
  -    TxKey = sip_transaction:tx_key(client, Msg),
  -
  -    % collect new URIs
  -    ReqInfo = dict:fetch(TxKey, State#sip_ua_state.requests),
  -    % FIXME: handle expires & q
  -    % add {URI, false} (only if not present already)
  -    CollectFun =
  -        fun (Contact, Targets) ->
  -                 orddict:update(Contact#sip_hdr_address.uri, fun (V) -> V end, false, Targets)
  -        end,
  -    % go through Contact: headers and add URIs to our current redirect set
  -    NewTargetSet = sip_message:foldl_headers('contact', CollectFun, ReqInfo#req_info.target_set, Msg),
  -    ReqInfo2 = ReqInfo#req_info{target_set = NewTargetSet, destinations = []},
  -    Transactions2 = dict:store(TxKey, ReqInfo2, State#sip_ua_state.requests),
  -
  -    % try next destination, was redirected
  -    next_destination(no_more_destinations, ReqInfo2, State#sip_ua_state{requests = Transactions2}).
   
   %%-----------------------------------------------------------------
   %% Internal functions
  
positive.code: %% @private
  -spec handle_cast(_, #sip_ua_state{}) -> any().
  handle_cast({send, ReqInfo}, State) ->
      next_destination(none, ReqInfo, State);
  handle_cast(_Req, State) ->
     {stop, unexpected, State}.
  
  
negative.code:     ReqInfo2 = ReqInfo#req_info{destinations = Fallback},
      Dict = dict:store(TxKey, ReqInfo2, State#sip_ua_state.requests),
      {noreply, State#sip_ua_state{requests = Dict}}.
  
  %% @doc Automatic handling of 3xx responses (redirects)
  %% @end
  -spec process_redirect(#sip_message{}, #sip_ua_state{}) -> any().
  process_redirect(Msg, State) ->
      TxKey = sip_transaction:tx_key(client, Msg),
  
      % collect new URIs
      ReqInfo = dict:fetch(TxKey, State#sip_ua_state.requests),
      % FIXME: handle expires & q
      % add {URI, false} (only if not present already)
      CollectFun =
          fun (Contact, Targets) ->
                   orddict:update(Contact#sip_hdr_address.uri, fun (V) -> V end, false, Targets)
          end,
      % go through Contact: headers and add URIs to our current redirect set
      NewTargetSet = sip_message:foldl_headers('contact', CollectFun, ReqInfo#req_info.target_set, Msg),
      ReqInfo2 = ReqInfo#req_info{target_set = NewTargetSet, destinations = []},
      Transactions2 = dict:store(TxKey, ReqInfo2, State#sip_ua_state.requests),
  
      % try next destination, was redirected
      send_to_next(no_more_destinations, ReqInfo2, State#sip_ua_state{requests = Transactions2}).
  
  count_via(Msg) ->
      Fun = fun ({'via', List}, Acc) when is_list(List) -> Acc + length(List);
  