OPAL
Version 3.14.3
|
#include <frame.h>
Public Types | |
enum | IAX2FrameType { undefType = 0, dtmfType = 1, voiceType = 2, videoType = 3, controlType = 4, nullType = 5, iax2ProtocolType = 6, textType = 7, imageType = 8, htmlType = 9, cngType = 10, numFrameTypes = 11 } |
Public Member Functions | |
IAX2Frame (IAX2EndPoint &_endpoint) | |
virtual | ~IAX2Frame () |
PBoolean | ReadNetworkPacket (PUDPSocket &sock) |
virtual PBoolean | ProcessNetworkPacket () |
virtual PBoolean | IsFullFrame () |
PBoolean | IsVideo () const |
PBoolean | IsAudio () const |
virtual BYTE * | GetMediaDataPointer () |
virtual PINDEX | GetMediaDataSize () |
PINDEX | DataSize () |
IAX2Remote & | GetRemoteInfo () |
const BYTE * | GetDataPointer () |
IAX2Frame * | BuildAppropriateFrameType (IAX2Encryption &encryptionInfo) |
IAX2Frame * | BuildAppropriateFrameType () |
PINDEX | GetUnReadBytes () |
virtual PBoolean | WriteHeader () |
virtual PBoolean | TransmitPacket (PUDPSocket &sock) |
virtual void | PrintOn (ostream &strm) const |
virtual void | BuildTimeStamp (const PTimeInterval &callStartTick) |
IAX2EndPoint & | GetEndpoint () |
PString | IdString () const |
DWORD | GetTimeStamp () |
void | SetTimeStamp (DWORD newValue) |
virtual PBoolean | CallMustBeActive () |
IAX2FrameType | GetFrameType () |
virtual void | InitialiseHeader (IAX2Processor *) |
PBoolean | CanRetransmitFrame () const |
PString | GetConnectionToken () const |
void | SetConnectionToken (PString newToken) |
void | BuildConnectionToken () |
PBoolean | EncryptContents (IAX2Encryption &encData) |
virtual PINDEX | GetEncryptionOffset () |
Static Public Member Functions | |
static DWORD | CalcTimeStamp (const PTimeInterval &callStartTick) |
Protected Member Functions | |
PBoolean | DecryptContents (IAX2Encryption &encryption) |
PBoolean | Read1Byte (BYTE &res) |
PBoolean | Read2Bytes (PINDEX &res) |
PBoolean | Read2Bytes (WORD &res) |
PBoolean | Read4Bytes (DWORD &res) |
void | Write1Byte (BYTE newVal) |
void | Write1Byte (PINDEX newVal) |
void | Write2Bytes (PINDEX newVal) |
void | Write4Bytes (unsigned int newVal) |
void | ZeroAllValues () |
Protected Attributes | |
IAX2Remote | remote |
IAX2FrameType | frameType |
IAX2EndPoint & | endpoint |
PBYTEArray | data |
PBoolean | isFullFrame |
PBoolean | isVideo |
PBoolean | isAudio |
PINDEX | currentReadIndex |
PINDEX | currentWriteIndex |
DWORD | timeStamp |
PBoolean | canRetransmitFrame |
PString | connectionToken |
DWORD | presetTimeStamp |
Base class for holding data to be sent to a remote endpoint
Specify the type of this frame.
IAX2Frame::IAX2Frame | ( | IAX2EndPoint & | _endpoint | ) |
construction
|
virtual |
Destructor - which is empty
IAX2Frame* IAX2Frame::BuildAppropriateFrameType | ( | IAX2Encryption & | encryptionInfo | ) |
Read the input frame, and create the correct IAX2MiniFrame, FullFrame, and set frame type variables. If a password is supplied, decrypt the frame with this password
This method will never delete the input frame. If the output is null, it failed to derive a result.
IAX2Frame* IAX2Frame::BuildAppropriateFrameType | ( | ) |
Same as the preceeding function, except that encryption is off
void IAX2Frame::BuildConnectionToken | ( | ) |
Create the connection token, which uniquely identifies the connection to process this call
|
virtual |
Write the timestamp value, in preparation for writing the header. When sending a packet, the timestamp is written at packet construction.
|
static |
Calculate the timestamp value, given the call start tick
|
inlinevirtual |
Report flag stating that this call must be active when this frame is transmitted
Reimplemented in IAX2FullFrame.
|
inline |
Return true if this frame should be retransmitted. Acks are never retransmitted. cmdNew are retransmitted.
References canRetransmitFrame.
|
inline |
Reporting function, to describe the number of bytes in this packet
References data.
Referenced by GetMediaDataSize().
|
protected |
Use the supplied encryptionKey, and data in storage, to decrypt this frame.
Return False if the decryption fails, true if the decryption works.
PBoolean IAX2Frame::EncryptContents | ( | IAX2Encryption & | encData | ) |
Write the data in the variables to this frame's data array. If encryption is on, the data will be encrypted
|
inline |
Get the string which uniquely identifies the IAXConnection that sent this frame
References connectionToken.
|
inline |
Obtain a pointer to the current position in the incoming data array
References currentReadIndex, and data.
|
virtual |
Get the offset to the beginning of the encrypted region
Reimplemented in IAX2FullFrame, and IAX2MiniFrame.
|
inline |
Return a reference to the endpoint structure
References endpoint.
|
inline |
Access the current value of the variable controlling frame type, which is used when reading data from the network socket.
References frameType.
|
inlinevirtual |
Pointer to the beginning of the media (after the header) in this packet. The low level frame has no idea on headers, so just return pointer to beginning of data.
Reimplemented in IAX2FullFrame, and IAX2MiniFrame.
References data.
|
inlinevirtual |
Number of bytes in the media section of this packet. The low level frame has no idea on headers, so just return the number of bytes in the packet.
Reimplemented in IAX2FullFrame, and IAX2MiniFrame.
References DataSize().
|
inline |
Get the value of the Remote structure
References remote.
Referenced by IAX2CallProcessor::Matches().
|
inline |
Get the timestamp as used by this class
References timeStamp.
|
inline |
How many bytes are unread in the incoming data array
References currentReadIndex, and data.
PString IAX2Frame::IdString | ( | ) | const |
Globally unique ID string for this frame, to help track frames. The value returned is a pretty printed address of this frame instance.
|
inlinevirtual |
Method supplied here to provide basis for descendant classes.
Whenever a frame is transmitted, this method will be called.
Reimplemented in IAX2FullFrame, and IAX2MiniFrame.
|
inline |
True if is is an audio frame
References isAudio.
|
inlinevirtual |
|
inline |
True if it is a video frame
References isVideo.
|
virtual |
Pretty print this frame data to the designated stream
Reimplemented in IAX2FullFrameProtocol, IAX2FullFrame, and IAX2MiniFrame.
|
virtual |
Interpret the data from the read process
Reimplemented in IAX2FullFrame, and IAX2MiniFrame.
|
protected |
Read 1 byte from the internal area, (Internal area is filled when reading the packet in). Big Endian.
|
protected |
Read 2 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian.
|
protected |
Read 2 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian.
|
protected |
Read 4 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian.
PBoolean IAX2Frame::ReadNetworkPacket | ( | PUDPSocket & | sock | ) |
Wait on the designated socket for an incoming UDP packet. This method is only called by the receiver. This method does NO interpretation
|
inline |
Set the string which uniquely identifies the IAXConnection that is responsible for this frame
References connectionToken.
void IAX2Frame::SetTimeStamp | ( | DWORD | newValue | ) |
Alter the timestamp as used by this class - quite unusual, but ok,..
|
virtual |
Send this packet on the specified socket to the remote host. This method is only called by the transmiter.
Reimplemented in IAX2FullFrame.
|
protected |
Write 1 byte to the internal area, as part of writing the header info
|
protected |
Write 1 byte to the internal area, as part of writing the header info. Send only the lowest 8 bits of source
|
protected |
Write 2 bytes to the internal area, as part of writing the header info Big Endian.
|
protected |
Write 4 bytes to the internal area, as part of writing the header info Big Endian.
|
inlinevirtual |
Cause the header bytes for this particular frame type to be written to the internal array
Reimplemented in IAX2FullFrame, and IAX2MiniFrame.
|
protected |
Initialise all internal storage in this structrue
|
protected |
Indicate if this frame can be retransmitted
Referenced by CanRetransmitFrame().
|
protected |
Connection Token, which uniquely identifies the IAX2Connection that sent this frame. The token will (except for the first setup packet) uniquely identify the IAX2Connection that is to receive this incoming frame.
Referenced by GetConnectionToken(), and SetConnectionToken().
|
protected |
Index of where we are reading from the internal data area
Referenced by GetDataPointer(), and GetUnReadBytes().
|
protected |
Index of where we are writing to the internal data area
|
protected |
Internal storage array, ready for sending to remote node, or ready for receiving from remote node
Referenced by DataSize(), GetDataPointer(), GetMediaDataPointer(), and GetUnReadBytes().
|
protected |
Reference to the global variable of this program
Referenced by GetEndpoint().
|
protected |
Variable specifying the IAX type of frame that this is. Used only in reading from the network
Referenced by GetFrameType().
|
protected |
Flag to indicate if this is a MiniFrame with audio
Referenced by IsAudio().
|
protected |
Flag to indicate if this is a MiniFrame or FullFrame
Referenced by IsFullFrame().
|
protected |
Flag to indicate if this is a MiniFrame with video
Referenced by IsVideo().
|
protected |
The time stamp to use, for those cases when the user demands a particular timestamp on construction.
|
protected |
Specification of the location (address, call number etc) of the far endpoint
Referenced by GetRemoteInfo().
|
protected |
unsigned 32 bit representaiton of the time of this day
Referenced by GetTimeStamp().