IAX2FullFrameProtocol Class Reference

`#include <frame.h>`

Inheritance diagram for IAX2FullFrameProtocol:

## Public Types

enum

ProtocolSc {
cmdNew = 1, cmdPing = 2, cmdPong = 3, cmdAck = 4,
cmdHangup = 5, cmdReject = 6, cmdAccept = 7, cmdAuthReq = 8,
cmdAuthRep = 9, cmdInval = 10, cmdLagRq = 11, cmdLagRp = 12,
cmdRegReq = 13, cmdRegAuth = 14, cmdRegAck = 15, cmdRegRej = 16,
cmdRegRel = 17, cmdVnak = 18, cmdDpReq = 19, cmdDpRep = 20,
cmdDial = 21, cmdTxreq = 22, cmdTxcnt = 23, cmdTxacc = 24,
cmdTxready = 25, cmdTxrel = 26, cmdTxrej = 27, cmdQuelch = 28,
cmdUnquelch = 29, cmdPoke = 30, cmdPage = 31, cmdMwi = 32,
cmdUnsupport = 33, cmdTransfer = 34, cmdProvision = 35, cmdFwDownl = 36,
cmdFwData = 37, cmdTxMedia = 38, cmdRtKey = 39, cmdCallToken = 40
}

Public Types inherited from IAX2FullFrame
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

| IAX2FullFrameProtocol (const IAX2Frame &srcFrame)
| IAX2FullFrameProtocol (const IAX2FullFrame &srcFrame)
| IAX2FullFrameProtocol (IAX2Processor *processor, PINDEX subClassValue, ConnectionRequired needCon=IAX2FullFrame::callActive)
| IAX2FullFrameProtocol (IAX2Processor *processor, ProtocolSc subClassValue, ConnectionRequired needCon=IAX2FullFrame::callActive)
| IAX2FullFrameProtocol (IAX2Processor *processor, ProtocolSc subClassValue, IAX2FullFrame *inReplyTo, ConnectionRequired needCon=IAX2FullFrame::callActive)
virtual | ~IAX2FullFrameProtocol ()
void | SetRetransmissionRequired ()
virtual PBoolean | InformationElementsPresent ()
ProtocolSc | GetSubClass () const
virtual PString | GetSubClassName () const
IAX2Ie * | GetIeAt (PINDEX i)
void | AppendIe (IAX2Ie *newElement)
void | WriteIeAsBinaryData ()
void | CopyDataFromIeListTo (IAX2IeData &res)
void | GetRemoteCapability (unsigned int &capability, unsigned int &preferred)
virtual BYTE | GetFullFrameType ()
virtual void | PrintOn (ostream &strm) const
PBoolean | GetCallTokenIe (IAX2IeCallToken &callToken)
Public Member Functions inherited from IAX2FullFrame
| 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
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)
PBoolean | SendFrameNow ()
PBoolean | DeleteFrameNow ()
IAX2SequenceNumbers & | GetSequenceInfo ()
void | MarkAsResent ()
PBoolean | operator*= (IAX2FullFrame &other)
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 ()
IAX2Remote & | GetRemoteInfo ()
const BYTE * | GetDataPointer ()
IAX2Frame * | BuildAppropriateFrameType (IAX2Encryption &encryptionInfo)
IAX2Frame * | BuildAppropriateFrameType ()
PINDEX | GetUnReadBytes ()
virtual void | BuildTimeStamp (const PTimeInterval &callStartTick)
IAX2EndPoint & | GetEndpoint ()
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)

## Static Public Member Functions

static PString | GetSubClassName (PINDEX t)
Static Public Member Functions inherited from IAX2Frame
static DWORD | CalcTimeStamp (const PTimeInterval &callStartTick)

## Protected Member Functions

PBoolean | ReadInformationElements ()
Protected Member Functions inherited from IAX2FullFrame
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

IAX2IeList | ieElements
Protected Attributes inherited from IAX2FullFrame
PTimer | transmissionTimer
PINDEX | 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
IAX2EndPoint & | endpoint
PBYTEArray | data
PBoolean | isFullFrame
PBoolean | isVideo
PBoolean | isAudio
PINDEX | currentReadIndex
PINDEX | currentWriteIndex
DWORD | timeStamp
PBoolean | canRetransmitFrame
PString | connectionToken
DWORD | presetTimeStamp

