Class CDRModel
- All Implemented Interfaces:
XMLMarshallable,Comparable<CDRModel>
Note
In Telecommunications Industry, a CDR stands for Call Detail Record. It relates to a telephone call.
Structure
Each CDR stored in the BART Database has:
- a unique ID (OID) set by the SAP CC BART Server system during the CDR acquisition processing
- a CDR status
The original CDR includes the following information:
- User Service ID (USID) - the technical identifier of the end customer who consumed a customer service
- Service ID (SID) - the technical identifier of customer service
- Consumption date of the customer service
-
Various service usage characteristics included in a chargeable item as custom properties
- Acquisition date, and rating date
- Batch rating group ID define in SAP CC
- Subscription ID (or provider contract ID) recorded during the CDR consolidation
- Partition ID of the customer master data (subscriber account, provider contract, subscription)
- chargeID in the subscription (or provider contract)
- Numerical error code and its description
- Acquisition ID
- Rating ID
- Source
- Magic number for deduplication function
- PROPERTIES
- SNAPSHOT_ID
- CHARGE_TYPE
The CDR data model defines the content of a consumption detail record in SAP CC BART Server and its back-end database (see the CDR table).
CDR models keep dialing data such as consumption date and user
accesses in database in order to batch charge them on SAP CC systems.
CDRs are linked through all 3 BART processes:
offline acquisition process, consolidation process and batch charging process.
Besides CDRs data, each CDR has a status that evolves during these processes.
CDR Status
STATUS_NEWSTATUS_ERRORSTATUS_RATEDSTATUS_DUPLICATESTATUS_IGNOREDSTATUS_TO_BE_RERATEDSTATUS_NO_PROVISIONINGSTATUS_ONLINE_SUBSCRIPTION
Error Codes
Refer to the SAP Note 1775256 - CDR Error Codes documentation for detailed information about codes resulting from the batch charging processing. This documentation provides action plans to resolve the issues during the batch charging operations.
Implementation in Your Client Application
CDR Offline Acquisition
You develop the initial conversion of the transactional data available in your offline mediation system to the CDR format that SAP CC BART Server can manage during the acquisition process.
In your client application or system, you must set up the following CDR fields with the relevant dialing data:
- Service consumption date
- User service ID (USID) and service ID (SID), which correspond to an access data stored in SAP CC; This access relates to a provider contract or to a subscription.
- Source, which is an optional data and inform the source of the CDRs (e.g.: filename)
- Chargeable item, with the name of one the CDR family, defined in configuration
- Other dialing data used for the rating should be put as property in the chargeable item
You implement
the CDRModel(..) constructor.
- CDR ID, which corresponds to the CDR's unique identifier
- Acquisition date
- Acquisition ID, which corresponds to the acquisition session ID
- Magic number, which identify a CDR among the others
CDR is then inserted in the SAP CC BART database, waiting for business operations: modification, batch charging.
See AcquisitionSessionModel for information about the acquisition process.
Consolidation
During the acquisition process, a consolidation process is done
The consolidation process tries to fetch CDR's subscription information usable for the rating process. It
fills the following fields:
- Subscription ID, which corresponds to the identifier of the root subscription linked with the CDR
- Batch rating group Id, which corresponds to the batch rating group Id of the subscription
- Partition ID, which corresponds to the identifier of the partition of the subscription
- Charge ID, which corresponds to the identifier of the activation charge linked with CDR's access
- CDRs that have been successfully consolidated have the status
STATUS_NEW. - If consolidation failed for these CDRs, their statuses became "no_provisioning" and the batch rating group became -"2".
- If the consolidation is successful, but the CDR's subscription is only online type, the CDR status became
"online subscription" and the CDR batch rating group became "
-1". In those both cases, a manual consolidation is needed before to rate those CDRs. Use the SAP CC BART Tool user interface.
Batch Charging (Rating)
Finally the CDR is rated with the rating process. An application administrator triggers the batch charging operation with the BART Tool user interface.The rating process selects every CDRs with:
- A batch rating group identifier that corresponds to the rating process
- A consumption date before the rating process's max consumption date
- A CDR's status equals to
STATUS_NEWorSTATUS_ERROR
Result:
Following fields will be updated during this process:
- Rating date
- Rating ID, which corresponds to the batch charging (rating) session identifier
STATUS_RATED. When a batch charging (rating) error occured, the status becomes
STATUS_ERROR and the following fields will be filled:
- Error code, which corresponds to BART type of errors
- Error description, which corresponds to the description of this particular errors
RatingSessionModel for information about rating process.
Note
Refer to SAP CC Application Help for more information about the features and processes in SAP Convergent Charging.
Rerating
A CDR can be rerated through the rerating process in case or erroneous CDR, errors in pricing logic, or errors in invoices.In this process, selected already rated and charged CDRs are rerated. This process is completely handled by the SAP CC Core Server system connected to the BART Server system. After the correction of the error, the rerating process includes the re-injection, re-charging, and re-invoicing processes.
CDRs selected for rerating have the status STATUS_TO_BE_RERATED.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="cdr">
<xs:complexType>
<xs:sequence>
<xs:element ref="ci" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="cdrID" type="xs:string"/>
<xs:attribute name="batchRatingGroupId" type="xs:int"/>
<xs:attribute name="userID" type="xs:string" use="required"/>
<xs:attribute name="serviceID" type="xs:string" use="required"/>
<xs:attribute name="subscriptionID" type="xs:string"/>
<xs:attribute name="consumptionDate" type="xs:dateTime" use="required"/>
<xs:attribute name="status" type="cdrStatusType"/>
<xs:attribute name="acquisitionDate" type="xs:dateTime"/>
<xs:attribute name="acquisitionID" type="xs:string"/>
<xs:attribute name="ratingDate" type="xs:dateTime"/>
<xs:attribute name="ratingID" type="xs:string"/>
<xs:attribute name="errorCode" type="xs:string"/>
<xs:attribute name="errorDescription" type="xs:string"/>
<xs:attribute name="source" type="xs:string"/>
<xs:attribute name="magicNumber" type="xs:string"/>
<xs:attribute name="snapshotID" type="xs:int"/>
</xs:complexType>
</xs:element><xs:simpleType name="cdrStatusType">
<xs:restriction base="xs:string">
<xs:enumeration value="new"/>
<xs:enumeration value="error"/>
<xs:enumeration value="rated"/>
<xs:enumeration value="duplicate"/>
<xs:enumeration value="ignored"/>
<xs:enumeration value="to_be_rerated"/>
<xs:enumeration value="no_provisioning"/>
<xs:enumeration value="online_subscription"/>
</xs:restriction>
</xs:simpleType>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intINTERNAL USE ONLY - Reserved for internal usedstatic final intINTERNAL USE ONLY - Reserved for internal usedstatic final longstatic final longINTERNAL USE ONLY - Reserved for internal usedstatic final int3: This CDR status indicates that the CDR is a duplicatestatic final int1: This CDR status indicates that an attempt of batch charging (rating) has been done but an error occured in the SAP Core Server system; See the numerical error code with thegetErrorCode()method.static final int4: This CDR status indicates that the CDR will be ignored by the next rating session.static final int0: This CDR status indicates that the CDR has been correctly acquired and consolidated.static final int7: This CDR status indicates that the CDR has been acquired but not consolidatedstatic final int8: This CDR status indicates that the CDR is linked to an online subscription and not a offline onestatic final int2: This CDR status indicates that the CDR has been successfully rated and charged by the SAP Core Server system responsible for processing the batch charging operations requested by the SAP CC BART Server systemstatic final intDeprecated.- Not use since Highdeal BART Release 1.2 software version - Revoked since version 1.0 of SAP CCstatic final int6: This CDR status indicates that the CDR is selected to be rerated through SAP CC rerating operationstatic final StringThe XML tag name of this data model: "cdr" -
Constructor Summary
ConstructorsConstructorDescriptionCDRModel()Builds an empty CDR modelCDRModel(com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Date consumptionDate, String source) Builds a CDR with a chargeable item (see here), source, and access information; This constructor should be used to implement the acquisition process in your client application via the Message TCP technical interface (see theAcquireCDROpclass) or the HTTP Communication Interface (HCI) technical interface (see theCDRServiceClientclass).CDRModel(Long OID, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Integer batchRatingGroupId, Long subscriptionID, Short partitionID, long suacID, Long chargeID, Date consumptionDate, int status) INTERNAL USE ONLY - Builds a CDR model with rating information.CDRModel(Long OID, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Integer batchRatingGroupId, Long subscriptionID, Short partitionID, Long chargeID, Date consumptionDate, int status) Deprecated.CDRModel(Long OID, Integer batchRatingGroupId, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Long subscriptionID, Short partitionID, long suacID, Long chargeID, Date consumptionDate, Date acquisitionDate, Date ratingDate, int errorCode, String errorDescription, int status, Long acquisitionID, Long ratingID, String source, String magicNumber) INTERNAL USE ONLY - Builds a CDR model with full information.CDRModel(Long OID, Integer batchRatingGroupId, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Long subscriptionID, Short partitionID, Long chargeID, Date consumptionDate, Date acquisitionDate, Date ratingDate, int errorCode, String errorDescription, int status, Long acquisitionID, Long ratingID, String source, String magicNumber) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptioncom.highdeal.pnr.hci.AccessibleChargeType_getOID()Gets the CDR model identifier.intintvoid_setAccessibleChargeType(com.highdeal.pnr.hci.AccessibleChargeType accessibleChargeType) void_setAcquisitionDate(Date acqDate) Sets the acquisition date of the CDR model.void_setAcquisitionID(Long acqID) Sets the acquisition session identifier.voidSets the batch rating group identifiervoid_setCompareKey(Long compareKey) void_setErrorCode(int ratingError) SAP CC BART Server sets up the error code received from SAP CC Core Server.void_setErrorDescription(String description) SAP CC BART Server sets up the error description.void_setMagicNumber(String mNumber) Sets the magic number of the CDR model.voidSets the CDR model identifier.void_setOriginalErrorCode(int ratingError) void_setOriginalErrorDescription(String description) void_setRatingDate(Date ratDate) Sets the CDR model rating date.void_setRatingID(Long ratID) Sets the rating session identifier.void_setSnapshotID(int snapshotID) Sets the snapshot identifier used to rate event.void_setStatus(int s) Sets the CDR status.void_setSubscriptionID(Long subID) Sets the subscription identifier.voidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.intDuplicates a CDR model; The result is a new object with same values, even the CDR ID.Gets the magic number of the CDR model.Gets the acquisition date of the CDR model.Gets the acquisition session identifier.Gets the batch rating group identifier.com.highdeal.pnr.hci.ChargeableItemGets the chargeable item of the CDR model.Gets the charge identifier.Gets the consumption date of the CDR model.intGets the error code.Gets the error description.Gets the magic number of the CDR model.getName()Gets the CDR name.Gets the partition identifier.Gets CDR model rating date.Gets the rating session identifier.Gets the technical ID of the customer service.intGets the snapshot identifier used to rate event.Gets the CDR source.intGets the CDR status.Gets the subscriber account identifierGets the subscription identifier.Gets the user ID.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidSets the CDR to the status "ignored".voidSets the CDR to the status "new".voidsetChargeableItem(com.highdeal.pnr.hci.ChargeableItem item) Sets the chargeable item of the CDR model.voidsetChargeID(Long chargeID) Sets the charge identifier.voidsetConsumptionDate(Date consumptionDate) Sets the consumption date of the CDR model.voidSets CDR name by setting item namevoidsetPartitionID(Short partitionID) Sets the partition identifier.voidsetServiceID(String serviceID) Sets the service ID.voidSets the CDR source.voidsetSuacID(long suacID) Sets the partition identifier.voidSets the user ID.toString()
-
Field Details
-
STATUS_NEW
public static final int STATUS_NEW0: This CDR status indicates that the CDR has been correctly acquired and consolidated. It is stored in the BART Database for further operations (mainly batch charging).- See Also:
-
STATUS_ERROR
public static final int STATUS_ERROR1: This CDR status indicates that an attempt of batch charging (rating) has been done but an error occured in the SAP Core Server system; See the numerical error code with thegetErrorCode()method.- See Also:
-
STATUS_RATED
public static final int STATUS_RATED2: This CDR status indicates that the CDR has been successfully rated and charged by the SAP Core Server system responsible for processing the batch charging operations requested by the SAP CC BART Server system- See Also:
-
STATUS_DUPLICATE
public static final int STATUS_DUPLICATE3: This CDR status indicates that the CDR is a duplicate- See Also:
-
STATUS_IGNORED
public static final int STATUS_IGNORED4: This CDR status indicates that the CDR will be ignored by the next rating session. It has to be manually set- See Also:
-
STATUS_TO_BE_RERATED
public static final int STATUS_TO_BE_RERATED6: This CDR status indicates that the CDR is selected to be rerated through SAP CC rerating operation- See Also:
-
STATUS_NO_PROVISIONING
public static final int STATUS_NO_PROVISIONING7: This CDR status indicates that the CDR has been acquired but not consolidated- See Also:
-
STATUS_ONLINE_SUBSCRIPTION
public static final int STATUS_ONLINE_SUBSCRIPTION8: This CDR status indicates that the CDR is linked to an online subscription and not a offline one- See Also:
-
BRGRP_ONLINE_SUBSCRIPTION
public static final int BRGRP_ONLINE_SUBSCRIPTIONINTERNAL USE ONLY - Reserved for internal used- See Also:
-
BRGRP_NO_PROVISIONING
public static final int BRGRP_NO_PROVISIONINGINTERNAL USE ONLY - Reserved for internal used- See Also:
-
NO_SUBSCRIPTION
public static final long NO_SUBSCRIPTIONINTERNAL USE ONLY - Reserved for internal used- See Also:
-
NO_SUAC_ID
public static final long NO_SUAC_ID- See Also:
-
STATUS_RATING_IN_PROGRESS
Deprecated.- Not use since Highdeal BART Release 1.2 software version - Revoked since version 1.0 of SAP CC- See Also:
-
TAG_NAME
The XML tag name of this data model: "cdr"- See Also:
-
-
Constructor Details
-
CDRModel
public CDRModel()Builds an empty CDR model -
CDRModel
public CDRModel(com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Date consumptionDate, String source) Builds a CDR with a chargeable item (see here), source, and access information; This constructor should be used to implement the acquisition process in your client application via the Message TCP technical interface (see theAcquireCDROpclass) or the HTTP Communication Interface (HCI) technical interface (see theCDRServiceClientclass).- Parameters:
item- The chargeable itemuserID- The user service ID (USID) - a technical key that identifies the end customer of the serviceserviceID- The customer service ID (SID) - a technical key that identifies the customer service or a subserviceconsumptionDate- The service usage datesource- The source information (network element identifier, ...)- See Also:
-
CDRModel
@Deprecated public CDRModel(Long OID, Integer batchRatingGroupId, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Long subscriptionID, Short partitionID, Long chargeID, Date consumptionDate, Date acquisitionDate, Date ratingDate, int errorCode, String errorDescription, int status, Long acquisitionID, Long ratingID, String source, String magicNumber) Deprecated.INTERNAL USE ONLY - Builds a CDR model with full information.This constructor should be reserved for internal use. -
CDRModel
public CDRModel(Long OID, Integer batchRatingGroupId, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Long subscriptionID, Short partitionID, long suacID, Long chargeID, Date consumptionDate, Date acquisitionDate, Date ratingDate, int errorCode, String errorDescription, int status, Long acquisitionID, Long ratingID, String source, String magicNumber) INTERNAL USE ONLY - Builds a CDR model with full information.This constructor should be reserved for internal use. -
CDRModel
@Deprecated public CDRModel(Long OID, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Integer batchRatingGroupId, Long subscriptionID, Short partitionID, Long chargeID, Date consumptionDate, int status) Deprecated.INTERNAL USE ONLY - Builds a CDR model with rating information.This constructor should be reserved for internal use. -
CDRModel
public CDRModel(Long OID, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Integer batchRatingGroupId, Long subscriptionID, Short partitionID, long suacID, Long chargeID, Date consumptionDate, int status) INTERNAL USE ONLY - Builds a CDR model with rating information.This constructor should be reserved for internal use.
-
-
Method Details
-
duplicate
Duplicates a CDR model; The result is a new object with same values, even the CDR ID.- Returns:
- CDRModel The duplicated CDR model
-
setCDRIgnored
public void setCDRIgnored()Sets the CDR to the status "ignored". -
setCDRNew
public void setCDRNew()Sets the CDR to the status "new". -
getAcquisitionDate
Gets the acquisition date of the CDR model.- Returns:
- The acquisition date of the CDR model
-
_setAcquisitionDate
Sets the acquisition date of the CDR model.- Parameters:
acqDate- The acquisition date
-
getAcquisitionID
Gets the acquisition session identifier.- Returns:
- the acquisition session identifier.
-
_setAcquisitionID
Sets the acquisition session identifier.- Parameters:
acqID- the acquisition session identifier
-
getRatingID
Gets the rating session identifier.- Returns:
- the rating session identifier.
-
_setRatingID
Sets the rating session identifier.- Parameters:
ratID- the rating session identifier
-
getConsumptionDate
Gets the consumption date of the CDR model.- Returns:
- the consumption date of the CDR model.
-
setConsumptionDate
Sets the consumption date of the CDR model.- Parameters:
consumptionDate- the consumption date of the CDR model
-
getBatchRatingGroupId
Gets the batch rating group identifier.- Returns:
- the batch rating group identifier.
-
_setBatchRatingGroupId
Sets the batch rating group identifier- Parameters:
bgrp- the batch rating group identifier
-
getMagicNumber
Gets the magic number of the CDR model.- Returns:
- the magic number of the CDR model.
-
get32MagicNumber
Gets the magic number of the CDR model.- Returns:
- the magic number of the CDR model.
-
_getDatabaseMagicNumber
-
_setMagicNumber
Sets the magic number of the CDR model.- Parameters:
mNumber- the magic number
-
getName
Gets the CDR name.- Returns:
- the CDR name.
-
setName
Sets CDR name by setting item name- Parameters:
name- new CDR name- See Also:
-
ChargeableItem.setName(String name)
-
getChargeableItem
public com.highdeal.pnr.hci.ChargeableItem getChargeableItem()Gets the chargeable item of the CDR model.- Returns:
- the chargeable item of the CDR model.
-
setChargeableItem
public void setChargeableItem(com.highdeal.pnr.hci.ChargeableItem item) Sets the chargeable item of the CDR model.- Parameters:
item- the chargeable item
-
_getOID
Gets the CDR model identifier.- Returns:
- the CDR model identifier.
-
_setOID
Sets the CDR model identifier.- Parameters:
oid- the CDR model identifier
-
getRatingDate
Gets CDR model rating date.- Returns:
- the CDR model rating date.
-
_setRatingDate
Sets the CDR model rating date.- Parameters:
ratDate- The rating date
-
getErrorCode
public int getErrorCode()Gets the error code.- Returns:
- The error code
- See Also:
-
_getOriginalErrorCode
public int _getOriginalErrorCode() -
_setErrorCode
public void _setErrorCode(int ratingError) SAP CC BART Server sets up the error code received from SAP CC Core Server.- Parameters:
ratingError- The rating error
-
_setOriginalErrorCode
public void _setOriginalErrorCode(int ratingError) -
getErrorDescription
Gets the error description.- Returns:
- The error description
-
_getOriginalErrorDescription
-
_setErrorDescription
SAP CC BART Server sets up the error description.- Parameters:
description- The error description
-
_setOriginalErrorDescription
-
getServiceID
Gets the technical ID of the customer service.- Returns:
- The service ID
-
setServiceID
Sets the service ID.- Parameters:
serviceID- The service ID
-
getSource
Gets the CDR source.- Returns:
- The currently defined CDR source
-
setSource
Sets the CDR source.- Parameters:
source- The CDR source
-
getStatus
public int getStatus()Gets the CDR status.- Returns:
- The current CDR status
-
_setStatus
public void _setStatus(int s) Sets the CDR status.- Parameters:
s- The new status
-
_getOriginalStatus
public int _getOriginalStatus() -
getUserID
Gets the user ID.- Returns:
- the user ID.
-
setUserID
Sets the user ID.- Parameters:
userID- The user ID
-
getSubscriptionID
Gets the subscription identifier.- Returns:
- The subscription identifier
-
_setSubscriptionID
Sets the subscription identifier.- Parameters:
subID- The subscription identifier
-
getPartitionID
Gets the partition identifier.- Returns:
- The partition identifier
-
setPartitionID
Sets the partition identifier.- Parameters:
partitionID- The partition identifier
-
getSuacID
Gets the subscriber account identifier- Returns:
- The subscriber account identifier
-
setSuacID
public void setSuacID(long suacID) Sets the partition identifier.- Parameters:
partitionID- The partition identifier
-
_setSnapshotID
public void _setSnapshotID(int snapshotID) Sets the snapshot identifier used to rate event.- Parameters:
snapshotID- The snapshot identifier that uses format YYYYMMDD
-
getSnapshotID
public int getSnapshotID()Gets the snapshot identifier used to rate event.- Returns:
- The snapshot identifier that uses format YYYYMMDD
-
getChargeID
Gets the charge identifier.- Returns:
- The charge identifier
-
setChargeID
Sets the charge identifier.- Parameters:
chargeID- The charge identifier
-
toString
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
compareTo
- Specified by:
compareToin interfaceComparable<CDRModel>
-
compareKey
-
_setCompareKey
-
_setAccessibleChargeType
public void _setAccessibleChargeType(com.highdeal.pnr.hci.AccessibleChargeType accessibleChargeType) -
_getAccessibleChargeType
public com.highdeal.pnr.hci.AccessibleChargeType _getAccessibleChargeType()
-