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, MyManager &manager)
 ~Comms ()
virtual void StopAllCommunications ()
void AdviseCallCreation ()
void SetMyOpalCallPtr (MyOpalCall *ptr)
PUDPSocket & GetAudioSocket ()
void CloseThisId ()

Protected Member Functions

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 BOOL OkToHangup ()
virtual void SilentlyEndAll ()

Protected Attributes

MyManagermanager
PString remoteController
MyOpalCallmyOpalCall

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 MyOpalCall class. Thus, incoming messages, when executed by this class, exert control over the program via the MyOpalCall class, and reference to the manager class. On closure, the pointer to the MyOpalCall class is removed. The MyOpalCall class has a reference to this class


Constructor & Destructor Documentation

Comms::Comms LaunchNewId lid,
MyManager 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 MyOpalCall class


Member Function Documentation

void Comms::AdviseCallCreation  ) 
 

Send a message to the remote controller saying that we are created (and established in the Opal sense of a connection). The id of this node is appended to the message.

void Comms::CloseThisId  ) 
 

Close this id off. Basically, tell the remote end we are closing, and stop the comms on the tcp socket.

PUDPSocket & Comms::GetAudioSocket  ) 
 

Report the address of the audio socket, which is used for all voice data communications between channels. Note that this voice data does not go via the server. This voice data goes directly between the two endpoints, which is quite unlike the path taken by control commands

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

Some MessageFrame instances do not obey the hangup command. This Comms structure lives or dies on the hangup command

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.

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::SetMyOpalCallPtr MyOpalCall ptr  ) 
 

Assign a value to the jocall pointer

void Comms::SilentlyEndAll  )  [protected, virtual]
 

We have a comms error, so just close everything right now. Send no message to the remote node - just end end end.

Reimplemented from MessageFrame.

void Comms::StopAllCommunications  )  [virtual]
 

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


Member Data Documentation

MyManager& Comms::manager [protected]
 

Reference back to the most important class of all

MyOpalCall* Comms::myOpalCall [protected]
 

Pointer to the Opal Call structure that takes our commands and apply them to this call.

The "myOpalCall" pointer is only accessed when receiving messages from the network.

This pointer is set to NULL after the receive network messages thread has ended.

This pointer is set to a value almost immediately after call creation. prior to this, it is null. Thus, if the reeiveNetworkMessages thread checks that this pointer is not null, there is no thread pointer issue.

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:49:11 2006 for SSVoip, which is Sofa Switch Voip by  doxygen 1.4.4