CallStateEventBuilder Class Reference

#include <CallStateEventBuilder.h>

Inheritance diagram for CallStateEventBuilder:

CallStateEventBuilder_DB CallStateEventBuilder_XML

List of all members.


Detailed Description

The base class for any means of building a record of a call state event.

Classes derived from this one may build events in different representations for different purposes.

Before any call events are generated, an observer event indicating the start of a new sequence event should be called:

Call Events are generated by a sequence of calls, begining with one of the call*Event methods and ending with callEventComplete. The specific calls required for each event type are documented with the method that begins the sequence.

This base class provides the

Public Types

enum  ObserverEvent { ObserverReset = 101 }
 Meta-events about the observer itself. More...

Public Member Functions

 CallStateEventBuilder (const char *observerDnsName)
 Instantiate an event builder and set the observer name for its events.
virtual ~CallStateEventBuilder ()
 Destructor.
virtual void observerEvent (int sequenceNumber, const OsTime &timestamp, ObserverEvent eventCode, const char *eventMsg)
 Generate a metadata event.
virtual 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.
virtual 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.
virtual 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.
virtual void callEndEvent (const int sequenceNumber, const OsTime &timestamp)
 Begin a Call End Event - a BYE request has been observed.
virtual void callTransferEvent (const 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 request has been observed.
virtual 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.
virtual void addEventVia (const UtlString &via)
 Add a via element for the event.
virtual void completeCallEvent ()
 Indicates that all information for the current call event has been added.
virtual bool finishElement (UtlString &event)=0

Protected Types

enum  BuilderMethod {
  InvalidEvent = -1,
  BuilderReset,
  CallRequestEvent,
  CallSetupEvent,
  CallFailureEvent,
  CallEndEvent,
  CallTransferEvent,
  AddCallData,
  AddVia,
  CompleteCallEvent
}
 Input events for the builderStateOk FSM. More...

Protected Member Functions

bool builderStateIsOk (BuilderMethod method)
 Event validity checking state machine.
bool builderStateReset ()
 Reset the validity checking finite state machine to the initial state.

Protected Attributes

const char * observerName

Private Member Functions

 CallStateEventBuilder (const CallStateEventBuilder &)
 no copy constructor
CallStateEventBuilderoperator= (const CallStateEventBuilder &)
 no assignment operator

Private Attributes

int buildState


Member Enumeration Documentation

Meta-events about the observer itself.

Enumerator:
ObserverReset  starts a new sequence number stream

enum BuilderMethod [protected]

Input events for the builderStateOk FSM.

Each of these events is passed to the state machine from the correspondingly named public builder method.

Enumerator:
InvalidEvent 
BuilderReset  for observerEvent(ObserverReset)
CallRequestEvent 
CallSetupEvent 
CallFailureEvent 
CallEndEvent 
CallTransferEvent 
AddCallData 
AddVia 
CompleteCallEvent 


Constructor & Destructor Documentation

CallStateEventBuilder ( 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 (  )  [virtual]

Destructor.

CallStateEventBuilder ( const CallStateEventBuilder  )  [private]

no copy constructor


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 in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

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 in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

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 in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

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 in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

void callEndEvent ( const 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 in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

void callTransferEvent ( const 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 request has been observed.

Requires:

  • callEndEvent
  • addCallData
  • completeCallEvent

Requires:

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

Reimplemented in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

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 in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

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 in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

void completeCallEvent (  )  [virtual]

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

Reimplemented in CallStateEventBuilder_DB, and CallStateEventBuilder_XML.

virtual bool finishElement ( UtlString event  )  [pure virtual]

bool builderStateIsOk ( BuilderMethod  method  )  [protected]

Event validity checking state machine.

Each of the public builder methods calls this finite state machine to determine whether or not the call is valid. This allows all builders to share the same rules for what calls are allowed and required when constructing each event type (for this reason, this should not be redefined by derived classes).

In the initial state, the only valid call is builderStateOk(BuilderReset)

Returns:
  • true if method is valid now
  • false if method is not valid now
Each of the public builder methods calls this finite state machine to determine whether or not the call is valid. This allows all builders to share the same rules for what calls are allowed and required when constructing each event type (for this reason, this should not be redefined by derived classes).

In the initial state, the only valid call is builderStateOk(ObserverStart)

Returns:
  • true if method is valid now
  • false if method is not valid now
This state machine is defined by the valid call state events specified in the meta/call_event.xsd schema.

bool builderStateReset (  )  [protected]

Reset the validity checking finite state machine to the initial state.

CallStateEventBuilder& operator= ( const CallStateEventBuilder  )  [private]

no assignment operator


Member Data Documentation

const char* observerName [protected]

int buildState [private]


Online Library Docs

sipXecs home page

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