anchor.diff:  	    %% from the transactionstatelist when we exit).
   	    TPid = erlang:whereis(transaction_layer),
   	    true = link(TPid),
  -	    case init2([Request, SocketIn, Dst, Branch, Timeout, Parent]) of
  +	    %% Link to parent from init/1 instead of using gen_server:start_link to
  +	    %% be able to trap EXIT signals from parent process. See comment in start_link
  +	    %% above for more details.
  +	    true = link(Parent),
  +	    %% Trap exit signals so that we can cancel ongoing INVITEs if our parent dies
  +	    process_flag(trap_exit, true),
  +	    case init2([Request, SocketIn, Dst, Branch, Timeout, ReportTo, Parent]) of
   		{ok, State, Timeout} when is_record(State, state) ->
   		    {ok, State, Timeout};
   		Reply ->
  
positive.code: %%--------------------------------------------------------------------
  %% External exports
  -export([
  	 start/6,
  	 test/0
  	]).
  
  
negative.code:     State = #state{branch=Branch, logtag=LogTag, socket=SocketIn, request=Request,
  		   sipstate=SipState, timerlist=siptimer:empty(),
  		   dst=Dst, socket_in=SocketIn, timeout=Timeout,
  		   parent=Parent, report_to=ReportTo},
      logger:log(debug, "~s: Started new client transaction for request ~s ~s~n(dst ~s).",
  	       [LogTag, Method, sipurl:print(URI), sipdst:dst2str(Dst)]),
      %% Timeout 0 so that the spawned process immediately gets a timeout signal
  