anchor.diff:      Seq = diameter_session:sequence(),
       Hdr = Hdr0#diameter_header{hop_by_hop_id = Seq},
       Msg = [Hdr, Route | Avps],
  -    resend(call(SvcName, App, Msg, Opts), T, TPid, Pkt).
  +    resend(call(SvcName, App, Msg, Opts), T, TPid, Fs, Pkt).
   %% The incoming request is relayed with the addition of a
   %% Route-Record. Note the requirement on the return from call/4 below,
   %% which places a requirement on the value returned by the
  
positive.code: msg(#diameter_packet{msg = Msg}) ->
      Msg.
  
  %% encode/2
  
  %% Note that prepare_request can return a diameter_packet containing
  
negative.code: is_loop(Code, Vid, OH, Avps) ->
      is_loop(Code, Vid, ?BASE:avp(encode, OH, 'Route-Record'), Avps).
  
  %% reply/5
  %%
  %% Send a locally originating reply.
  
  %% Skip the setting of Result-Code and Failed-AVP's below.
  reply([Msg], Dict, TPid, Fs, Pkt)
    when is_list(Msg);
         is_tuple(Msg) ->
      reply(Msg, Dict, TPid, Fs, Pkt#diameter_packet{errors = []});
  
  %% No errors or a diameter_header/avp list.
  reply(Msg, Dict, TPid, Fs, #diameter_packet{errors = Es,
                                              transport_data = TD}
                             = ReqPkt)
    when [] == Es;
         is_record(hd(Msg), diameter_header) ->
      Pkt = diameter_codec:encode(Dict, make_answer_packet(Msg, ReqPkt)),
      eval_packet(Pkt, Fs),
      incr(send, Pkt, Dict, TPid),  %% count result codes in sent answers
      send(TPid, Pkt#diameter_packet{transport_data = TD});
  
  %% Or not: set Result-Code and Failed-AVP AVP's.
  reply(Msg, Dict, TPid, Fs, #diameter_packet{errors = [H|_] = Es} = Pkt) ->
      reply(rc(Msg, rc(H), [A || {_,A} <- Es], Dict),
            Dict,
            TPid,
            Fs,
            Pkt#diameter_packet{errors = []}).
  
  eval_packet(Pkt, Fs) ->
      lists:foreach(fun(F) -> diameter_lib:eval([F,Pkt]) end, Fs).
      
  %% make_answer_packet/2
  
  %% Binaries and header/avp lists are sent as-is.
  