Main Page | Class Hierarchy | Class List | File List | Class Members

Comms Class Reference

#include <comms.h>

Inheritance diagram for Comms:

Inheritance graph
[legend]
Collaboration diagram for Comms:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Comms (LaunchNewId &lid, Manager &manager)
 ~Comms ()
virtual void StopAllCommunications ()
void AdviseCallCreation (const PString &remoteCont)
void SetMediaConnectionPtr (MediaConnection *ptr)
PString GetAudioFile (BOOL isReadFile)
void CloseCommsDown ()
virtual void SilentlyEndAll ()

Protected Member Functions

virtual void ProcessTransferUdp (PStringArray &cmds, PString &sender)
virtual void ProcessHangup (PStringArray &cmds, PString &sender)
virtual void ProcessCallNode (PStringArray &cmds, PString &sender)
virtual void ProcessStatusQuery (PStringArray &cmds, PString &sender)
virtual void ProcessDuration (PStringArray &cmds, PString &sender)
virtual void ProcessIdentify (PStringArray &cmds, PString &sender)
virtual void ProcessDebug (PStringArray &cmds, PString &sender)
virtual void ProcessAnswer (PStringArray &cmds, PString &sender)
virtual BOOL SendDtmf (const PString &dtmfVals)
virtual void SetReadFile (PString &newReadFile)
virtual void SetWriteFile (PString &newWriteFile)
virtual BOOL OkToHangup ()
PString GetStatusInfo ()
PString GetDurationInfo ()
void StartMediaStreams ()
void CloseMediaStreams ()

Protected Attributes

Managermanager
PString remoteController
PTime createdAt
Audio thread releated variables
AudioReadaudioReadThread
AudioWriteaudioWriteThread
PString audioReadFile
PString audioWriteFile

Detailed Description

A class that handles all the messaging with the remote controller. Messages are sent via the MessageFrame class. This class has a pointer to the MediaConnection class. Thus, incoming messages, when executed by this class, exert control over the program via the MediaConnection class, and reference to the manager class. On closure, the pointer to the MediaConnection class is removed. The MediaConnection class has a reference to this class


Constructor & Destructor Documentation

Comms::Comms LaunchNewId lid,
Manager manager
 

Constructor, with a reference to the manager and the unique ID generator

Comms::~Comms  ) 
 

Close down the handling of incoming message, and break the link to the MediaConnection class


Member Function Documentation

void Comms::AdviseCallCreation const PString &  remoteCont  ) 
 

Send a message to the remote controller saying that we are created. The id of this node is appended to the message.

void Comms::CloseCommsDown  )  [inline]
 

Close this comms instance down

Here is the call graph for this function:

void Comms::CloseMediaStreams  )  [protected]
 

Close the current streams of media - which is generated by the audio Read and Write Threads

PString Comms::GetAudioFile BOOL  isReadFile  ) 
 

Report the current file for audio read/writeing

PString Comms::GetDurationInfo  )  [protected]
 

Get information (in a textual form) of how long this call has been up

PString Comms::GetStatusInfo  )  [protected]
 

Get information for this call on status

virtual BOOL Comms::OkToHangup  )  [inline, protected, virtual]
 

Some MessageFrame instances do not obey the hangup command. This virtual method says we can hangup, cause we are one channel of a conference call. This instance of the comms should close on receiving a hangup

Reimplemented from MessageFrame.

void Comms::ProcessAnswer PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a command advising us how to answer to the incoming call, so we act as required and reply accordingly

Reimplemented from MessageFrame.

void Comms::ProcessCallNode PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a Call other Node command, so do it and reply accordingly

Reimplemented from MessageFrame.

void Comms::ProcessDebug PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a command which enables/disables debug information so install as required and reply accordingly

Reimplemented from MessageFrame.

void Comms::ProcessDuration PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a command queryig the current call duration , so extract information & answer

Reimplemented from MessageFrame.

void Comms::ProcessHangup PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a hangup message, so end the call

Reimplemented from MessageFrame.

void Comms::ProcessIdentify PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a command requesting that we identify ourselves so do it and reply accordingly

Reimplemented from MessageFrame.

void Comms::ProcessStatusQuery PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a query status command, so do it and reply accordingly

Reimplemented from MessageFrame.

void Comms::ProcessTransferUdp PStringArray &  cmds,
PString &  sender
[protected, virtual]
 

we have received a command advising us that we are to install udp comms with a particular remote node id. We override this method so we know when are being transferred. On being transferred, we move ourselves out of the Manager's list of pending calls. Then we call the ancestor method to actually do the work of transferring the udp

Reimplemented from MessageFrame.

BOOL Comms::SendDtmf const PString &  dtmfVals  )  [protected, virtual]
 

Send this dtmf string to the remote node. Returns TRUE on success, FALSE on failure.

Reimplemented from MessageFrame.

void Comms::SetMediaConnectionPtr MediaConnection *  ptr  ) 
 

Assign a value to the jocall pointer

void Comms::SetReadFile PString &  newReadFile  )  [protected, virtual]
 

Actually set the file this application reads data from. An application will override this method, if it is allowed to grab audio from the specified file (which is the case for the answering machine. The answering machine will read aaudio from the specified file.

Reimplemented from MessageFrame.

void Comms::SetWriteFile PString &  newWriteFile  )  [protected, virtual]
 

Actually set the file this application will write PCM audio data to. application will override this method, if it is allowed to put audio into this file (which is the case for the answering machine. The answering machine will write audio to the specified file.

Reimplemented from MessageFrame.

void Comms::SilentlyEndAll  )  [virtual]
 

We have a reason to close down, so just close everything right now (or alternatively, it is the end of this Comms instance).

Send no message to the remote node - just end end end.

Reimplemented from MessageFrame.

void Comms::StartMediaStreams  )  [protected]
 

Get the media to start to flow, and start the audio read/write methods

void Comms::StopAllCommunications  )  [virtual]
 

Send a message to the remote controller that we are closing down now


Member Data Documentation

PString Comms::audioReadFile [protected]
 

Name of the file we read audio from, and send to the remote sofa switch entity

AudioRead* Comms::audioReadThread [protected]
 

Pointer to the thead instance that reads from a file, and sends this back through the socket

PString Comms::audioWriteFile [protected]
 

Name of the file used for writing audio to, that is, audio we have received from the sofa switch entity

AudioWrite* Comms::audioWriteThread [protected]
 

Pointer to the thead instance that reads from a socket, and writes the audio to the specified file

PTime Comms::createdAt [protected]
 

The time at which this call started

Reimplemented from MessageFrame.

Manager& Comms::manager [protected]
 

Reference back to the most important class of all

PString Comms::remoteController [protected]
 

The id of the controller who has created this call


The documentation for this class was generated from the following files:
Generated on Sun Jan 29 19:48:59 2006 for SSAm, which is Sofa Switch Answering Machine by  doxygen 1.4.4