#include <processor.h>
Inheritance diagram for IAX2Processor:
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.
enum IAX2Processor::DefinedNoResponseTimePeriod [protected] |
IAX2Processor::IAX2Processor | ( | IAX2EndPoint & | ep | ) |
Construct this class
virtual IAX2Processor::~IAX2Processor | ( | ) | [virtual] |
Destructor
IAX2SequenceNumbers& IAX2Processor::GetSequenceInfo | ( | ) | [inline] |
Get the sequence number info (inSeqNo and outSeqNo)
IAX2Encryption& IAX2Processor::GetEncryptionInfo | ( | ) | [inline] |
Get the IAX2 encryption info
Reimplemented in IAX2CallProcessor.
void IAX2Processor::IncomingEthernetFrame | ( | IAX2Frame * | frame | ) |
Handle a received IAX2 frame. This may be a mini frame or full frame
virtual void IAX2Processor::PrintOn | ( | ostream & | strm | ) | const [pure virtual] |
A method to cause some of the values in this class to be formatted into a printable stream
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
IAX2EndPoint& IAX2Processor::GetEndPoint | ( | ) | [inline] |
Access the endpoint class that launched this processor
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
PString IAX2Processor::GetCallToken | ( | ) |
Return the string that identifies this IAX2Connection instance
IAX2Remote& IAX2Processor::GetRemoteInfo | ( | ) | [inline] |
Get information on IAX2Remote class (remote node address & port + source & dest call number.)
const PTimeInterval& IAX2Processor::GetCallStartTick | ( | ) | [inline] |
Get the call start tick
void IAX2Processor::Main | ( | ) |
The worker method of this thread. In here, all incoming frames (for this call) are handled.
BOOL 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::SetSpecialPackets | ( | BOOL | newValue | ) | [inline] |
Set the flag to indicate if we are handling specialPackets (those packets which are not sent to any particular call)
void IAX2Processor::Terminate | ( | ) |
Cause this thread to die immediately
void IAX2Processor::Activate | ( | ) |
Cause this thread to come to life, and process events that are pending at IAX2Connection
void IAX2Processor::StartNoResponseTimer | ( | PINDEX | msToWait = 60000 |
) | [protected] |
Set the acceptable time (in milliseconds) to wait before giving up on this call
void IAX2Processor::StopNoResponseTimer | ( | ) | [inline, protected] |
Stop the timer - we have received a reply
void IAX2Processor::CleanPendingLists | ( | ) | [inline, protected] |
Activate this thread to process all the lists of queued frames
virtual void IAX2Processor::OnNoResponseTimeout | ( | ) | [protected, pure virtual] |
A threaded pure threaded callback for the sub classes of processor
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
BOOL IAX2Processor::IsHandlingSpecialPackets | ( | ) | [inline, protected] |
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).
virtual void IAX2Processor::ProcessLists | ( | ) | [protected, pure virtual] |
Go through the three lists for incoming data (ethernet/sound/UI commands.
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
virtual void IAX2Processor::ProcessFullFrame | ( | IAX2FullFrame & | fullFrame | ) | [protected, pure virtual] |
A pure virtual method that is implemented by sub classes to process an incoming full frame
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
virtual void IAX2Processor::ProcessIaxCmdLagRq | ( | IAX2FullFrameProtocol * | src | ) | [protected, virtual] |
Process a FullFrameProtocol class, where the sub Class value is Initial message, used to measure the round trip time
virtual void IAX2Processor::ProcessIaxCmdLagRp | ( | IAX2FullFrameProtocol * | src | ) | [protected, virtual] |
Process a FullFrameProtocol class, where the sub Class value is Reply to cmdLagrq, which tells us the round trip time
virtual void IAX2Processor::ProcessIaxCmdVnak | ( | IAX2FullFrameProtocol * | src | ) | [protected, virtual] |
Process a FullFrameProtocol class, where the sub Class value is If we receive voice before valid first voice frame, send this
virtual void IAX2Processor::ProcessIaxCmdPing | ( | IAX2FullFrameProtocol * | src | ) | [protected, virtual] |
Process a FullFrameProtocol class, where the sub Class value is Ping request,
virtual void IAX2Processor::ProcessIaxCmdPong | ( | IAX2FullFrameProtocol * | src | ) | [protected, virtual] |
Process a FullFrameProtocol class, where the sub Class value is reply to a Ping
BOOL IAX2Processor::ProcessOneIncomingEthernetFrame | ( | ) | [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::IncControlFramesSent | ( | ) | [inline, protected] |
Increment the count of full frames sent
void IAX2Processor::IncControlFramesRcvd | ( | ) | [inline, protected] |
Increment the count of full frames received
virtual void IAX2Processor::ProcessNetworkFrame | ( | IAX2MiniFrame * | src | ) | [protected, pure virtual] |
A pure virtual method that is implmented by to process an incoming network frame of type IAX2MiniFrame
Implemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
virtual BOOL IAX2Processor::ProcessNetworkFrame | ( | IAX2FullFrameProtocol * | src | ) | [protected, virtual] |
Reimplemented in IAX2CallProcessor, IAX2RegProcessor, and IAX2SpecialProcessor.
void IAX2Processor::TransmitFrameToRemoteEndpoint | ( | IAX2Frame * | src | ) | [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.
void IAX2Processor::TransmitFrameToRemoteEndpoint | ( | IAX2FullFrame * | src, | |
IAX2WaitingForAck::ResponseToAck | response | |||
) | [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 |
void IAX2Processor::TransmitFrameNow | ( | IAX2Frame * | src | ) | [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.
void IAX2Processor::TransmitFrameToRemoteEndpoint | ( | IAX2FullFrameProtocol * | src | ) | [protected] |
FullFrameProtocol class needs to have the IE's correctly appended prior to transmission
BOOL IAX2Processor::Authenticate | ( | IAX2FullFrameProtocol * | reply, | |
PString & | password | |||
) | [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 |
void IAX2Processor::SendAckFrame | ( | IAX2FullFrame * | inReplyTo | ) | [protected] |
Transmit an IAX2 protocol frame with subclass type ack immediately to remote endpoint
void IAX2Processor::SendVnakFrame | ( | IAX2FullFrame * | inReplyTo | ) | [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::SendUnsupportedFrame | ( | IAX2FullFrame * | inReplyTo | ) | [protected] |
Transmit an unsupported frame to the remote endpoint
IAX2EndPoint& IAX2Processor::endpoint [protected] |
Reference to the global variable of this program
PTimeInterval IAX2Processor::callStartTick [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.
IAX2Remote IAX2Processor::remote [protected] |
Details on the address of the remote endpoint, and source/dest call numbers
PTimer IAX2Processor::noResponseTimer [protected] |
The timer which is used to test for no reply to our outgoing call setup messages
IAX2WaitingForAck IAX2Processor::nextTask [protected] |
Action to perform on receiving an ACK packet (which is required during call setup phase for receiver
PSyncPoint IAX2Processor::activate [protected] |
Flag which is used to activate this thread, so all pending tasks/packets are processed
BOOL IAX2Processor::endThread [protected] |
Flag to indicate, end this thread
IAX2Encryption IAX2Processor::encryption [protected] |
Status of encryption for this processor - by default, no encryption
IAX2SequenceNumbers IAX2Processor::sequence [protected] |
Details on the in/out sequence numbers
IAX2FrameList IAX2Processor::frameList [protected] |
Array of frames read from the Receiver for this call
SafeString IAX2Processor::callToken [protected] |
The call token, which uniquely identifies this IAX2CallProcessor, and the associated call
BOOL IAX2Processor::specialPackets [protected] |
Flag to indicate we are handing the special packets, which are sent to the endpoint,and not related to any particular call.
PAtomicInteger IAX2Processor::controlFramesSent [protected] |
Count of the number of control frames sent
PAtomicInteger IAX2Processor::controlFramesRcvd [protected] |
Count of the number of control frames received
IAX2IeData IAX2Processor::ieData [protected] |
Hold each of the possible values from an Ie class
DWORD IAX2Processor::currentSoundTimeStamp [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.