OPAL  Version 3.18.8
IAX2FullFrame Class Reference

#include <frame.h>

Inheritance diagram for IAX2FullFrame:
Collaboration diagram for IAX2FullFrame:

Public Types

enum  ConnectionRequired { callActive, callIrrelevant }
 
- Public Types inherited from IAX2Frame
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

 IAX2FullFrame (const IAX2Frame &srcFrame)
 
 IAX2FullFrame (IAX2EndPoint &_endpoint)
 
virtual ~IAX2FullFrame ()
 
PBoolean IsAckFrame ()
 
PBoolean IsPingFrame ()
 
PBoolean IsNewFrame ()
 
PBoolean IsLagRqFrame ()
 
PBoolean IsLagRpFrame ()
 
PBoolean IsPongFrame ()
 
PBoolean IsAuthReqFrame ()
 
PBoolean IsVnakFrame ()
 
PBoolean IsRegReqFrame ()
 
PBoolean IsRegAuthFrame ()
 
PBoolean IsRegAckFrame ()
 
PBoolean IsRegRelFrame ()
 
PBoolean IsRegRejFrame ()
 
PBoolean IsCallTokenFrame ()
 
PBoolean FrameIncrementsInSeqNo ()
 
virtual PBoolean IsFullFrame ()
 
PBoolean IsHangupFrame ()
 
void ZeroAllValues ()
 
virtual PBoolean ProcessNetworkPacket ()
 
virtual PBoolean TransmitPacket (PUDPSocket &sock)
 
PString GetFullFrameName () const
 
virtual PString GetSubClassName () const
 
void MarkDeleteNow ()
 
void MarkVnakSendNow ()
 
virtual BYTE * GetMediaDataPointer ()
 
virtual PINDEX GetMediaDataSize ()
 
PINDEX GetSubClass () const
 
void SetSubClass (PINDEX newValue)
 
virtual PBoolean WriteHeader ()
 
void ModifyFrameHeaderSequenceNumbers (PINDEX inNo, PINDEX outNo)
 
void ModifyFrameTimeStamp (PINDEX newTimeStamp)
 
virtual PBoolean InformationElementsPresent ()
 
PBoolean SendFrameNow ()
 
PBoolean DeleteFrameNow ()
 
IAX2SequenceNumbersGetSequenceInfo ()
 
virtual void PrintOn (ostream &strm) const
 
void MarkAsResent ()
 
PBoolean operator*= (IAX2FullFrame &other)
 
virtual BYTE GetFullFrameType ()
 
virtual PINDEX GetEncryptionOffset ()
 
- Public Member Functions inherited from IAX2Frame
 IAX2Frame (IAX2EndPoint &_endpoint)
 
virtual ~IAX2Frame ()
 
PBoolean ReadNetworkPacket (PUDPSocket &sock)
 
PBoolean IsVideo () const
 
PBoolean IsAudio () const
 
PINDEX DataSize ()
 
IAX2RemoteGetRemoteInfo ()
 
const BYTE * GetDataPointer ()
 
IAX2FrameBuildAppropriateFrameType (IAX2Encryption &encryptionInfo)
 
IAX2FrameBuildAppropriateFrameType ()
 
PINDEX GetUnReadBytes ()
 
virtual void BuildTimeStamp (const PTimeInterval &callStartTick)
 
IAX2EndPointGetEndpoint ()
 
PString IdString () const
 
DWORD GetTimeStamp ()
 
void SetTimeStamp (DWORD newValue)
 
IAX2FrameType GetFrameType ()
 
PBoolean CanRetransmitFrame () const
 
PString GetConnectionToken () const
 
void SetConnectionToken (PString newToken)
 
void BuildConnectionToken ()
 
PBoolean EncryptContents (IAX2Encryption &encData)
 

Protected Types

enum  RetryTime { minRetryTime = 1000, maxRetryTime = 010000, maxRetries = 3 }
 

Protected Member Functions

virtual PBoolean CallMustBeActive ()
 
void UnCompressSubClass (BYTE a)
 
int CompressSubClass ()
 
void ClearListFlags ()
 
virtual void InitialiseHeader (IAX2Processor *processor)
 
void OnTransmissionTimeout (PTimer &, INT)
 
- Protected Member Functions inherited from IAX2Frame
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

PTimer transmissionTimer
 
int subClass
 
PTimeInterval retryDelta
 
PTimeInterval timeOffset
 
PINDEX retries
 
IAX2SequenceNumbers sequence
 
PBoolean sendFrameNow
 
PBoolean deleteFrameNow
 
PBoolean packetResent
 
PBoolean callMustBeActive
 
PBoolean isAckFrame
 
- Protected Attributes inherited from IAX2Frame
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
 

Additional Inherited Members

- Static Public Member Functions inherited from IAX2Frame
static DWORD CalcTimeStamp (const PTimeInterval &callStartTick)
 

