OSB_LIB::CallAccounting Class Reference

Collaboration diagram for OSB_LIB::CallAccounting:

Collaboration graph
[legend]
List of all members.

Detailed Description

Tracks the processing result of CDR by OSB modules.

Definition at line 69 of file callaccounting.h.

Public Types

Public Member Functions

Static Public Member Functions

Private Member Functions

Private Attributes


Member Typedef Documentation

typedef std::map<Key, Fraction> OSB_LIB::CallAccounting::Counts

STL container used to store the processing result.

Definition at line 102 of file callaccounting.h.

typedef std::pair< Id<RecordStreamInfo>, Result > OSB_LIB::CallAccounting::Key

Key for result list.

Definition at line 100 of file callaccounting.h.


Member Enumeration Documentation

enum OSB_LIB::CallAccounting::Result

Possible processing result.

Enumerator:
caOk  CDRs that are without errors.
caError  CDRs with errors.
caFiltered  CDRs that are discarded.

Definition at line 74 of file callaccounting.h.


Constructor & Destructor Documentation

OSB_LIB::CallAccounting::CallAccounting ( ModuleId  module  ) 

Constructor with processing module.


Member Function Documentation

void OSB_LIB::CallAccounting::add ( Result  result,
const Id< RecordStreamInfo > &  rsId 
)

Add information for a record stream.

Parameters:
result Processing result for rsId.
rsId The id of the CDR's record stream.
The function only takes the id of a record stream, treating both the nominator and denominator as 1.
Call this function for an error raw CDR: such a record will never contain more than 1 CDR of an original record stream.

void OSB_LIB::CallAccounting::add ( Result  result,
const Cdr cdr 
)

Add information for a CDR.

Parameters:
result Processing result for cdr.
cdr CDR to process.

void OSB_LIB::CallAccounting::add ( Result  result,
const CdrList cdrs 
)

Add information for a list of processed CDRs.

Parameters:
result Processing result for cdrs.
cdrs List of CDRs to process.

Key OSB_LIB::CallAccounting::key ( Result  result,
const Id< RecordStreamInfo > &  rsId 
) [inline, private]

Create a list key for result and rsId.

Definition at line 204 of file callaccounting.h.

static Result OSB_LIB::CallAccounting::mkResult ( char  r  )  [static]

Convert one character database code into result.

Parameters:
r One-character database code to convert.
Returns:
The call accounting result.
Exceptions:
OsbException if r is invalid.

ModuleId OSB_LIB::CallAccounting::module (  )  const [inline]

Get processing module of call accounting.

Definition at line 109 of file callaccounting.h.

References module_.

void OSB_LIB::CallAccounting::reset (  ) 

Reset the call accounting information.

Clears counts_.

void OSB_LIB::CallAccounting::save ( const OSB_DB::Session session  ) 

Save the information to the database.

Parameters:
session Database session to use.
If the function succeeds (i.e., does not throw) counts_ is cleared. While this prevent duplicate accounting it also means that the result is lost if session is rolled back.

void OSB_LIB::CallAccounting::subtract ( Result  result,
const Id< RecordStreamInfo > &  rsId 
)

Subtract information for a record stream.

Parameters:
result Processing result for rsId.
rsId The id of the CDR's record stream.
See add(Result, const Id<RecordStreamInfo>&) for more details.

void OSB_LIB::CallAccounting::subtract ( Result  result,
const Cdr cdr 
)

Subtract information for a CDR.

Parameters:
result Processing result for cdr.
cdr CDR to process.

void OSB_LIB::CallAccounting::subtract ( Result  result,
const CdrList cdrs 
)

Subtract information for a list of processed CDRs.

Parameters:
result Processing result for cdrs.
cdrs List of CDRs to process.

static char OSB_LIB::CallAccounting::toChar ( Result  result  )  [static]

Convert Result to one character database code.

Parameters:
result Result value to convert.
Returns:
One character database code.
Exceptions:
OsbException if result is not defined.


Member Data Documentation

Counts OSB_LIB::CallAccounting::counts_ [private]

List to hold accumulated information.

Definition at line 216 of file callaccounting.h.

ModuleId OSB_LIB::CallAccounting::module_ [private]

Module using the call accountion.

Definition at line 214 of file callaccounting.h.

Referenced by module().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:13:45 2006 for OSB Library by  doxygen 1.4.7