IAX2Frame Class Reference

#include <frame.h>

Inheritance diagram for IAX2Frame:

IAX2FrameList IAX2FullFrame IAX2MiniFrame IAX2FullFrameCng IAX2FullFrameDtmf IAX2FullFrameHtml IAX2FullFrameImage IAX2FullFrameNull IAX2FullFrameProtocol IAX2FullFrameSessionControl IAX2FullFrameText IAX2FullFrameVideo IAX2FullFrameVoice List of all members.

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 ()
IAX2RemoteGetRemoteInfo ()
const BYTE * GetDataPointer ()
IAX2FrameBuildAppropriateFrameType (IAX2Encryption &encryptionInfo)
IAX2FrameBuildAppropriateFrameType ()
PINDEX GetUnReadBytes ()
virtual BOOL WriteHeader ()
virtual BOOL TransmitPacket (PUDPSocket &sock)
virtual void PrintOn (ostream &strm) const
virtual void BuildTimeStamp (const PTimeInterval &callStartTick)
IAX2EndPointGetEndpoint ()
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
IAX2EndPointendpoint
PBYTEArray data
BOOL isFullFrame
BOOL isVideo
BOOL isAudio
PINDEX currentReadIndex
PINDEX currentWriteIndex
DWORD timeStamp
int frameIndex
BOOL canRetransmitFrame
PString connectionToken
DWORD presetTimeStamp

Detailed Description

Base class for holding data to be sent to a remote endpoint


Member Enumeration Documentation

enum IAX2Frame::IAX2FrameType

Specify the type of this frame.

