anchor.diff:  			throw(undefined_tariff)
   	end;
   rate3(Protocol, Subscriber, _Address, Price, Validity, Flag,
  -		DebitAmounts, ReserveAmounts, SessionAttributes) ->
  +		DebitAmounts, ReserveAmounts, SessionAttributes, Rated) ->
   	rate4(Protocol, Subscriber, Price, Validity, Flag,
  -			DebitAmounts, ReserveAmounts, SessionAttributes).
  +			DebitAmounts, ReserveAmounts, SessionAttributes, Rated).
   %% @hidden
   rate4(_Protocol, #subscriber{enabled = false} = Subscriber, _Price,
  -		_Validity, initial, _DebitAmounts, _ReserveAmounts, SessionAttributes) ->
  +		_Validity, initial, _DebitAmounts, _ReserveAmounts,
  +		SessionAttributes, Rated) ->
   	SessionId = get_session_id(SessionAttributes),
  -	rate6(Subscriber, initial, 0, 0, 0, 0, SessionId);
  +	rate6(Subscriber, initial, 0, 0, 0, 0, SessionId, Rated);
   rate4(radius, Subscriber, Price, Validity,
  -		initial, [], [], SessionAttributes) ->
  +		initial, [], [], SessionAttributes, Rated) ->
   	rate5(Subscriber, Price, Validity, initial,
  -			0, get_reserve(Price), SessionAttributes);
  +			0, get_reserve(Price), SessionAttributes, Rated);
   rate4(radius, Subscriber, #price{units = Units} = Price, Validity,
  -		interim, [], ReserveAmounts, SessionAttributes) ->
  +		interim, [], ReserveAmounts, SessionAttributes, Rated) ->
   	ReserveAmount = case lists:keyfind(Units, 1, ReserveAmounts) of
   		{_, ReserveUnits} ->
   			ReserveUnits + get_reserve(Price);
  
positive.code: 				{0, PriceReserve, Buckets3} ->
  					rate6(Subscriber#subscriber{buckets = Buckets3}, interim,
  							DebitAmount, DebitAmount, ReserveAmount,
  							UnitReserve, SessionId);
  				{0, PriceReserved, Buckets3} ->
  					rate6(Subscriber#subscriber{buckets = Buckets3}, interim,
  							DebitAmount, DebitAmount, ReserveAmount,
  							UnitsReserved + PriceReserved div UnitPrice, SessionId)
  			end;
  		{UnitsCharged, 0, Buckets2} ->
  			PriceChargeUnits = DebitAmount - UnitsCharged,
  
negative.code: 		SessionAttributes :: [tuple()],
  		Type :: octets | seconds,
  		Amount :: integer(),
  		Result :: {ok, Subscriber, Rated} | {out_of_credit, SessionList}
  				| {disabled, SessionList} | {error, Reason},
  		Subscriber :: #subscriber{},
  		Rated :: #rated{},
  		SessionList :: [{pos_integer(), [tuple()]}],
  		Reason :: term().
  %% @doc Handle rating and balance management for used and reserved unit amounts.
  