Detailed Description

Class to handle a full frame, which is sent reliably to the remote endpoint

Member Enumeration Documentation

enum to define if the call must be active when sending this frame

Enumerator
callActive 

the call must be active when sending frame

callIrrelevant 

the call may, or may not be, active when sending frame

enum IAX2FullFrame::RetryTime
protected

Internal variables specifying the retry time periods (in milliseconds)

Enumerator
minRetryTime 

1000 milliseconds

maxRetryTime 

10 seconds

maxRetries 

number of retries

Constructor & Destructor Documentation

IAX2FullFrame::IAX2FullFrame ( const IAX2Frame srcFrame)

Construction from a supplied dataframe. In this case, this class is filled from an incoming data packet

IAX2FullFrame::IAX2FullFrame ( IAX2EndPoint _endpoint)

Construction from an endpoint, to create an empty frame. In this case, the class is filled with the various methods

virtual IAX2FullFrame::~IAX2FullFrame ( )
virtual

Delete this frame now, but first we have to delete every timer on it.

Member Function Documentation

virtual PBoolean IAX2FullFrame::CallMustBeActive ( )
inlineprotectedvirtual

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

Reimplemented from IAX2Frame.

References callMustBeActive.

void IAX2FullFrame::ClearListFlags ( )
protected

Mark this frame as not to be sent, and not to be deleted

int IAX2FullFrame::CompressSubClass ( )
protected

Turn the 16 bit subClass value into a 8 bit representation

PBoolean IAX2FullFrame::DeleteFrameNow ( )
inline

Get flag to see if this frame is ready for deletion. In other words. Has it been sent too many times?

References deleteFrameNow.

PBoolean IAX2FullFrame::FrameIncrementsInSeqNo ( )

Return True if this FullFrame is of a type that increments the InSeqNo

virtual PINDEX IAX2FullFrame::GetEncryptionOffset ( )
inlinevirtual

Get the offset to the beginning of the encrypted region

Reimplemented from IAX2Frame.

PString IAX2FullFrame::GetFullFrameName ( ) const

Get text descrption of this frame type

virtual BYTE IAX2FullFrame::GetFullFrameType ( )
inlinevirtual
virtual BYTE* IAX2FullFrame::GetMediaDataPointer ( )
virtual

Pointer to the beginning of the media (after the header) in this packet

Reimplemented from IAX2Frame.

virtual PINDEX IAX2FullFrame::GetMediaDataSize ( )
virtual

Number of bytes in the media section of this packet.

Reimplemented from IAX2Frame.

IAX2SequenceNumbers& IAX2FullFrame::GetSequenceInfo ( )
inline

Get the sequence number info (inSeqNo and outSeqNo)

References sequence.

PINDEX IAX2FullFrame::GetSubClass ( ) const
inline

Determine the current value of the subClass variable

References subClass.

virtual PString IAX2FullFrame::GetSubClassName ( ) const
inlinevirtual
virtual PBoolean IAX2FullFrame::InformationElementsPresent ( )
inlinevirtual

Mark this frame as having (or not having) information elements

Reimplemented in IAX2FullFrameProtocol.

virtual void IAX2FullFrame::InitialiseHeader ( IAX2Processor processor)
protectedvirtual

Given the supplied Connection class, write the first 12 bytes of the frame. This method is called by the frame construcors, in preparation for transmission. This method is never called when processing a received frame.

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

Reimplemented from IAX2Frame.

PBoolean IAX2FullFrame::IsAckFrame ( )
inline

Return True if this an ack frame

References isAckFrame.

PBoolean IAX2FullFrame::IsAuthReqFrame ( )

Return True if this is a AuthReq frame

PBoolean IAX2FullFrame::IsCallTokenFrame ( )

Return True if this is a CALLTOKEN frame

virtual PBoolean IAX2FullFrame::IsFullFrame ( )
inlinevirtual

True if this is a full frame - always returns true as this is a full frame.

Reimplemented from IAX2Frame.

PBoolean IAX2FullFrame::IsHangupFrame ( )

Report true if this is a hangup frame. We need this information for processing incoming frames, before fully dissection of the frame has completed

PBoolean IAX2FullFrame::IsLagRpFrame ( )

Return True if this is a LAGRP frame

PBoolean IAX2FullFrame::IsLagRqFrame ( )

Return True if this is a LAGRQ frame

PBoolean IAX2FullFrame::IsNewFrame ( )

Return True if this is a NEW frame

PBoolean IAX2FullFrame::IsPingFrame ( )

Return True if this is a PING frame

PBoolean IAX2FullFrame::IsPongFrame ( )

Return True if this is a PONG frame

PBoolean IAX2FullFrame::IsRegAckFrame ( )

Return True if this is a REGACK frame

