CallStateEventBuilder_DB Class Reference

#include <CallStateEventBuilder_DB.h>

Inheritance diagram for CallStateEventBuilder_DB:

CallStateEventBuilder

List of all members.


Detailed Description

This CallStateEventBuilder constructs events as database rows according to the specification doc/cdr/call-state-events.html.

for usage of the event generation interfaces, see CallStateEventBuilder

Public Member Functions

 CallStateEventBuilder_DB (const char *observerDnsName)
 Instantiate an event builder and set the observer name for its events.
virtual ~CallStateEventBuilder_DB ()
 Destructor.
void observerEvent (int sequenceNumber, const OsTime &timestamp, ObserverEvent eventCode, const char *eventMsg)
 Generate a metadata event.
void callRequestEvent (int sequenceNumber, const OsTime &timestamp, const UtlString &contact, const UtlString &references, const UtlString &branch_id, int via_count, const bool callerInternal)
 Begin a Call Request Event - an INVITE without a to tag has been observed.
void callSetupEvent (int sequenceNumber, const OsTime &timestamp, const UtlString &contact, const UtlString &calleeRoute, const UtlString &branch_id, int via_count)
 Begin a Call Setup Event - a 2xx response to an INVITE has been observed.
void callFailureEvent (int sequenceNumber, const OsTime &timestamp, const UtlString &branch_id, int via_count, int statusCode, const UtlString &statusMsg)
 Begin a Call Failure Event - an error response to an INVITE has been observed.
void callEndEvent (int sequenceNumber, const OsTime &timestamp)
 Begin a Call End Event - a BYE request has been observed.
void callTransferEvent (int sequenceNumber, const OsTime &timeStamp, const UtlString &contact, const UtlString &refer_to, const UtlString &referred_by, const UtlString &request_uri)
 Begin a Call transfer event - a REFER event has been observed.
void addCallData (const int cseqNumber, const UtlString &callId, const UtlString &fromTag, const UtlString &toTag, const UtlString &fromField, const UtlString &toField)
 Add the dialog and call information for the event being built.
void addEventVia (const UtlString &via)
 Add a via element for the event.
void completeCallEvent ()
 Indicates that all information for the current call event has been added.
bool finishElement (UtlString &event)
 Copies the element into the provided UtlString.

Private Member Functions

void newEvent (int sequenceNumber, const OsTime &timestamp, const char *elementStart, const char eventType= '-')
void reset ()
 Clears all the object state.
void replaceSingleQuotes (const UtlString &value, UtlString &newValue)
 CallStateEventBuilder_DB (const CallStateEventBuilder_DB &rCallStateEventBuilderDB)
 no copy constructor or assignment operator
CallStateEventBuilder_DB operator= (const CallStateEventBuilder_DB &rCallStateEventBuilderDB)

Private Attributes

UtlString mCurrentEvent
UtlString mCallInfo
UtlString mReferHeader
UtlString mLaterElement
UtlString mContactElement
UtlString mReferElement
UtlString mFailureElement
UtlString mViaHeader
UtlString mEndElement
UtlString mRequestUri
UtlString mReferences
UtlString mCallerInternal
UtlString mCalleeRoute
UtlString mBranchId
UtlString mViaCount
bool mEventComplete


Constructor & Destructor Documentation

CallStateEventBuilder_DB ( const char *  observerDnsName  ) 

Instantiate an event builder and set the observer name for its events.

Parameters:
observerDnsName  the DNS name to be recorded in all events

~CallStateEventBuilder_DB (  )  [virtual]

Destructor.

CallStateEventBuilder_DB ( const CallStateEventBuilder_DB rCallStateEventBuilderDB  )  [private]

no copy constructor or assignment operator


Member Function Documentation

void observerEvent ( int  sequenceNumber,
const OsTime timestamp,
ObserverEvent  eventCode,
const char *  eventMsg 
) [virtual]

Generate a metadata event.

This method generates a complete event - it does not require that the callEventComplete method be called.

Parameters:
sequenceNumber  for ObserverReset, this should be zero
timestamp  obtain using getCurTime(OsTime)
eventMsg  for human consumption

Reimplemented from CallStateEventBuilder.

void callRequestEvent ( int  sequenceNumber,
const OsTime timestamp,
const UtlString contact,
const UtlString references,
const UtlString branch_id,
int  via_count,
const bool  callerInternal 
) [virtual]

Begin a Call Request Event - an INVITE without a to tag has been observed.

Requires:

  • callRequestEvent
  • addCallData (the toTag in the addCallRequest will be a null string)
  • addEventVia (at least for via index zero)
  • completeCallEvent
Parameters:
timestamp  obtain using getCurTime(OsTime)

Reimplemented from CallStateEventBuilder.

void callSetupEvent ( int  sequenceNumber,
const OsTime timestamp,
const UtlString contact,
const UtlString calleeRoute,
const UtlString branch_id,
int  via_count 
) [virtual]

Begin a Call Setup Event - a 2xx response to an INVITE has been observed.

Requires:

  • callSetupEvent
  • addCallData
  • addEventVia (at least for via index zero)
  • completeCallEvent
Parameters:
timestamp  obtain using getCurTime(OsTime)

Reimplemented from CallStateEventBuilder.

void callFailureEvent ( int  sequenceNumber,
const OsTime timestamp,
const UtlString branch_id,
int  via_count,
int  statusCode,
const UtlString statusMsg 
) [virtual]

Begin a Call Failure Event - an error response to an INVITE has been observed.

Requires:

  • callFailureEvent
  • addCallData
  • addEventVia (at least for via index zero)
  • completeCallEvent
Parameters:
timestamp  obtain using getCurTime(OsTime)

Reimplemented from CallStateEventBuilder.

void callEndEvent ( int  sequenceNumber,
const OsTime timestamp 
) [virtual]

Begin a Call End Event - a BYE request has been observed.

Requires:

  • callEndEvent
  • addCallData
  • addEventVia (at least for via index zero)
  • completeCallEvent
Parameters:
timestamp  obtain using getCurTime(OsTime)

Reimplemented from CallStateEventBuilder.

void callTransferEvent ( int  sequenceNumber,
const OsTime timeStamp,
const UtlString contact,
const UtlString refer_to,
const UtlString referred_by,
const UtlString request_uri 
) [virtual]

Begin a Call transfer event - a REFER event has been observed.

Begin a Call Transfer Event - a REFER request has been observed.

Requires:

  • callTransferEvent
  • addCallData
  • completeCallEvent

Reimplemented from CallStateEventBuilder.

void addCallData ( const int  cseqNumber,
const UtlString callId,
const UtlString fromTag,
const UtlString toTag,
const UtlString fromField,
const UtlString toField 
) [virtual]

Add the dialog and call information for the event being built.

Parameters:
toTag  may be a null string
fromField  may be a null string

Reimplemented from CallStateEventBuilder.

void addEventVia ( const UtlString via  )  [virtual]

Add a via element for the event.

Record a Via from the message for this event Calls to this routine are in reverse cronological order - the last call for an event should be the via added by the message originator

Reimplemented from CallStateEventBuilder.

void completeCallEvent (  )  [virtual]

Indicates that all information for the current call event has been added.

Reimplemented from CallStateEventBuilder.

bool finishElement ( UtlString event  )  [virtual]

Copies the element into the provided UtlString.

Returns:
  • true if the returned element is validly constructed
  • false if not (a caller error)
Parameters:
event 
Returns:
  • true if the returned element is validly constructed
  • false if not (a caller error)

Implements CallStateEventBuilder.

void newEvent ( int  sequenceNumber,
const OsTime timestamp,
const char *  elementStart,
const char  eventType = '-' 
) [private]

Parameters:
timestamp  obtain using getCurTime(OsTime)

void reset (  )  [private]

Clears all the object state.

void replaceSingleQuotes ( const UtlString value,
UtlString newValue 
) [private]

CallStateEventBuilder_DB operator= ( const CallStateEventBuilder_DB rCallStateEventBuilderDB  )  [private]


Member Data Documentation

UtlString mCallInfo [private]

UtlString mViaHeader [private]

UtlString mBranchId [private]

UtlString mViaCount [private]

bool mEventComplete [private]


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:50:17 build33 abuild