anchor.diff:      [Timeout] = siptimer:extract([timeout], Timer),
       {LogTag, Request} = {State#state.logtag, State#state.request},
       {Method, URI} = {Request#request.method, Request#request.uri},
  -    logger:log(normal, "~s: Sending of ~s ~s timed out after ~s seconds",
  -	       [LogTag, Method, sipurl:print(URI), siptimer:timeout2str(Timeout)]),
  +    WasCancelled = case State#state.do_cancel of
  +		       {true, _EH} ->
  +			   logger:log(normal, "~s: Cancelled request '~s ~s' timed out after ~s seconds",
  +				      [LogTag, Method, sipurl:print(URI), siptimer:timeout2str(Timeout)]),
  +			   true;
  +		       false ->
  +			   logger:log(normal, "~s: Sending of 's ~s' timed out after ~s seconds",
  +				      [LogTag, Method, sipurl:print(URI), siptimer:timeout2str(Timeout)]),
  +			   false
  +		   end,
       case State#state.sipstate of
   	trying ->
   	    fake_request_timeout(State);
  +	calling when WasCancelled == true ->
  +	    %% This INVITE has been cancelled, but we never received a provisional
  +	    %% response so we give up now and pretend we received a '487 Request Terminated'
  +	    fake_request_response(487, "Request Terminated", State);
   	calling ->
   	    fake_request_timeout(State);
   	proceeding when Method == "INVITE" ->
  
positive.code: %%--------------------------------------------------------------------
  %% Function: stop_resendrequest_timer(State)
  %%           State = state record()
  %% Descrip.: Locate and stop any {resendrequest_timeout} siptimers.
  %% Returns : NewState = state record()
  %%--------------------------------------------------------------------
  stop_resendrequest_timer(State) when is_record(State, state) ->
      Request = State#state.request,
      Method = Request#request.method,
      NTList1 = siptimer:cancel_timers_with_appsignal({resendrequest}, State#state.timerlist),
      %% If it is an INVITE, we stop the resendrequest_timeout as well
      %% since an invite have {invite_expire} (Timer C) that takes
      %% care of ending it if nothing more is received.
      NTList2 = case Method of
  		  "INVITE" ->
  		      siptimer:cancel_timers_with_appsignal({resendrequest_timeout}, NTList1);
  		  _ ->
  		      NTList1
  	      end,
      NewState = State#state{timerlist=NTList2},
      NewState.
  
  
negative.code:     {Method, URI} = {Request#request.method, Request#request.uri},
      case Method of
  	"INVITE" ->
  	    case State#state.do_cancel of
  		{true, ExtraHeaders} ->
  		    Response = State#state.response,
  		    {Status, Reason} = {Response#response.status, Response#response.reason},
  		    logger:log(debug, "~s: A previously cancelled transaction (INVITE ~s) "
  			       "entered state 'proceeding' upon receiving a '~p ~s' response. "
  			       "CANCEL ourselves!", [State#state.logtag, sipurl:print(URI), Status, Reason]),
  		    NewState1 = State#state{do_cancel=false},
  		    NewState2 = cancel_request(NewState1, ExtraHeaders),
  		    {NewState2, ignore};
  