anchor.diff:  			   created -> "Responding";
   			   forwarded -> "Forwarding response"
   		       end,
  -		logger:log(LogLevel, "~s: ~s '~p ~s'",
  -			   [LogTag, What, Status, Reason]),
  -		store_transaction_result(NewSipState, Request, Status, Reason, LogTag),
  +		logger:log(LogLevel, "~s: ~s '~p ~s'", [LogTag, What, Status, Reason]),
  +		case State#state.testing of
  +		    true -> ok;
  +		    false ->
  +			store_transaction_result(NewSipState, Request, Status, Reason, LogTag)
  +		end,
   		{ok, NewState2} = send_response(Response, SendReliably, State),
   		%% Make event out of the fact that we are sending a response
  -		ToTagUsed = sipheader:get_tag(keylist:fetch('to', Response#response.header)),
  -		L = [{to_tag, ToTagUsed}],
  -		event_final_response(State#state.branch, Created, Status, Reason, L),
  +		event_final_response(Created, NewState2, Status),
   		enter_sip_state(NewSipState, NewState2);
   	    E ->
   		logger:log(error, "~s: State machine does not allow us to send '~p ~s' in response to '~s ~s' "
  
positive.code:     {Status, Reason} = {Response#response.status, Response#response.reason},
      logger:log(normal, "~s: Sending of '~p ~s' (response to ~s ~s) timed out after ~s seconds, terminating "
  	       "transaction.", [LogTag, Status, Reason, Method, sipurl:print(URI), siptimer:timeout2str(Timeout)]),
      %% XXX report to TU?
      enter_sip_state(terminated, State);
  
  %%--------------------------------------------------------------------
  
negative.code: 
  %% generate a uas_result event with information about the original request
  %% and the response we are now sending. part of do_response().
  event_final_response(Created, State, Status) when Status >= 200 ->
      Branch = State#state.branch,
      Response = State#state.response,
      {Status, Reason} = {Response#response.status, Response#response.reason},
      ToTagUsed = sipheader:get_tag(keylist:fetch('to', Response#response.header)),
      L = [{to_tag, ToTagUsed}],
      case State#state.testing of
  	true -> ok;
  	false ->
  	    event_handler:uas_result(Branch, Created, Status, Reason, L)
      end;
  event_final_response(_Created, _State, _Status) ->
      %% Don't make events out of every non-final response we send
      ok.
  
  