PBoolean IAX2FullFrame::IsRegAuthFrame ( )

Return True if this is a REGAUTH frame

PBoolean IAX2FullFrame::IsRegRejFrame ( )

Return True if this is a REGREJ frame

PBoolean IAX2FullFrame::IsRegRelFrame ( )

Return True if this is a REGREL frame

PBoolean IAX2FullFrame::IsRegReqFrame ( )

Return True if this is a REGREQ frame

PBoolean IAX2FullFrame::IsVnakFrame ( )

Return True if this is a VNAK frame

void IAX2FullFrame::MarkAsResent ( )

Mark this frame as having been resent (set bit 7 of data[2])

void IAX2FullFrame::MarkDeleteNow ( )

Stop the timer, so this packet is not retransmitted. Mark packet as dead. This happens when a packet has been received that matches one of the previously sent packets.

void IAX2FullFrame::MarkVnakSendNow ( )

A Vnak frame has been received. This Vnak frame is demanding that we resend this particular frame. Given it is to be resent by vnak, we reset the countdown variables. E.G. it gets the full amount of retries again.

void IAX2FullFrame::ModifyFrameHeaderSequenceNumbers ( PINDEX  inNo,
PINDEX  outNo 
)

Alter the two bytes for in and out sequence values. (in the header)

void IAX2FullFrame::ModifyFrameTimeStamp ( PINDEX  newTimeStamp)

Alter the four bytes for this frames timestamp. It is required, when transmitting full frames, that there is a 3ms interval to last full frame in the timestamps. This is required by limitations in the handline of time in asterisk.

void IAX2FullFrame::OnTransmissionTimeout ( PTimer &  ,
INT   
)
protected

pwlib constructs to cope with timeout, when transmitting a full frame. This happens when a full frame has not been acknowledged in the required time period. This frame will be resent.

PBoolean IAX2FullFrame::operator*= ( IAX2FullFrame other)

Compare this FullFrame with another full frame, which is used when determining if we are dealing with a frame we have already processed

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

Pretty print this frame data to the designated stream

Reimplemented from IAX2Frame.

Reimplemented in IAX2FullFrameProtocol.

virtual PBoolean IAX2FullFrame::ProcessNetworkPacket ( )
virtual

Process the incoming frame some more, but process it as a full frame

Reimplemented from IAX2Frame.

PBoolean IAX2FullFrame::SendFrameNow ( )
inline

Get flag to see if this frame is ready to be sent (or resent). In other words, has the timer expired?

References sendFrameNow.

void IAX2FullFrame::SetSubClass ( PINDEX  newValue)
inline

Dry the current value of the subClass variable

References subClass.

virtual PBoolean IAX2FullFrame::TransmitPacket ( PUDPSocket &  sock)
virtual

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

Reimplemented from IAX2Frame.

void IAX2FullFrame::UnCompressSubClass ( BYTE  a)
protected

Turn the 8 bit subClass value into a 16 bit representation

virtual PBoolean IAX2FullFrame::WriteHeader ( )
virtual

Write the header for this class to the internal data array. 12 bytes of data are writen. The application developer must write the remaining bytes, before transmiting this frame.

Reimplemented from IAX2Frame.

void IAX2FullFrame::ZeroAllValues ( )

Initialise to zero all the members of this particular class

Field Documentation

PBoolean IAX2FullFrame::callMustBeActive
protected

Flag stating that this call must be active when this frame is transmitted

Referenced by CallMustBeActive().

PBoolean IAX2FullFrame::deleteFrameNow
protected

List flag, this frame is ready for deletion (too many retries)

Referenced by DeleteFrameNow().

PBoolean IAX2FullFrame::isAckFrame
protected

flag to indicate if this is an ack frame

Referenced by IsAckFrame().

PBoolean IAX2FullFrame::packetResent
protected

A tracking flag to indicate this fame has been resent

PINDEX IAX2FullFrame::retries
protected

Number of retries this frame has undergone

PTimeInterval IAX2FullFrame::retryDelta
protected

Time to wait between retries

PBoolean IAX2FullFrame::sendFrameNow
protected

List flag, indicating if this frame ready for sending

Referenced by SendFrameNow().

IAX2SequenceNumbers IAX2FullFrame::sequence
protected

Class holding the sequence numbers, which is used by all classes which have a FullFrame ancestor.

Referenced by GetSequenceInfo().

int IAX2FullFrame::subClass
protected

integer variable specifying the uncompressed subClass value for this particular frame

Referenced by GetSubClass(), IAX2FullFrameProtocol::GetSubClass(), GetSubClassName(), and SetSubClass().

PTimeInterval IAX2FullFrame::timeOffset
protected

Time delta between call start and sending (or receiving)

PTimer IAX2FullFrame::transmissionTimer
protected

The timer which is used to test for no reply to this frame (on transmission)


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