anchor.diff:      %% XXX is the 32 * T1 correct for CANCEL?
       case transactionlayer:start_client_transaction(CancelRequest, Socket, Dst, Branch, 32 * T1, none) of
   	P when is_pid(P) ->
  -	    logger:log(debug, "~s: Started CANCEL client transaction with pid ~p", [LogTag, P]);
  +	    logger:log(debug, "~s: Started CANCEL client transaction with pid ~p", [LogTag, P]),
  +	    NewState#state{cancel_pid=P};
   	{error, E} ->
   	    %% XXX what to do here?
  -	    logger:log(error, "~s: Failed starting CANCEL client transaction : ~p", [LogTag, E])
  -    end,
  -    NewState.
  +	    logger:log(error, "~s: Failed starting CANCEL client transaction : ~p", [LogTag, E]),
  +	    NewState
  +    end.
   
   %%--------------------------------------------------------------------
   %% Function: update_invite_expire(Status, State)
  
positive.code: %% if so return {stop ...}
  check_quit(Res, From) ->
      case Res of
  	{_, _, State, _} when is_record(State, state) ->
  	    check_quit2(Res, From, State);
  	{_, _, State} when is_record(State, state) ->
  	    check_quit2(Res, From, State);
  	{_, State, _} when is_record(State, state) ->
  	    check_quit2(Res, From, State);
  	{_, State} when is_record(State, state) ->
  	    check_quit2(Res, From, State);
  	_ ->
  	    Res
      end.
  
  check_quit2(Res, From, #state{sipstate=terminated}=State) ->
      RStr = case State#state.response of
  	       Re when is_record(Re, response) ->
  		   io_lib:format("last received response was ~p ~s", [Re#response.status, Re#response.reason]);
  	       undefined ->
  		   "no responses received"
  	   end,
  
negative.code: %%--------------------------------------------------------------------
  %% External exports
  -export([
  	 start_link/6,
  	 test/0
  	]).
  
  