## Additional Inherited Members

Protected Types inherited from IAX2FullFrame
enum | RetryTime { minRetryTime = 1000, maxRetryTime = 010000, maxRetries = 3 }

## Detailed Description

Handle IAX specific protocol issues. Used for initiating a call, closing a call, registration, reject a call etc.. These are used to manipulate the session.

The data section contains information elements, or type Ie classes.

## Member Enumeration Documentation

enum IAX2FullFrameProtocol::ProtocolSc

enum comtaining the possible subclass value for these IAX protocol control frames

Enumerator
cmdNew | Create a new call
cmdPing | Ping request, which is done on an open call. It is "Are you Alive
cmdPong | reply to a Ping
cmdAck | Acknowledge a Reliably sent full frame
cmdHangup | Request to terminate this call
cmdReject | Refuse to accept this call. May happen if authentication faile
cmdAccept | Allow this call to procee
cmdAuthReq | Ask remote end to supply authenticatio
cmdAuthRep | A reply, that contains authenticatio
cmdInval | Destroy this call immediatly
cmdLagRq | Initial message, used to measure the round trip time
cmdLagRp | Reply to cmdLagrq, which tells us the round trip time
cmdRegReq | Request for Registration
cmdRegAuth | Registration requires for authentication
cmdRegAck | Registration has been accepted
cmdRegRej | Registration has been rejected
cmdRegRel | Force the release of the current registration
cmdVnak | This indicates out of order frames, and can be read as voice not acknowledged
cmdDpReq | Request the status of an entry for dialplan
cmdDpRep | Request status of an entry for dialplan
cmdDial | Request that there is a dial (TBD) on a channel
cmdTxreq | Request a Transfer
cmdTxcnt | Connect up a Transfer
cmdTxacc | Transfer has been accepted
cmdTxready | Transfer is ready to happen
cmdTxrel | Release a Transfer
cmdTxrej | Reject a Transfer
cmdQuelch | Stop media transmission
cmdUnquelch | Resume media transmission
cmdPoke | Query the remote endpoint (there is no open connection)
cmdPage | Do a Page
cmdMwi | Indicate : message waiting
cmdUnsupport | We have received an unsupported message
cmdTransfer | Initiate the remote end to do a transfer
cmdProvision | Provision the remote end
cmdFwDownl | The remote end must download some firmware
cmdFwData | This message contains firmware.
cmdTxMedia | undocumented - for now .
cmdRtKey | More undocumented. Apologies
cmdCallToken | Prevents DOS attack of handling multiple incoming calls.

## Constructor & Destructor Documentation

IAX2FullFrameProtocol::IAX2FullFrameProtocol | ( | const IAX2Frame & | srcFrame | ) |

Construction from a supplied dataframe. In this case, this class is filled from an incoming data packet. Classes generated like this are used to handle received data.

IAX2FullFrameProtocol::IAX2FullFrameProtocol | ( | const IAX2FullFrame & | srcFrame | ) |

Construction from a supplied dataframe. In this case, this class is filled from an incoming data packet. Classes generated like this are used to handle received data.

IAX2FullFrameProtocol::IAX2FullFrameProtocol | ( | IAX2Processor * | processor,
|  | PINDEX | subClassValue,
|  | ConnectionRequired | needCon = `IAX2FullFrame::callActive`
| ) |  |

Construction from a Connection class. Classes generated from this are then on sent to a remote endpoint.

Parameters

  processor | Iax Processor from which this frame originates
  subClassValue | IAX protocol command for remote end to process
  needCon | this frame is only sent if the Connection class exists

IAX2FullFrameProtocol::IAX2FullFrameProtocol | ( | IAX2Processor * | processor,
|  | ProtocolSc | subClassValue,
|  | ConnectionRequired | needCon = `IAX2FullFrame::callActive`
| ) |  |

Construction from an Connection class. Classes generated from this are then on sent to a remote endpoint.

