anchor.diff:      NewTargets = cancel_pending_targets(State#state.targets),
       State#state{targets=NewTargets}.
   
  +%%--------------------------------------------------------------------
  +%% Function: printable_responses(Responses)
  +%%           Responses = list() of response record()
  +%% Descrip.: Format a list of responses for (debug) logging.
  +%% Returns : list() of string()
  +%%--------------------------------------------------------------------
   printable_responses([]) ->
       [];
   printable_responses([H | Rest]) when is_record(H, response) ->
  
positive.code: -module(sipproxy).
  -export([start/5]).
  
  -include("sipproxy.hrl").
  -include("siprecords.hrl").
  
  -record(state, {parent, branchbase, request, actions, targets, endtime, final_response_sent, mystate, approx_msgsize, timeout}).
  % mystate is either calling, cancelled, completed or stayalive
  
  % This is the "start" function of sipproxy. sipproxy can fork a request
  % according to a list of sipproxy_action elements.
  %
  % You start it by calling the start() method with a set of Actions. Currenly
  % supported actions are a list of 'call' and 'wait'. You can mix calls and
  % waits freely.
  
  start(BranchBase, Parent, Request, Actions, Timeout) when record(Request, request) ->
      Res = case catch siprequest:check_proxy_request(Request) of
  	      {ok, _, ApproxMsgSize} ->
  		  %% sipproxy should never be invoked on a request that contains
  
negative.code: 	    end
      end.
  
  %%--------------------------------------------------------------------
  %% Function: cancel_pending_targets(Targets)
  %%           Targets = targetlist record()
  %% Descrip.: Cancel all targets in state 'proceeding'.
  %% Returns : NewTargets = targetlist record()
  %%--------------------------------------------------------------------
  cancel_pending_targets(Targets) ->
      %% send {cancel} to all PIDs in states other than completed and terminated
      NewTargets1 = cancel_targets_state(Targets, calling),
      cancel_targets_state(NewTargets1, proceeding).
  
  %%--------------------------------------------------------------------
  %% Function: cancel_targets_state(Targets, TargetState)
  %%           Targets     = targetlist record()
  %%           TargetState = atom()
  %% Descrip.: Cancel all targets in state TargetState.
  %% Returns : NewTargets = targetlist record()
  %%--------------------------------------------------------------------
  cancel_targets_state(Targets, TargetState) when is_atom(TargetState) ->
      %% send {cancel} to all PIDs in a specific State, return updated TargetList
      TargetsInState = targetlist:get_targets_in_state(TargetState, Targets),
      lists:map(fun(ThisTarget) ->
  		      [Pid] = targetlist:extract([pid], ThisTarget),
  		      gen_server:cast(Pid, {cancel, "cancel_targets_state"})
  	      end, TargetsInState),
      NewTargets = mark_cancelled(TargetsInState, Targets),
      NewTargets.
  
  %%--------------------------------------------------------------------
  %% Function: mark_cancelled(Targets, TargetList)
  %%           Targets    = list() of term()
  %%           TargetList = targetlist record()
  %% Descrip.: Marks a number of targets (Targets) as cancelled.
  %% Returns : NewTargets = targetlist record()
  %%--------------------------------------------------------------------
  mark_cancelled([], TargetList) ->
      TargetList;
  mark_cancelled([H | T], TargetList) ->
  