anchor.diff:  	    % RFC 3261 16.7 bullet 5 (Check response for forwarding) says we MUST process any
   	    % response chosen for immediate forwarding as described in
   	    % "Aggregate Authorization Header Field Values" through "Record-Route"
  +	    % XXX but it is a bit unclear to me if this is actually just to be done in FINAL responses or not
   	    Targets = NewState#state.targets,
   	    Responses = targetlist:get_responses(Targets),
   	    FwdResponse = aggregate_authreqs(Response, Responses),
  
positive.code: 	    NewState1 = State#state{targets=NewTargets, mystate=NewMyState},
  	    {ok, NewState1};
  
  	{branch_result, Branch, NewTransactionState, Response, ResponseToRequest} ->
  	    {ResponseToMethod, ResponseToURI, _, _} = ResponseToRequest,
  	    {Status, Reason, _, _} = Response,
  	    NewState1 = case targetlist:get_using_branch(Branch, Targets) of
  		none ->
  		    logger:log(error, "sipproxy: Received branch result ~p ~s to ~s ~s from an unknown Target (branch ~p), ignoring.",
  		    			[Status, Reason, ResponseToMethod, sipurl:print(ResponseToURI), Branch]),
  		    State;
  		ThisTarget ->
  		    NewTarget1 = targetlist:set_state(ThisTarget, NewTransactionState),
  		    NewTarget2 = targetlist:set_endresult(NewTarget1, Response),	% XXX only do this for final responses?
  		    NewTargets1 = targetlist:update_target(NewTarget2, Targets),
  		    NewTargets = try_next_destination(Response, ThisTarget, NewTargets1, State),
  		    logger:log(debug, "sipproxy: Received branch result ~p ~s to ~s ~s from branch ~p. My Targets-list now contain :~n~p",
  		    		[Status, Reason, ResponseToMethod, sipurl:print(ResponseToURI), Branch, targetlist:debugfriendly(NewTargets)]),
  		    NewState2 = State#state{targets=NewTargets},
  		    NewState3 = check_forward_immediately(ResponseToRequest, Response, Branch, NewState2),
  		    NewState4 = cancel_pending_if_invite_2xx_or_6xx(ResponseToMethod, Status, NewState3),
  		    NewState4
  	    end,
  	    {ok, NewState1};
  
negative.code: mark_cancelled([], TargetList) ->
      TargetList;
  mark_cancelled([H | T], TargetList) ->
      NewTarget = targetlist:set_cancelled(H, true),
      NewTargetList = targetlist:update_target(NewTarget, TargetList),
      mark_cancelled(T, NewTargetList).
  
  