OPAL
Version 3.18.8
|
#include <processor.h>
Public Member Functions | |
IAX2Processor (IAX2EndPoint &ep) | |
virtual | ~IAX2Processor () |
IAX2SequenceNumbers & | GetSequenceInfo () |
IAX2Encryption & | GetEncryptionInfo () |
void | IncomingEthernetFrame (IAX2Frame *frame) |
virtual void | PrintOn (ostream &strm) const =0 |
IAX2EndPoint & | GetEndPoint () |
void | SetCallToken (const PString &newToken) |
PString | GetCallToken () |
IAX2Remote & | GetRemoteInfo () |
const PTimeInterval & | GetCallStartTick () |
void | Main () |
PBoolean | IsStatusQueryEthernetFrame (IAX2Frame *frame) |
void | SetSpecialPackets (PBoolean newValue) |
void | Terminate () |
void | Activate () |
virtual PBoolean | IncomingMessageOutOfOrder (IAX2FullFrame *ff)=0 |
void | ReportLists (PString &answer) |
Protected Types | |
enum | DefinedNoResponseTimePeriod { NoResponseTimePeriod = 5000 } |
Protected Attributes | |
IAX2EndPoint & | endpoint |
PTimeInterval | callStartTick |
IAX2Remote | remote |
PTimer | noResponseTimer |
IAX2WaitingForAck | nextTask |
PSyncPoint | activate |
PBoolean | endThread |
IAX2Encryption | encryption |
IAX2SequenceNumbers | sequence |
IAX2ActiveFrameList | frameList |
SafeString | callToken |
PBoolean | specialPackets |
atomic< uint32_t > | controlFramesSent |
atomic< uint32_t > | controlFramesRcvd |
IAX2IeData | ieData |
DWORD | currentSoundTimeStamp |
This class is an abstract base class for iax2 processors. This class is responsible for handling all the iax2 protocol command messages.
It provides the base structure for two different processor classes, a)registration type commands and b)commands specific to one call.
The unique source and destination call number (which are in the IAX2 frames) are used to determine which processor will handle which incoming packet.
Each processor runs in its own thread so as to process incoming packets in a timely fashion.
|
protected |
IAX2Processor::IAX2Processor | ( | IAX2EndPoint & | ep | ) |
Construct this class
|
virtual |
Destructor
void IAX2Processor::Activate | ( | ) |
Cause this thread to come to life, and process events that are pending at IAX2Connection. This method does not start this thread. This method causes this thread to be joggled back into life, after waiting on a PSyncPoint.
|
protected |
Do the md5/rsa authentication. Return True if successful. Has the side effect of appending the appropriate Ie class to the "reply" parameter.
reply | this frame contains the result of authenticating the internal data |
password | the password to authenticate with |
|
inlineprotected |
Activate this thread to process all the lists of queued frames
References activate.
|
inline |
PString IAX2Processor::GetCallToken | ( | ) |
Return the string that identifies this IAX2Connection instance
Referenced by IAX2Connection::GetCallToken().
|
inline |
Get the IAX2 encryption info
References encryption.
|
inline |
Access the endpoint class that launched this processor
References endpoint.
|
inline |
Get information on IAX2Remote class (remote node address & port + source & dest call number.)
References remote.
Referenced by IAX2Connection::GetRemoteInfo().
|
inline |
Get the sequence number info (inSeqNo and outSeqNo)
References sequence.
Referenced by IAX2Connection::GetSequenceInfo().
|
inlineprotected |
Increment the count of full frames received
References controlFramesRcvd.
|
inlineprotected |
Increment the count of full frames sent
References controlFramesSent.
void IAX2Processor::IncomingEthernetFrame | ( | IAX2Frame * | frame | ) |
Handle a received IAX2 frame. This may be a mini frame or full frame
|
pure virtual |
Test the sequence number of the incoming frame. This is only valid for handling a call. If the message is outof order, the supplied fullframe is deleted.
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
|
inlineprotected |
return the flag to indicate if we are handling special packets, which are those packets sent to the endpoint (and not related to any particular call).
PBoolean IAX2Processor::IsStatusQueryEthernetFrame | ( | IAX2Frame * | frame | ) |
Test to see if it is a status query type IAX2 frame (eg lagrq) and handle it. If the frame is a status query, and it is handled, return true
void IAX2Processor::Main | ( | ) |
The worker method of this thread. In here, all incoming frames (for this call) are handled.
|
protectedpure virtual |
A threaded pure threaded callback for the sub classes of processor
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
|
pure virtual |
A method to cause some of the values in this class to be formatted into a printable stream
Implemented in IAX2RegProcessor, IAX2CallProcessor, and IAX2SpecialProcessor.
|
protectedpure virtual |
A pure virtual method that is implemented by sub classes to process an incoming full frame
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
|
protectedvirtual |
Process a FullFrameProtocol class, where the sub Class value is Reply to cmdLagrq, which tells us the round trip time
|
protectedvirtual |
Process a FullFrameProtocol class, where the sub Class value is Initial message, used to measure the round trip time
|
protectedvirtual |
Process a FullFrameProtocol class, where the sub Class value is Ping request,
|
protectedvirtual |
Process a FullFrameProtocol class, where the sub Class value is reply to a Ping
|
protectedvirtual |
Process a FullFrameProtocol class, where the sub Class value is If we receive voice before valid first voice frame, send this
|
protectedpure virtual |
Go through the three lists for incoming data (ethernet/sound/UI commands.
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
|
protectedpure virtual |
A pure virtual method that is implmented by to process an incoming network frame of type IAX2MiniFrame
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
|
protectedvirtual |
Reimplemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
|
protected |
remove one frame on the incoming ethernet frame list. If there may be more to process, return true. If there are no more to process, return false.
void IAX2Processor::ReportLists | ( | PString & | answer | ) |
Report on the contents of the lists waiting for processing
|
protected |
Transmit an IAX2 protocol frame with subclass type ack immediately to remote endpoint
|
protected |
Transmit an unsupported frame to the remote endpoint
|
protected |
Transmit an IAX2 protocol frame with subclass type VNAK immediately to remote endpoint. This message indicates we have received some full frames out of order, and want the interim ones retransmitted.
void IAX2Processor::SetCallToken | ( | const PString & | newToken | ) |
Give the call token a value. The call token is the ipaddress of the remote node concatented with the remote nodes src number. This is guaranteed to be unique. Sadly, if this connection is setting up the call, the callToken is not known until receipt of the first packet from the remote node.
However, if this connection is created in response to a call, this connection can determine the callToken on examination of that incoming first packet
|
inline |
Set the flag to indicate if we are handling specialPackets (those packets which are not sent to any particular call)
References specialPackets.
|
protected |
Set the acceptable time (in milliseconds) to wait before giving up on this call
|
inlineprotected |
Stop the timer - we have received a reply
References noResponseTimer.
void IAX2Processor::Terminate | ( | ) |
Cause this thread to die immediately
|
protected |
Transmit IAX2Frame to remote endpoint,. This calls a method in the Transmitter class. .It is only called by the this Connection class. There is no stats change when this method is called.
|
protected |
Transmit IAX2Frame to remote endpoint, and then increment send count. This calls a method in the Transmitter class. .It is only called by the this IAX2CallProcessor class.
|
protected |
Transmit IAX2Frame to remote endpoint, and then increment send count. This calls a method in the Transmitter class. .It is only called by the this IAX2CallProcessor class. The second parameter determines what to do when an ack frame is received for the sent frame.
response | action to do on getting Ack |
|
protected |
FullFrameProtocol class needs to have the IE's correctly appended prior to transmission
|
protected |
Flag which is used to activate this thread, so all pending tasks/packets are processed
Referenced by CleanPendingLists().
|
protected |
Time this connection class was created, which is the call start time. It is reported in Ticks, which is required for millisecond accuracy under windows.
Referenced by GetCallStartTick().
|
protected |
The call token, which uniquely identifies this IAX2CallProcessor, and the associated call
|
protected |
Count of the number of control frames received
Referenced by IncControlFramesRcvd().
|
protected |
Count of the number of control frames sent
Referenced by IncControlFramesSent().
|
protected |
The timestamp we will put on the next mini frame out of here
This timestamp is monotonically increasing, and bears "some" relation to actuality. We generate the timestamp uniformly - this instance of an iax2 call could be driven from a slightly non uniform packet source.
|
protected |
Status of encryption for this processor - by default, no encryption
Referenced by IAX2CallProcessor::GetEncryptionInfo(), and GetEncryptionInfo().
|
protected |
Reference to the global variable of this program
Referenced by GetEndPoint().
|
protected |
Flag to indicate, end this thread
|
protected |
Array of frames read from the Receiver for this call
|
protected |
Hold each of the possible values from an Ie class
|
protected |
Action to perform on receiving an ACK packet (which is required during call setup phase for receiver
|
protected |
The timer which is used to test for no reply to our outgoing call setup messages
Referenced by StopNoResponseTimer().
|
protected |
Details on the address of the remote endpoint, and source/dest call numbers
Referenced by GetRemoteInfo(), IAX2CallProcessor::Matches(), and IAX2CallProcessor::MatchingLocalCallNumber().
|
protected |
Details on the in/out sequence numbers
Referenced by GetSequenceInfo().
|
protected |
Flag to indicate we are handing the special packets, which are sent to the endpoint,and not related to any particular call.
Referenced by SetSpecialPackets().