anchor.diff:      logger:log(debug, "~s: Marked transaction as cancelled", [LogTag]),
       case Method of
   	"INVITE" ->
  -	    SipState = NewState1#state.sipstate,
  -	    case SipState of
  +	    case NewState1#state.sipstate of
   		calling ->
  -		    logger:log(debug, "~s: Stopping resend of INVITE ~s, but NOT starting CANCEL client transaction " ++
  +		    logger:log(debug, "~s: Stopping resend of INVITE ~s, but NOT starting CANCEL client transaction "
   			       "right now since we are in state 'calling'", [LogTag, sipurl:print(URI)]),
  -		    NewState2 = stop_resendrequest_timer(NewState1),
  -		    NewState3 = NewState2#state{do_cancel={true, ExtraHeaders}},
  +		    NewState2 = NewState1#state{do_cancel={true, ExtraHeaders}},
  +		    NewState3 = stop_resendrequest_timer(NewState2),
   		    NewState3;
   		proceeding ->
   		    logger:log(debug, "~s: Stopping resends of INVITE ~s and starting a CANCEL client transaction",
  
positive.code:     {Method, URI} = {Request#request.method, Request#request.uri},
      case Method of
  	"INVITE" ->
  	    LogTag = State#state.logtag,
  	    Response = State#state.response,
  	    {Status, Reason} = {Response#response.status, Response#response.reason},
  	    case State#state.do_cancel of
  		{true, ExtraHeaders} ->
  		    logger:log(debug, "~s: A previously cancelled transaction (INVITE ~s) "
  			       "entered state 'proceeding' upon receiving a '~p ~s' response. "
  			       "CANCEL ourselves!", [LogTag, sipurl:print(URI), Status, Reason]),
  		    NewState1 = State#state{do_cancel=false},
  		    NewState2 = cancel_request(NewState1, ExtraHeaders),
  		    {NewState2, ignore};
  
negative.code: end_invite(State) when is_record(State, state) ->
      Request = State#state.request,
      URI = Request#request.uri,
      LogTag = State#state.logtag,
      case State#state.sipstate of
  	calling ->
  	    fake_request_timeout(State);
  	proceeding ->
  	    logger:log(debug, "~s: Sending of request (INVITE ~s) timed out in state 'proceeding' - cancel request "
  		       "(by starting a separate CANCEL transaction)", [LogTag, sipurl:print(URI)]),
  	    cancel_request(State);
  	SipState ->
  	    logger:log(debug, "~s: Sending of request (INVITE ~s) timed out in state '~s' - ignoring.",
  		       [LogTag, sipurl:print(URI), SipState]),
  	    State
  