WebSphere brand IBM WebSphere IP Multimedia Subsystem Connector, Version 6.2

Update Credit Control Session with sendCCUpdate

This example shows how to update a credit control session by invoking sendCCUpdate.

In the following snippet, the client application updates a credit control session by constructing a RoChargingInfo object and invoking sendCCUpdate. It is assumed that the client has processed the credit control session information returned in RoChargingResults, as an outcome of the sendCCInitial operation. In this example, the client requests 30 additional seconds of Time quota and reports that 25 seconds of Time quota has been used since the initial request.

Example

RoChargingInfo roChargingInfo = new RoChargingInfo();

		//Set the Session-Id to a unique identifier.
		roChargingInfo.setSessionId("FQDNServerName:servicexyz:session00001");
		//Set the Destination-Realm of the OCS, which should match a route name in the Diameter_Ro.properties file.
		roChargingInfo.setDestinationRealm("emulators.example.com");
		//Increment the CC-Request-Number for each additional update request.
		roChargingInfo.setCcRequestNumber(1);
		roChargingInfo.setServiceContextId("12345@example.com");

		SubscriptionId subId = new SubscriptionId();
		subId.setSubscriptionIdData("id0001");
		subId.setSubscriptionIdType(SubscriptionIdType.END_USER_IMSI);
		roChargingInfo.setSubscriptionId("12345@example.com);

		MultipleServicesCreditControl mscc = new MultipleServicesCreditControl();

		//Request additional quota in time units.
		RequestedServiceUnit rsu = new RequestedServiceUnit();
		rsu.setCcTime(30);
		mscc.setRequestedServiceUnit(rsu);

		//Report used quota in time units.
		UsedServiceUnit usu = new UsedServiceUnit();
		usu.setCcTime(25);
		mscc.setUsedServiceUnits(new UsedServiceUnit[]{usu});
		roChargingInfo.setMultipleServicesCreditControl(mscc);

		RoChargingResults roChargingResults = svc.sendCCUpdate(roChargingInfo);



Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.