OPAL
Version 3.14.3
|
#include <frame.h>
Public Types | |
enum | ConnectionRequired { callActive, callIrrelevant } |
![]() | |
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 () |
IAX2SequenceNumbers & | GetSequenceInfo () |
virtual void | PrintOn (ostream &strm) const |
void | MarkAsResent () |
PBoolean | operator*= (IAX2FullFrame &other) |
virtual BYTE | GetFullFrameType () |
virtual PINDEX | GetEncryptionOffset () |
![]() | |
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) |
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) |
![]() | |
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 |
![]() | |
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 | |
![]() | |
static DWORD | CalcTimeStamp (const PTimeInterval &callStartTick) |
Class to handle a full frame, which is sent reliably to the remote endpoint
|
protected |
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 |
Delete this frame now, but first we have to delete every timer on it.
|
inlineprotectedvirtual |
Report flag stating that this call must be active when this frame is transmitted
Reimplemented from IAX2Frame.
References callMustBeActive.
|
protected |
Mark this frame as not to be sent, and not to be deleted
|
protected |
Turn the 16 bit subClass value into a 8 bit representation
|
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
|
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
|
inlinevirtual |
Return the FullFrame type represented here (voice, protocol, session etc
Reimplemented in IAX2FullFrameCng, IAX2FullFrameHtml, IAX2FullFrameImage, IAX2FullFrameText, IAX2FullFrameProtocol, IAX2FullFrameNull, IAX2FullFrameSessionControl, IAX2FullFrameVideo, IAX2FullFrameVoice, and IAX2FullFrameDtmf.
|
virtual |
Pointer to the beginning of the media (after the header) in this packet
Reimplemented from IAX2Frame.
|
virtual |
Number of bytes in the media section of this packet.
Reimplemented from IAX2Frame.
|
inline |
Get the sequence number info (inSeqNo and outSeqNo)
References sequence.
|
inline |
Determine the current value of the subClass variable
References subClass.
|
inlinevirtual |
Get text description of the subclass contents
Reimplemented in IAX2FullFrameCng, IAX2FullFrameHtml, IAX2FullFrameImage, IAX2FullFrameText, IAX2FullFrameProtocol, IAX2FullFrameNull, IAX2FullFrameSessionControl, IAX2FullFrameVideo, IAX2FullFrameVoice, and IAX2FullFrameDtmf.
References subClass.
|
inlinevirtual |
Mark this frame as having (or not having) information elements
Reimplemented in IAX2FullFrameProtocol.
|
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.
|
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
|
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.
|
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 |
Pretty print this frame data to the designated stream
Reimplemented from IAX2Frame.
Reimplemented in IAX2FullFrameProtocol.
|
virtual |
Process the incoming frame some more, but process it as a full frame
Reimplemented from IAX2Frame.
|
inline |
Get flag to see if this frame is ready to be sent (or resent). In other words, has the timer expired?
References sendFrameNow.
|
inline |
Dry the current value of the subClass variable
References subClass.
|
virtual |
Send this packet on the specified socket to the remote host. This method is only called by the transmiter.
Reimplemented from IAX2Frame.
|
protected |
Turn the 8 bit subClass value into a 16 bit representation
|
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
|
protected |
Flag stating that this call must be active when this frame is transmitted
Referenced by CallMustBeActive().
|
protected |
List flag, this frame is ready for deletion (too many retries)
Referenced by DeleteFrameNow().
|
protected |
flag to indicate if this is an ack frame
Referenced by IsAckFrame().
|
protected |
A tracking flag to indicate this fame has been resent
|
protected |
Number of retries this frame has undergone
|
protected |
Time to wait between retries
|
protected |
List flag, indicating if this frame ready for sending
Referenced by SendFrameNow().
|
protected |
Class holding the sequence numbers, which is used by all classes which have a FullFrame ancestor.
Referenced by GetSequenceInfo().
|
protected |
integer variable specifying the uncompressed subClass value for this particular frame
Referenced by GetSubClass(), IAX2FullFrameProtocol::GetSubClass(), GetSubClassName(), and SetSubClass().
|
protected |
Time delta between call start and sending (or receiving)
|
protected |
The timer which is used to test for no reply to this frame (on transmission)