Search in sources :

Example 1 with CcRequestType

use of net.java.slee.resource.diameter.cca.events.avp.CcRequestType in project charging-server by RestComm.

the class DiameterChargingServerSbb method buildCCInfo.

private CreditControlInfo buildCCInfo(RoCreditControlRequest ccr, String endUserId, SubscriptionIdType endUserType, ArrayList<CreditControlUnit> ccUnits) {
    // Build Credit Control Info Request to ABMF
    CreditControlInfo ccInfo = new CreditControlInfo();
    ccInfo.setEventTimestamp(System.currentTimeMillis());
    CcRequestType type = ccr.getCcRequestType();
    ccInfo.setEventType(type.toString());
    if (type == CcRequestType.EVENT_REQUEST) {
        ccInfo.setRequestedAction(ccr.getRequestedAction());
    }
    ccInfo.setRequestNumber((int) ccr.getCcRequestNumber());
    ccInfo.setSessionId(ccr.getSessionId());
    ccInfo.setSubscriptionId(endUserId);
    ccInfo.setSubscriptionIdType(endUserType);
    ccInfo.setCcUnits(ccUnits);
    // Iterate CCR to capture needed AVPs
    for (DiameterAvp avp : ccr.getAvps()) {
        fetchDataFromAvp(avp, ccInfo);
    }
    return ccInfo;
}
Also used : CreditControlInfo(org.mobicents.charging.server.account.CreditControlInfo) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) CcRequestType(net.java.slee.resource.diameter.cca.events.avp.CcRequestType)

Aggregations

DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 CcRequestType (net.java.slee.resource.diameter.cca.events.avp.CcRequestType)1 CreditControlInfo (org.mobicents.charging.server.account.CreditControlInfo)1