anchor.diff: +%%--------------------------------------------------------------------
   %%% File    : sippipe.erl
   %%% Author  : Fredrik Thulin <ft@it.su.se>
  -%%% Description : Try a given set of destinations sequentially
  -%%%               until we get a final response from one or them,
  -%%%               or have no destinations left to try.
  +%%% Descrip.: Try a given set of destinations sequentially until we
  +%%%           get a final response from one or them, or have no
  +%%%           destinations left to try.
   %%%
   %%% Created :  20 Feb 2004 by Fredrik Thulin <ft@it.su.se>
  -
  +%%--------------------------------------------------------------------
   -module(sippipe).
  --export([start/5]).
  -
  --record(state, {branch, serverhandler, clienthandler, request, dstlist, timeout, starttime, endtime, warntime, approxmsgsize}).
  -
  +
  +%%--------------------------------------------------------------------
  +%% External exports
  +%%--------------------------------------------------------------------
  +-export([
  +	 start/5
  +	]).
  +
  +%%--------------------------------------------------------------------
  +%% Include files
  +%%--------------------------------------------------------------------
   -include("sipsocket.hrl").
   -include("siprecords.hrl").
  +
  +%%--------------------------------------------------------------------
  +%% Records
  +%%--------------------------------------------------------------------
  +-record(state, {branch,
  +		serverhandler,
  +		clienthandler,
  +		request,
  +		dstlist,
  +		timeout,
  +		starttime,
  +		endtime,
  +		warntime,
  +		approxmsgsize
  +	       }).
  +
  +%%====================================================================
  +%% External functions
  +%%====================================================================
   
   %%--------------------------------------------------------------------
   %% Function: start(ServerHandler, ClientPid, Request, Dst, Timeout)
  
positive.code:     {tick, State}.
  
  
  %% Function: process_client_transaction_response/2
  %% Description: We have received a response. Check if we should do
  %%              something.
  %% Returns: New State
  %%--------------------------------------------------------------------
  process_client_transaction_response(Response, State) when is_record(Response, response), is_record(State, state), Response#response.status >= 200 ->
      logger:log(debug, "sippipe: Received final response '~p ~s'", [Response#response.status, Response#response.reason]),
      %% This is a final response. See if local:sippipe_received_response() has an oppinion on what
      %% we should do next.
      case local:sippipe_received_response(State#state.request, Response, State#state.dstlist) of
  
negative.code: 										     is_record(Dst, sipdst) ->
      {ok, DstList, Request}.
  
  %%--------------------------------------------------------------------
  %% Function: start_get_servertransaction(ServerHandler, Request)
  %%           ServerHandler = none | term(), server transaction handle
  %%           Request       = request record()
  %% Descrip.: Assure we have a working server transaction handle.
  %%           Either we get one as ServerHandler argument, or we try to
  %%           find one using the transaction layer. If the server
  %%           transaction has already been cancelled, we return 'ok'.
  %% Returns : {ok, STHandler, Branch} |
  %%           ok                      |
  %%           error
  %%           STHandler = term()
  %%           Branch    = string()
  %%--------------------------------------------------------------------
  start_get_servertransaction(none, Request) when is_record(Request, request) ->
      %% No server transaction handler supplied. Try to find a valid handler using the request.
      case transactionlayer:get_handler_for_request(Request) of
  