anchor.diff:  		'Service-Information' = ServiceInformation,
   		'Service-Context-Id' = SvcContextId,
   		'Event-Timestamp' = EventTimestamp} = Request, SessionId, RequestNum,
  -		[{_, Subscriber} | _] = SubscriberIds, OHost, _DHost, ORealm, _DRealm, _IpAddress, _Port, _Class) ->
  +		[{_, Subscriber} | _] = SubscriberIds, OHost, _, ORealm, _, IpAddress, Port, _) ->
   	try
   		{Direction, Address} = direction_address(ServiceInformation),
   		Destination = get_destination(ServiceInformation),
   		ServiceNetwork = service_network(ServiceInformation),
   		ServiceType = service_type(SvcContextId),
  +		Server = {IpAddress, Port},
   		Timestamp = case EventTimestamp of
   			[{{_, _, _}, {_, _, _}} = TS] ->
   				TS;
   			_ ->
   				calendar:universal_time()
   		end,
  -		case rate(ServiceType, ServiceNetwork, Subscriber, Timestamp,
  -				Address, Direction, initial, SessionId, get_mscc(MSCC1)) of
  +		Amounts = get_mscc(MSCC1),
  +		RfResponse = case rate(ServiceType, ServiceNetwork, Subscriber, Timestamp,
  +				Address, Direction, initial, SessionId, Amounts) of
   			{{MSCC2, ResultCode}, []} ->
   				{ok, MSCC2, ResultCode};
   			{{MSCC2, _}, PLA} when is_list(MSCC2), length(PLA) > 0 ->
  
positive.code: 		'Requested-Action' = [?'3GPP_RO_REQUESTED-ACTION_DIRECT_DEBITING'],
  		'Service-Information' = ServiceInformation,
  		'Service-Context-Id' = SvcContextId} = Request, SessionId,
  		RequestNum, SubscriberIds, OHost, _DHost, ORealm, _DRealm,
  		_IpAddress, _Port, b = _Class) ->
  	try
  		Location = get_service_location(ServiceInformation),
  		Destination = get_destination(ServiceInformation),
  		case post_request_iec(SubscriberIds, SvcContextId,
  				SessionId, [], Location, Destination) of
  			{ok, JSON} ->
  				{struct, _RatedStruct} = mochijson:decode(JSON),
  				diameter_answer(SessionId, [], ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  						OHost, ORealm, RequestType, RequestNum);
  			{error, ReasonCode} ->
  				error_logger:error_report(["Rating Error",
  						{module, ?MODULE}, {error, ReasonCode}]),
  				ok = remove_ref(SessionId),
  				diameter_error(SessionId, ReasonCode,
  						OHost, ORealm, RequestType, RequestNum)
  		end
  	catch
  		_:Reason1 ->
  			error_logger:warning_report(["Unable to process DIAMETER request",
  					{origin_host, OHost}, {origin_realm, ORealm},
  					{request, Request}, {error, Reason1}, {stack, erlang:get_stacktrace()}]),
  			diameter_error(SessionId, ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  					OHost, ORealm, RequestType, RequestNum)
  	end;
  
negative.code: 				Container = build_container(MSCC),
  				NewMSCC = build_mscc(ServiceRating, Container),
  				ok = remove_ref(SessionId),
  				Reply = diameter_answer(SessionId, NewMSCC, ResultCode,
  						OHost, ORealm, RequestType, RequestNum),
  				ok = ocs_log:acct_log(diameter, Server,
  						accounting_event_type(RequestType), Request, Reply, undefined),
  				Reply;
  			{error, Reason} ->
  				error_logger:error_report(["Rating Error",
  						{module, ?MODULE}, {error, Reason},
  						{origin_host, OHost}, {origin_realm, ORealm},
  						{type, accounting_event_type(RequestType)},
  						{subscriber, Subscriber}, {address, Address},
  						{direction, Direction}, {amounts, []}]),
  				ok = remove_ref(SessionId),
  				Reply = diameter_error(SessionId, Reason,
  						OHost, ORealm, RequestType, RequestNum),
  				ok = ocs_log:acct_log(diameter, Server,
  						accounting_event_type(RequestType), Request, Reply, undefined),
  				Reply
  		end
  	catch
  		?CATCH_STACK ->
  