anchor.diff:  %%            NewState = #state{}
   %%
   %% @doc     Our server transaction has been cancelled. Signal the
  -%%          client transaction.
  +%%          current client transaction, if any.
   %% @end
   %%--------------------------------------------------------------------
   cancel_transaction(#state{cancelled = false} = State, Reason, ExtraHeaders) when is_list(Reason) ->
  +    Pid = State#state.clienttransaction_pid,
       logger:log(debug, "sippipe: Original request has been cancelled, asking current "
   	       "client transaction handler (~p) to cancel, and answering "
   	       "'487 Request Cancelled' to original request",
  -	       [State#state.clienttransaction_pid]),
  -    transactionlayer:cancel_client_transaction(State#state.clienttransaction_pid, Reason, ExtraHeaders),
  +	       [Pid]),
  +    case Pid of
  +	_ when is_pid(Pid) ->
  +	    ok = transactionlayer:cancel_client_transaction(Pid, Reason, ExtraHeaders);
  +	none ->
  +	    %% No current client transaction. We must be out of targets, or we have already
  +	    %% generated a final response. XXX if we have already generated a final response,
  +	    %% we will now ask the server transaction to generate a second one (487), which
  +	    %% it will complain about but it should be harmless. Perhaps we should make
  +	    %% sippipe remember that it has already generated a final response though...
  +	    ok
  +    end,
       transactionlayer:send_response_handler(State#state.serverhandler, 487, "Request Cancelled"),
       State#state{cancelled = true};
  -cancel_transaction(#state{cancelled = true} = State, Reason, _ExtraHeaders) when is_list(Reason) ->
  +cancel_transaction(#state{cancelled = true} = State, _Reason, _ExtraHeaders) ->
       %% already cancelled
       State.
   
  
positive.code: %%                 no description
  -record(state, {branch,			%% string(), current client transaction branch
  		serverhandler,		%% term(), server transaction handle
  		clienttransaction_pid,	%% pid(), current client transaction process
  		request,		%% request record(), the request we are working on
  		dstlist,		%% list() of sipdst record(), our list of destinations for this request
  		timeout,		%% integer(), timeout value for this process and transactions it starts
  
negative.code: 	    Msg = io_lib:format("Did not receive the expected signal : tuple ~p", [Key]),
  	    erlang:error(lists:flatten(Msg))
      end.
  
  %% compare two records element by element and give good information on where they
  %% are not equal
  test_compare_records(R1, R2, ShouldChange) when is_tuple(R1), is_tuple(R2), is_list(ShouldChange) ->
      RecName = element(1, R1),
      Fields = test_record_info(RecName),
      autotest_util:compare_records(R1, R2, ShouldChange, Fields).
  
  %% add more records here when needed
  test_record_info(state) ->
      record_info(fields, state).
  