anchor.diff:  				Reply :: #'3gpp_ro_CCA'{}.
   %% @doc Send CCA to DIAMETER client indicating a successful operation.
   %% @hidden
  -generate_diameter_answer(Request, SId, _Subscriber, Balance, ResultCode, OHost,
  +generate_diameter_answer(Request, SId, _Subscriber, GrantedUnits, ResultCode, OHost,
   		ORealm, AuthAppId, RequestType, RequestNum, #state{address = Address,
   		port = Port} = State) ->
  -	GrantedUnits = #'3gpp_ro_Granted-Service-Unit'{'CC-Total-Octets' = [Balance]},
   	MultiServices_CC = #'3gpp_ro_Multiple-Services-Credit-Control'{
   			'Granted-Service-Unit' = [GrantedUnits]},
   	Reply = #'3gpp_ro_CCA'{'Session-Id' = SId, 'Result-Code' = ResultCode,
  
positive.code: 		DebitAmount = [{UsedType, UsedUsage}],
  		case ocs_rating:rate(Subscriber, final, DebitAmount, []) of
  			{ok, _, GrantedAmount} ->
  				{Reply, NewState} = generate_diameter_answer(Request, SId, Subscriber,
  						GrantedAmount, ?'DIAMETER_BASE_RESULT-CODE_SUCCESS', OHost, ORealm,
  						?RO_APPLICATION_ID, RequestType, RequestNum, State),
  				{reply, Reply, NewState};
  			{out_of_credit, SL} ->
  
negative.code: 	ReserveAmount = [{ReqUsageType, ReqUsage}],
  	case ocs_rating:rate(Subscriber, inital, [], ReserveAmount, SessionAttributes) of
  		{ok, _, GrantedAmount} ->
  			GrantedUnits = case ReqUsageType of
  				seconds ->
  					#'3gpp_ro_Granted-Service-Unit'{'CC-Time' = [GrantedAmount]};
  				octets ->
  					#'3gpp_ro_Granted-Service-Unit'{'CC-Total-Octets' = [GrantedAmount]}
  			end,
  			{Reply, NewState} = generate_diameter_answer(Request, SId, Subscriber,
  					GrantedUnits, ?'DIAMETER_BASE_RESULT-CODE_SUCCESS', OHost, ORealm,
  					?RO_APPLICATION_ID, RequestType, RequestNum, State),
  			{reply, Reply, NewState};
  		{out_of_credit, SL} ->
  