anchor.diff:      % as formulated in the RFC (section 17.2.1), but we proceed from trying to proceeding
       % on the first 100 Trying. We do this because we don't want to mandate every application
       % to be transaction stateful.
  +    MyToTag = generate_tag(),
       MyState = #state{branch=Branch, logtag=LogTag, socket=Socket, request=Request,
   			sipmethod=Method, sipstate=trying, timerlist=siptimer:empty(),
  -			mode=Mode},
  +			mode=Mode, my_to_tag=MyToTag},
       TransactionPid = sipserver:safe_spawn(fun spawned/2, [MyState, LogStr]),
       TransactionPid.
       
  
positive.code: 			completed ->
  			    logger:log(debug, "~s: Resend after ~p (response to ~s ~s): ~p ~s",
  			    	       [LogTag, siptimer:timeout2str(Timeout), Method, sipurl:print(URI), Status, Reason]),
  			    siprequest:send_proxy_response(State#state.socket, Status, Reason, RHeader, RBody),
  			    NewTimeout = case Method of
  				"INVITE" ->
  				    % Use Timer Value T2 for INVITE responses
  
negative.code: 	    State
      end.
  
  make_response(Status, Reason, RBody, ExtraHeaders, ViaParameters, State) when record(State, state), Status == 100 ->
      siprequest:make_response(Status, Reason, RBody, ExtraHeaders, ViaParameters, State#state.socket, State#state.request);
  
  make_response(Status, Reason, RBody, ExtraHeaders, ViaParameters, State) when record(State, state) ->
      Request = State#state.request,
      {Method, URI, Header, Body} = Request,
      To = keylist:fetch("To", Header),
      Req = case sipheader:get_tag(To) of
  	none ->
  	    {DistplayName, ToURI} = sipheader:to(To),
  	    NewTo = lists:concat([sipheader:to_print({DistplayName, ToURI}), ";tag=",
  	    			  State#state.my_to_tag]),
  	    NewHeader = keylist:set("To", [NewTo], Header),
  	    {Method, URI, NewHeader, Body};
  	_ ->
  	    Request
      end,
      siprequest:make_response(Status, Reason, RBody, ExtraHeaders, ViaParameters, State#state.socket, Req).
  
  generate_tag() ->
      % Erlang guarantees that subsequent calls to now() generate increasing values (on the same node).
      {Megasec, Sec, Microsec} = now(),
      In = lists:concat([node(), Megasec * 1000000 + Sec, 8, $., Microsec]),
      Out = siprequest:make_base64_md5_token(In),
      % RFC3261 #19.3 says tags must have at least 32 bits randomness,
      % don't make them longer than they have to be.
      "yxa-" ++ string:substr(Out, 1, 9).
  