anchor.diff:  -export([add/7, empty/0, list_length/1, debugfriendly/1,
   	 get_using_branch/2, get_targets_in_state/2, get_responses/1,
   	 extract/2, set_pid/2, set_state/2, set_endresult/2, set_dstlist/2,
  -         update_target/2]).
  +	 set_cancelled/2, update_target/2]).
   
  --record(target, {ref, branch, request, pid, state, timeout, endresult, dstlist}).
  +-record(target, {ref, branch, request, pid, state, timeout, endresult, dstlist, cancelled}).
   -record(targetlist, {list}).
   
   % This module is used by sipproxy to handle a list of actions we are working
  
positive.code:     {Method, URI, _, _} = H#target.request,
      RespStr = case H#target.endresult of
  	none -> "no response";
          cancelled -> "cancelled";
  	{Status, Reason, _, _} ->
  	    lists:concat(["response=", Status, " ", Reason])
      end,
      Str = lists:concat(["pid=", pid_to_list(H#target.pid), "branch=", H#target.branch, ", request=", Method, " ",
  		sipurl:print(URI), ", ", RespStr, ", state=" , H#target.state]),
      lists:append([lists:flatten(Str)], debugfriendly(T)).
  get_using_branch(Branch, TargetList) when record(TargetList, targetlist) ->
      get_using_branch(Branch, TargetList#targetlist.list);
  
negative.code: extract([dstlist | T], Target, Res) when record(Target, target) ->
      extract(T, Target, lists:append(Res, [Target#target.dstlist]));
  extract([endresult | T], Target, Res) when record(Target, target) ->
      extract(T, Target, lists:append(Res, [Target#target.endresult]));
  extract([cancelled | T], Target, Res) when record(Target, target) ->
      extract(T, Target, lists:append(Res, [Target#target.cancelled])).
  
  set_pid(Target, Value) when record(Target, target) ->
      Target#target{pid=Value}.
  