#include <frame.h>
Inheritance diagram for IAX2Frame:
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 () |
BOOL | ReadNetworkPacket (PUDPSocket &sock) |
virtual BOOL | ProcessNetworkPacket () |
virtual BOOL | IsFullFrame () |
BOOL | IsVideo () const |
BOOL | IsAudio () const |
virtual BYTE * | GetMediaDataPointer () |
virtual PINDEX | GetMediaDataSize () |
PINDEX | DataSize () |
IAX2Remote & | GetRemoteInfo () |
const BYTE * | GetDataPointer () |
IAX2Frame * | BuildAppropriateFrameType (IAX2Encryption &encryptionInfo) |
IAX2Frame * | BuildAppropriateFrameType () |
PINDEX | GetUnReadBytes () |
virtual BOOL | WriteHeader () |
virtual BOOL | TransmitPacket (PUDPSocket &sock) |
virtual void | PrintOn (ostream &strm) const |
virtual void | BuildTimeStamp (const PTimeInterval &callStartTick) |
IAX2EndPoint & | GetEndpoint () |
PString | IdString () const |
DWORD | GetTimeStamp () |
virtual BOOL | CallMustBeActive () |
IAX2FrameType | GetFrameType () |
virtual void | InitialiseHeader (IAX2Processor *) |
BOOL | CanRetransmitFrame () const |
PString | GetConnectionToken () const |
void | SetConnectionToken (PString newToken) |
void | BuildConnectionTokenId () |
BOOL | EncryptContents (IAX2Encryption &encData) |
virtual PINDEX | GetEncryptionOffset () |
Static Public Member Functions | |
static DWORD | CalcTimeStamp (const PTimeInterval &callStartTick) |
Protected Member Functions | |
BOOL | DecryptContents (IAX2Encryption &encryption) |
BOOL | Read1Byte (BYTE &res) |
BOOL | Read2Bytes (PINDEX &res) |
BOOL | Read2Bytes (WORD &res) |
BOOL | 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 |
BOOL | isFullFrame |
BOOL | isVideo |
BOOL | isAudio |
PINDEX | currentReadIndex |
PINDEX | currentWriteIndex |
DWORD | timeStamp |
int | frameIndex |
BOOL | canRetransmitFrame |
PString | connectionToken |
PINDEX | presetTimeStamp |
|
|
construction |
|
Destructor - which is empty |
|
Same as the preceeding function, except that encryption is off |
|
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. |
|
Create the connection token id, which uniquely identifies the connection to process this call |
|
Write the timestamp value, in preparation for writing the header. When sending a packet, the timestamp is written at packet construction. |
|
Calculate the timestamp value, given the call start tick |
|
Report flag stating that this call must be active when this frame is transmitted Reimplemented in IAX2FullFrame. |
|
Return true if this frame should be retransmitted. Acks are never retransmitted. cmdNew are retransmitted. |
|
Reporting function, to describe the number of bytes in this packet |
|
Use the supplied encryptionKey, and data in storage, to decrypt this frame. Return False if the decryption fails, TRUE if the decryption works. |
|
Write the data in the variables to this frame's data array. If encryption is on, the data will be encrypted |
|
Get the string which uniquely identifies the IAXConnection that sent this frame |
|
Obtain a pointer to the current position in the incoming data array |
|
Get the offset to the beginning of the encrypted region Reimplemented in IAX2MiniFrame, and IAX2FullFrame. |
|
Return a reference to the endpoint structure |
|
Access the current value of the variable controlling frame type, which is used when reading data from the network socket. |
|
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 IAX2MiniFrame, and IAX2FullFrame. |
|
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 IAX2MiniFrame, and IAX2FullFrame. |
|
Get the value of the Remote structure |
|
Get the timestamp as used by this class |
|
How many bytes are unread in the incoming data array |
|
Globally unique ID string for this frame, to help track frames |
|
Method supplied here to provide basis for descendant classes. Whenever a frame is transmitted, this method will be called. Reimplemented in IAX2MiniFrame, and IAX2FullFrame. |
|
True if is is an audio frame |
|
True if this is a full frame Reimplemented in IAX2FullFrame. |
|
True if it is a video frame |
|
Pretty print this frame data to the designated stream Reimplemented in IAX2MiniFrame, and IAX2FullFrame. |
|
Interpret the data from the read process Reimplemented in IAX2MiniFrame, and IAX2FullFrame. |
|
Read 1 byte from the internal area, (Internal area is filled when reading the packet in). Big Endian. |
|
Read 2 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian. |
|
Read 2 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian. |
|
Read 4 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian. |
|
Wait on the designated socket for an incoming UDP packet. This method is only called by the receiver. This method does NO interpretation |
|
Set the string which uniquely identifies the IAXConnection that is responsible for this frame |
|
Send this packet on the specified socket to the remote host. This method is only called by the transmiter. Reimplemented in IAX2FullFrame. |
|
Write 1 byte to the internal area, as part of writing the header info. Send only the lowest 8 bits of source |
|
Write 1 byte to the internal area, as part of writing the header info |
|
Write 2 bytes to the internal area, as part of writing the header info Big Endian. |
|
Write 4 bytes to the internal area, as part of writing the header info Big Endian. |
|
Cause the header bytes for this particular frame type to be written to the internal array Reimplemented in IAX2MiniFrame, and IAX2FullFrame. |
|
Initialise all internal storage in this structrue Reimplemented in IAX2MiniFrame, and IAX2FullFrame. |
|
Indicate if this frame can be retransmitted |
|
Connection Token, which uniquely identifies the IAXConnection that sent this frame. The token will (except for the first setup packet) uniquely identify the IAXConnection that is to receive this incoming frame. |
|
Index of where we are reading from the internal data area |
|
Index of where we are writing to the internal data area |
|
Internal storage array, ready for sending to remote node, or ready for receiving from remote node |
|
Reference to the global variable of this program |
|
Internal variable that uniquely identifies this frame |
|
Variable specifying the IAX type of frame that this is. Used only in reading from the network |
|
Flag to indicate if this is a MiniFrame with audio |
|
Flag to indicate if this is a MiniFrame or FullFrame |
|
Flag to indicate if this is a MiniFrame with video |
|
The time stamp to use, for those cases when the user demands a particular timestamp on construction. |
|
Specification of the location (address, call number etc) of the far endpoint |
|
unsigned 32 bit representaiton of the time of this day |