#include <xmppbase.h>
Inheritance diagram for MessageFrame:


Public Member Functions | |
| MessageFrame (LaunchNewId &lid, PINDEX preferredPort) | |
| virtual | ~MessageFrame () |
| BOOL | WaitUntilInitialised () |
| void | SendThisMessageTo (const char *_message, PString dest) |
| void | SendThisMessageTo (PString &_message, PString dest) |
| void | SendThisMessageTo (PString &_message, const char *subj, PString dest) |
| void | SendThisMessageTo (PString &_message, PString subj, PString dest) |
| void | SendThisMessageTo (const char *message, const char *subj, PString dest) |
| PString | GetLastSender () |
| PString | GetOurId () |
| virtual void | Terminate () |
| virtual void | Main () |
| void | Initialise () |
| PTimeInterval | TimeSinceCreation () |
| void | SetCreatedAtNow () |
Protected Member Functions | |
| void | ProcessIncomingMessages (PBYTEArray &data, PINDEX size) |
| virtual void | ProcessMessage (PString message, 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 | ProcessQueryLocalAddress (PStringArray &cmds, PString &sender) |
| virtual void | ProcessQueryDestAddress (PStringArray &cmds, PString &sender) |
| virtual void | ProcessAdviseSendAddress (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 void | ProcessTransferUdp (PStringArray &cmds, PString &sender) |
| virtual void | ProcessQuitNow (PStringArray &cmds, PString &sender) |
| virtual void | ProcessHelp (PStringArray &cmds, PString &sender) |
| virtual void | ProcessSendDtmf (PStringArray &cmds, PString &sender) |
| virtual void | ProcessRequestNewId (PStringArray &cmds, PString &sender) |
| virtual void | ProcessSetWriteFile (PStringArray &cmds, PString &sender) |
| virtual void | ProcessSetReadFile (PStringArray &cmds, PString &sender) |
| virtual void | SetWriteFile (PString &newWriteFile) |
| virtual void | SetReadFile (PString &newReadFile) |
| virtual BOOL | SendDtmf (const PString &dtmfVals) |
| BOOL | GetLocalAddress (PIPSocket::Address &addr, PINDEX &portNo) |
| virtual BOOL | QueryLocalAddress (PIPSocket::Address &addr, PINDEX &portNo) |
| virtual BOOL | QuerySendToAddress (PIPSocket::Address &addr, PINDEX &portNo) |
| virtual BOOL | SetSendToAddress (PIPSocket::Address &addr, PINDEX &portNo) |
| BOOL | GetSendToAddress (PIPSocket::Address &addr, PINDEX &port) |
| virtual BOOL | OkToQuitNow () |
| virtual BOOL | OkToHangup () |
| virtual void | SilentlyEndAll () |
Protected Attributes | |
| PStringArray | availableCommands |
| PString | lastSender |
| PSyncPoint | threadRunning |
| PSyncPoint | goodConnection |
| PSyncPoint | writeSourceId |
| PUDPSocket | audioSocket |
|
||||||||||||
|
Constructor, give it a reference to the LaunchNewId instance, so this can establish a new comms channel |
|
|
Destructor, to close of any threads etc |
|
|
Report the name of the node that last sent us a message |
|
||||||||||||
|
Report the first address in the interface table that is not a loop back entry. Grab also the address the internal socket. Return values are:: FALSE if it fails, TRUE on success. |
|
|
Report the id used by this connection |
|
||||||||||||
|
Report the address and port we are sending udp data to |
|
|
Set up the connection to the remote server, |
|
|
Grab messages as they arrive from the server, and then process them |
|
|
Some MessageFrame instances do not obey the hangup command. This virtual method determines if this command has meaning, and if this instance of the comms should close on receiving a hangup Reimplemented in Comms. |
|
|
Some MessageFrame instances do not have the permission to quit now. This virtual method determines if this instance is permitted to exit the program Reimplemented in Supervisor. |
|
||||||||||||
|
we have received a command advising us of the address & port to send to, so store this information and reply accordingly |
|
||||||||||||
|
we have received a command advising us how to answer to the incoming call, so we act as required and reply accordingly Reimplemented in Comms. |
|
||||||||||||
|
we have received a Call other Node command, so do it and reply accordingly Reimplemented in Comms. |
|
||||||||||||
|
we have received a command which enables/disables debug information so install as required and reply accordingly Reimplemented in Comms, and Supervisor. |
|
||||||||||||
|
we have received a command queryig the current call duration , so extract information & answer Reimplemented in Comms. |
|
||||||||||||
|
we have received a hangup message, so end the call Reimplemented in Comms, and Supervisor. |
|
||||||||||||
|
we have received a command asking us to list the available commands |
|
||||||||||||
|
we have received a command requesting that we identify ourselves so do it and reply accordingly Reimplemented in Comms, and Supervisor. |
|
||||||||||||
|
Next step in the process incoming messages chain. Dissect the incominb binary block into indiividual messages, then process them. |
|
||||||||||||
|
We have a message come in from the server, and it ends up here. Now, handle this message, and give it to the relevant method below |
|
||||||||||||
|
we have received a Query on the Destination Address & port, so reply accordingly |
|
||||||||||||
|
we have received a Query Local Address & port command, so reply accordingly |
|
||||||||||||
|
we have received a command advising us that we are to end now Reimplemented in Supervisor. |
|
||||||||||||
|
we have received a command asking us to provide the id of a new communications nodes, that will be controlled only by the remote node Reimplemented in Supervisor. |
|
||||||||||||
|
we have received a command asking us to send the dtmf chars. An application would not normally override this method. |
|
||||||||||||
|
we have received a command asking us to set the file that we read from and then transmit over ethernet to the remote end.. This file will contain audio messages to be announced to the remote node. An application would not override this method, as this mthod does check that a file name is provided. This method will call SetWriteFile, which the application will override |
|
||||||||||||
|
We have received a command asking us to set the file that we fill with audio data. This file will (normally) be empty. An application would not override this method, as this mthod does check that a file name is provided. This method will call SetReadFile, which the application will override |
|
||||||||||||
|
we have received a query status command, so do it and reply accordingly Reimplemented in Comms, and Supervisor. |
|
||||||||||||
|
we have received a command advising us that we are to install udp comms with a particular remote node id. Now, we have to reply accordingly to our master, and establish udp comms with the requisite message server There are three transferudp commands 1) transferUdp messageid sent by the controller 2) transferUdp messageid addr:port sent in response to 1) 3) transferUdp messageid addr:port done sent in response to 2) An application would not normally override this method. Reimplemented in Comms. |
|
||||||||||||
|
The overrirde of this class will define this function, which is used by several of the message processing functions. Get the address of this socket, which receives data. |
|
||||||||||||
|
The overrirde of this class will define this function, which is used by several of the message processing functions. Get the address that we are currently sending data to |
|
|
Send this dtmf string to the remote node. Returns TRUE on success, FALSE on failure. An application will override this method, to actually do the work of sending. Reimplemented in Comms. |
|
||||||||||||||||
|
A fifth flavour of sending a message |
|
||||||||||||||||
|
A fourth flavour of sending a message |
|
||||||||||||||||
|
A third flavour of sending a message |
|
||||||||||||
|
A second flavour of sending a message |
|
||||||||||||
|
Multiple flavours of sending messages, which send a message to the remote node |
|
|
Mark This frame as having been created right now, which is a required function for those frames sitting in the pending list |
|
|
Actually set the read file. We will extract PCM data from this file. An application will override this method, if it is allowed to take audio from a file (which is the case for the answering machine. The method name (SetReadFile) describes what we do to the specified file - we are reading from this file |
|
||||||||||||
|
The overrirde of this class will define this function, which is used by several of the message processing functions. Set the address that we are currently sending data to |
|
|
Actually set the file that we write audio to. We will fill this file with PCM data An application will override this method, if it is allowed to write audio to this file (which is the case for the answering machine. The method name (SetWriteFile) describes what we do to the specified file - we are writing to this file |
|
|
We have a comms error, so just close everything right now. Send no message to the remote node - just end end end. Reimplemented in Comms, and Supervisor. |
|
|
Close this thread that is doing the Processing of incoming Messages. |
|
|
Report the age of this MessageFrame structure. This is used to see if we have sat too long in the pending queue, waiting for allocation to a particular call. Other uses are indeed possible. |
|
|
Wait until the messaging subsystem reports it is initialised. Wait no more than 1 second. If not initialised, return FALSE. return TRUE immediately on discovering we are initialised |
|
|
The udp socket we send and receive audio data on |
|
|
List of available commands |
|
|
This sync point goes on when we connect to the remote server |
|
|
The remote client who last sent us a message |
|
|
A SyncPoint that goes on when the thread actually begins |
|
|
A sync point that goes when this class has written the source Id to the remote server |
1.4.4