Parameters

  processor | Iax Processor from which this frame originates
  subClassValue | IAX protocol command for remote end to process
  needCon | this frame is only sent if the Connection class exists

IAX2FullFrameProtocol::IAX2FullFrameProtocol | ( | IAX2Processor * | processor,
|  | ProtocolSc | subClassValue,
|  | IAX2FullFrame * | inReplyTo,
|  | ConnectionRequired | needCon = `IAX2FullFrame::callActive`
| ) |  |

Construction from a Connection class. Classes generated from this are then on sent to a remote endpoint.

We have received a IAX2FullFrameProtocol, and this constructor is used to create a reply. Use the iseqno and time stamp from the supplied frame to construct the reply

Parameters

  processor | Iax Processor from which this frame originates
  subClassValue | IAX protocol command for remote end to process
  inReplyTo | this message was sent in reply to this frame
  needCon | this frame is only sent if the Connection class exists

virtual IAX2FullFrameProtocol::~IAX2FullFrameProtocol | ( |  | ) |

virtual

Destructor, which deletes all current Information Elements

## Member Function Documentation

void IAX2FullFrameProtocol::AppendIe | ( | IAX2Ie * | newElement | ) |

inline

Add a new Information Element (Ie) to the intenral list

References IAX2IeList::AppendIe(), and ieElements.

void IAX2FullFrameProtocol::CopyDataFromIeListTo | ( | IAX2IeData & | res | ) |

Transfer the data (stored in the IeList) and place it in into the IeData class. This is done when precessing a frame we have received from an external node, which has to be stored in the IeData class

PBoolean IAX2FullFrameProtocol::GetCallTokenIe | ( | IAX2IeCallToken & | callToken | ) |

Go through the list of IEs read in, and find the CallToken Ie, and return a copy of it to the caller. If found, return true.

virtual BYTE IAX2FullFrameProtocol::GetFullFrameType | ( |  | ) |

inline virtual

Return the IAX2FullFrame type represented here (voice, protocol, session etc

Reimplemented from IAX2FullFrame.

References IAX2Frame::iax2ProtocolType.

IAX2Ie* IAX2FullFrameProtocol::GetIeAt | ( | PINDEX | i | ) |

inline

Return a pointer to the n'th Ie in the internal list. If it is not there, a NULL is returned

References IAX2IeList::GetIeAt(), and ieElements.

void IAX2FullFrameProtocol::GetRemoteCapability | ( | unsigned int & | capability,
|  | unsigned int & | preferred
| ) |  |

Look through the list of IEs, and look for remote capabability and preferred codec

ProtocolSc IAX2FullFrameProtocol::GetSubClass | ( |  | ) | const

inline

Report the current value of the subClass variable

References IAX2FullFrame::subClass.

virtual PString IAX2FullFrameProtocol::GetSubClassName | ( |  | ) | const

virtual

Get text description of the subclass contents

Reimplemented from IAX2FullFrame.

static PString IAX2FullFrameProtocol::GetSubClassName | ( | PINDEX | t | ) |

static

Get text description of the subclass contents

virtual PBoolean IAX2FullFrameProtocol::InformationElementsPresent | ( |  | ) |

inline virtual

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

Reimplemented from IAX2FullFrame.

References ieElements, and IAX2IeList::IsEmpty().

virtual void IAX2FullFrameProtocol::PrintOn | ( | ostream & | strm | ) | const

virtual

Pretty print this frame data to the designated stream

Reimplemented from IAX2FullFrame.

PBoolean IAX2FullFrameProtocol::ReadInformationElements | ( |  | ) |

protected

Read the information elements from the incoming data array to generate a list of information element classes

void IAX2FullFrameProtocol::SetRetransmissionRequired | ( |  | ) |

Set internal variable to say that this frame does not need to be retransmitted

void IAX2FullFrameProtocol::WriteIeAsBinaryData | ( |  | ) |

Write the contents of the Ie internal list to the frame data array. This is usually done in preparation to transmitting this frame

## Field Documentation

IAX2IeList IAX2FullFrameProtocol::ieElements

protected

A list of the IEs read from/(or written to) the data section of this frame,

Referenced by AppendIe(), GetIeAt(), and InformationElementsPresent().

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

- frame.h