Enumerator:
undefType  full frame type is Undefined
dtmfType  full frame type is DTMF
voiceType  full frame type is Audio
videoType  full frame type is Video
controlType  full frame type is Session Control
nullType  full frame type is NULL - frame ignored.
iax2ProtocolType  full frame type is IAX protocol specific
textType  full frame type is text message
imageType  full frame type is image
htmlType  full frame type is HTML
cngType  full frame type is CNG (comfort noise generation
numFrameTypes  the number of defined IAX2 frame types


Constructor & Destructor Documentation

IAX2Frame::IAX2Frame ( IAX2EndPoint _endpoint  ) 

construction

virtual IAX2Frame::~IAX2Frame (  )  [virtual]

Destructor - which is empty


Member Function Documentation

BOOL 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

virtual BOOL IAX2Frame::ProcessNetworkPacket (  )  [virtual]

Interpret the data from the read process

Reimplemented in IAX2MiniFrame, and IAX2FullFrame.

virtual BOOL IAX2Frame::IsFullFrame (  )  [virtual]

True if this is a full frame

Reimplemented in IAX2FullFrame.

BOOL IAX2Frame::IsVideo (  )  const

True if it is a video frame

BOOL IAX2Frame::IsAudio (  )  const

True if is is an audio frame

virtual BYTE* IAX2Frame::GetMediaDataPointer (  )  [inline, virtual]

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.

virtual PINDEX IAX2Frame::GetMediaDataSize (  )  [inline, virtual]

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.

PINDEX IAX2Frame::DataSize (  )  [inline]

Reporting function, to describe the number of bytes in this packet

IAX2Remote& IAX2Frame::GetRemoteInfo (  )  [inline]

Get the value of the Remote structure

const BYTE* IAX2Frame::GetDataPointer (  )  [inline]

Obtain a pointer to the current position in the incoming data array

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

PINDEX IAX2Frame::GetUnReadBytes (  )  [inline]

How many bytes are unread in the incoming data array

virtual BOOL IAX2Frame::WriteHeader (  )  [inline, virtual]

Cause the header bytes for this particular frame type to be written to the internal array

Reimplemented in IAX2MiniFrame, and IAX2FullFrame.

virtual BOOL IAX2Frame::TransmitPacket ( PUDPSocket &  sock  )  [virtual]

Send this packet on the specified socket to the remote host. This method is only called by the transmiter.

Reimplemented in IAX2FullFrame.

virtual void IAX2Frame::PrintOn ( ostream &  strm  )  const [virtual]

Pretty print this frame data to the designated stream

Reimplemented in IAX2MiniFrame, IAX2FullFrame, and IAX2FullFrameProtocol.

static DWORD IAX2Frame::CalcTimeStamp ( const PTimeInterval &  callStartTick  )  [static]

Calculate the timestamp value, given the call start tick

virtual void IAX2Frame::BuildTimeStamp ( const PTimeInterval &  callStartTick  )  [virtual]

Write the timestamp value, in preparation for writing the header. When sending a packet, the timestamp is written at packet construction.

IAX2EndPoint& IAX2Frame::GetEndpoint (  )  [inline]

Return a reference to the endpoint structure

PString IAX2Frame::IdString (  )  const [inline]

Globally unique ID string for this frame, to help track frames

DWORD IAX2Frame::GetTimeStamp (  )  [inline]

Get the timestamp as used by this class

virtual BOOL IAX2Frame::CallMustBeActive (  )  [inline, virtual]

Report flag stating that this call must be active when this frame is transmitted

Reimplemented in IAX2FullFrame.

IAX2FrameType IAX2Frame::GetFrameType (  )  [inline]

Access the current value of the variable controlling frame type, which is used when reading data from the network socket.

virtual void IAX2Frame::InitialiseHeader ( IAX2Processor  )  [inline, virtual]

Method supplied here to provide basis for descendant classes.

Whenever a frame is transmitted, this method will be called.

Reimplemented in IAX2MiniFrame, and IAX2FullFrame.

BOOL IAX2Frame::CanRetransmitFrame (  )  const [inline]

Return true if this frame should be retransmitted. Acks are never retransmitted. cmdNew are retransmitted.

PString IAX2Frame::GetConnectionToken (  )  const [inline]

Get the string which uniquely identifies the IAXConnection that sent this frame

void IAX2Frame::SetConnectionToken ( PString  newToken  )  [inline]

Set the string which uniquely identifies the IAXConnection that is responsible for this frame

void IAX2Frame::BuildConnectionTokenId (  ) 

Create the connection token id, which uniquely identifies the connection to process this call

BOOL 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

virtual PINDEX IAX2Frame::GetEncryptionOffset (  )  [virtual]

Get the offset to the beginning of the encrypted region

Reimplemented in IAX2MiniFrame, and IAX2FullFrame.

BOOL IAX2Frame::DecryptContents ( IAX2Encryption encryption  )  [protected]

Use the supplied encryptionKey, and data in storage, to decrypt this frame.

Return False if the decryption fails, TRUE if the decryption works.

BOOL IAX2Frame::Read1Byte ( BYTE &  res  )  [protected]

Read 1 byte from the internal area, (Internal area is filled when reading the packet in). Big Endian.

BOOL IAX2Frame::Read2Bytes ( PINDEX &  res  )  [protected]

Read 2 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian.

BOOL IAX2Frame::Read2Bytes ( WORD &  res  )  [protected]

Read 2 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian.

BOOL IAX2Frame::Read4Bytes ( DWORD &  res  )  [protected]

Read 4 bytes from the internal area, (Internal area is filled when reading the packet in) Big Endian.

void IAX2Frame::Write1Byte ( BYTE  newVal  )  [protected]

Write 1 byte to the internal area, as part of writing the header info

void IAX2Frame::Write1Byte ( PINDEX  newVal  )  [protected]

Write 1 byte to the internal area, as part of writing the header info. Send only the lowest 8 bits of source

void IAX2Frame::Write2Bytes ( PINDEX  newVal  )  [protected]

Write 2 bytes to the internal area, as part of writing the header info Big Endian.

void IAX2Frame::Write4Bytes ( unsigned int  newVal  )  [protected]

Write 4 bytes to the internal area, as part of writing the header info Big Endian.

void IAX2Frame::ZeroAllValues (  )  [protected]

Initialise all internal storage in this structrue

Reimplemented in IAX2MiniFrame, and IAX2FullFrame.


Member Data Documentation

IAX2Remote IAX2Frame::remote [protected]

Specification of the location (address, call number etc) of the far endpoint

IAX2FrameType IAX2Frame::frameType [protected]

Variable specifying the IAX type of frame that this is. Used only in reading from the network

IAX2EndPoint& IAX2Frame::endpoint [protected]

Reference to the global variable of this program

PBYTEArray IAX2Frame::data [protected]

Internal storage array, ready for sending to remote node, or ready for receiving from remote node

BOOL IAX2Frame::isFullFrame [protected]

Flag to indicate if this is a MiniFrame or FullFrame

BOOL IAX2Frame::isVideo [protected]

Flag to indicate if this is a MiniFrame with video

BOOL IAX2Frame::isAudio [protected]

Flag to indicate if this is a MiniFrame with audio

PINDEX IAX2Frame::currentReadIndex [protected]

Index of where we are reading from the internal data area

PINDEX IAX2Frame::currentWriteIndex [protected]

Index of where we are writing to the internal data area

DWORD IAX2Frame::timeStamp [protected]

unsigned 32 bit representaiton of the time of this day

int IAX2Frame::frameIndex [protected]

Internal variable that uniquely identifies this frame

BOOL IAX2Frame::canRetransmitFrame [protected]

Indicate if this frame can be retransmitted

PString IAX2Frame::connectionToken [protected]

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.

DWORD IAX2Frame::presetTimeStamp [protected]

The time stamp to use, for those cases when the user demands a particular timestamp on construction.


The documentation for this class was generated from the following file:
Generated on Fri Mar 7 06:34:02 2008 for OPAL by  doxygen 1.5.1