OPAL  Version 3.18.8
IAX2Frame Class Reference

#include <frame.h>

Inheritance diagram for IAX2Frame:
Collaboration 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 ()
 
PBoolean ReadNetworkPacket (PUDPSocket &sock)
 
virtual PBoolean ProcessNetworkPacket ()
 
virtual PBoolean IsFullFrame ()
 
PBoolean IsVideo () const
 
PBoolean IsAudio () const
 
virtual BYTE * GetMediaDataPointer ()
 
virtual PINDEX GetMediaDataSize ()
 
PINDEX DataSize ()
 
IAX2RemoteGetRemoteInfo ()
 
const BYTE * GetDataPointer ()
 
IAX2FrameBuildAppropriateFrameType (IAX2Encryption &encryptionInfo)
 
IAX2FrameBuildAppropriateFrameType ()
 
PINDEX GetUnReadBytes ()
 
virtual PBoolean WriteHeader ()
 
virtual PBoolean TransmitPacket (PUDPSocket &sock)
 
virtual void PrintOn (ostream &strm) const
 
virtual void BuildTimeStamp (const PTimeInterval &callStartTick)
 
IAX2EndPointGetEndpoint ()
 
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
 
IAX2EndPointendpoint
 
PBYTEArray data
 
PBoolean isFullFrame
 
PBoolean isVideo
 
PBoolean isAudio
 
PINDEX currentReadIndex
 
PINDEX currentWriteIndex
 
DWORD timeStamp
 
PBoolean canRetransmitFrame
 
PString connectionToken
 
DWORD presetTimeStamp
 

Detailed Description

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

Member Enumeration Documentation

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

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 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.

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

Calculate the timestamp value, given the call start tick

virtual PBoolean IAX2Frame::CallMustBeActive ( )
inlinevirtual

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

Reimplemented in IAX2FullFrame.

PBoolean IAX2Frame::CanRetransmitFrame ( ) const
inline

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

References canRetransmitFrame.

PINDEX IAX2Frame::DataSize ( )
inline

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

References data.

Referenced by GetMediaDataSize().

PBoolean 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.

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

PString IAX2Frame::GetConnectionToken ( ) const
inline

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

References connectionToken.

const BYTE* IAX2Frame::GetDataPointer ( )
inline

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

References currentReadIndex, and data.

virtual PINDEX IAX2Frame::GetEncryptionOffset ( )
virtual

Get the offset to the beginning of the encrypted region

Reimplemented in IAX2FullFrame, and IAX2MiniFrame.

IAX2EndPoint& IAX2Frame::GetEndpoint ( )
inline

Return a reference to the endpoint structure

References endpoint.

IAX2FrameType IAX2Frame::GetFrameType ( )
inline

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

References frameType.

virtual BYTE* IAX2Frame::GetMediaDataPointer ( )
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.

virtual PINDEX IAX2Frame::GetMediaDataSize ( )
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().

IAX2Remote& IAX2Frame::GetRemoteInfo ( )
inline

Get the value of the Remote structure

References remote.

Referenced by IAX2CallProcessor::Matches().

DWORD IAX2Frame::GetTimeStamp ( )
inline

Get the timestamp as used by this class

References timeStamp.

PINDEX IAX2Frame::GetUnReadBytes ( )
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.

virtual void IAX2Frame::InitialiseHeader ( IAX2Processor )
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.

PBoolean IAX2Frame::IsAudio ( ) const
inline

True if is is an audio frame

References isAudio.

virtual PBoolean IAX2Frame::IsFullFrame ( )
inlinevirtual

True if this is a full frame

Reimplemented in IAX2FullFrame.

References isFullFrame.

PBoolean IAX2Frame::IsVideo ( ) const
inline

True if it is a video frame

References isVideo.

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

Pretty print this frame data to the designated stream

Reimplemented in IAX2FullFrameProtocol, IAX2FullFrame, and IAX2MiniFrame.

virtual PBoolean IAX2Frame::ProcessNetworkPacket ( )
virtual

Interpret the data from the read process

Reimplemented in IAX2FullFrame, and IAX2MiniFrame.

PBoolean IAX2Frame::Read1Byte ( BYTE &  res)
protected

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

PBoolean IAX2Frame::Read2Bytes ( PINDEX &  res)
protected

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

PBoolean IAX2Frame::Read2Bytes ( WORD &  res)
protected

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

PBoolean IAX2Frame::Read4Bytes ( DWORD &  res)
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

void IAX2Frame::SetConnectionToken ( PString  newToken)
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 PBoolean 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.

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.

virtual PBoolean IAX2Frame::WriteHeader ( )
inlinevirtual

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

Reimplemented in IAX2FullFrame, and IAX2MiniFrame.

void IAX2Frame::ZeroAllValues ( )
protected

Initialise all internal storage in this structrue

Field Documentation

PBoolean IAX2Frame::canRetransmitFrame
protected

Indicate if this frame can be retransmitted

Referenced by CanRetransmitFrame().

PString IAX2Frame::connectionToken
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().

PINDEX IAX2Frame::currentReadIndex
protected

Index of where we are reading from the internal data area

Referenced by GetDataPointer(), and GetUnReadBytes().

PINDEX IAX2Frame::currentWriteIndex
protected

Index of where we are writing to the internal data area

PBYTEArray IAX2Frame::data
protected

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

Referenced by DataSize(), GetDataPointer(), GetMediaDataPointer(), and GetUnReadBytes().

IAX2EndPoint& IAX2Frame::endpoint
protected

Reference to the global variable of this program

Referenced by GetEndpoint().

IAX2FrameType IAX2Frame::frameType
protected

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

Referenced by GetFrameType().

PBoolean IAX2Frame::isAudio
protected

Flag to indicate if this is a MiniFrame with audio

Referenced by IsAudio().

PBoolean IAX2Frame::isFullFrame
protected

Flag to indicate if this is a MiniFrame or FullFrame

Referenced by IsFullFrame().

PBoolean IAX2Frame::isVideo
protected

Flag to indicate if this is a MiniFrame with video

Referenced by IsVideo().

DWORD IAX2Frame::presetTimeStamp
protected

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

IAX2Remote IAX2Frame::remote
protected

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

Referenced by GetRemoteInfo().

DWORD IAX2Frame::timeStamp
protected

unsigned 32 bit representaiton of the time of this day

Referenced by GetTimeStamp().


The documentation for this class was generated from the following file: