This example shows how to retrieve the RoChargingResults object returned by the sendCCInitial.
In the following snippet, the client application retrieves the RoChargingResults object returned by the sendCCInitial method and examines key pieces of information. In this example, the RoChargingResults object indicates that the Online Charging System (OCS) has granted 60 seconds of Time Quota at the cost of 3 US dollars per minute. The client can request 30 more seconds of Time Quota before reauthorization is required.
RoChargingResults roChargingResults = svc.sendCCInitial(roChargingInfo); MultipleServicesCreditControl mscc = roResult.getMultipleServicesCreditControl(); //The client can request 30 more seconds of Time Quota before Reauthorization is required. Integer timeQuotaThresh = mscc.getTimeQuotaThreshold(); //Example value = 30. //The client has been granted 60 seconds of Time Quota. GrantedServiceUnit gsu = mscc.getGrantedServiceUnit(); Integer grantedTimeUnits = gsu.getCcTime(); //Example value = 60 //Unit cost is 3 US Dollars per minute CostInformation costInfo = roResult.getCostInformation(); String costUnit = costInfo.getCostUnit(); //Example value = "Access to this service is 3.00 a minute." Integer currencyCode = costInfo.getCurrencyCode(); //Example Value = 840 (USD) UnitValue unitValue = costInfo.getUnitValue(); Integer exponent = unitValue.getExponent(); //Example value = 1 Long valueDigits = unitValue.getValueDigits(); //Example value = 3 //The application uses the retrieved information to manage the credit control session. processRoChargingResults(...);