# IAX2SequenceNumbers Class Reference

`#include <remote.h>`

Collaboration diagram for IAX2SequenceNumbers:

[legend]

## Public Types

| InSequence
| perfect sequence number
| SkippedFrame
| there is a missing frame, a VNAK condition
| RepeatedFrame
| we have already seen this frame...
enum | IncomingOrder { InSequence, SkippedFrame, RepeatedFrame }

## Public Member Functions

| IAX2SequenceNumbers ()
virtual | ~IAX2SequenceNumbers ()
void | ZeroAllValues ()
PINDEX | InSeqNo ()
PINDEX | OutSeqNo ()
PBoolean | IsFirstReplyFrame ()
PBoolean | IsSequenceNosZero ()
void | SetInSeqNo (PINDEX newVal)
void | SetOutSeqNo (PINDEX newVal)
void | SetInOutSeqNo (PINDEX inVal, PINDEX outVal)
void | SetAckSequenceInfo (IAX2SequenceNumbers &other)
PBoolean | operator!= (IAX2SequenceNumbers &other)
PBoolean | operator== (IAX2SequenceNumbers &other)
void | MassageSequenceForSending (IAX2FullFrame &src)
void | WrapAroundFrameSequence (IAX2SequenceNumbers &src)
IncomingOrder | IncomingMessageInOrder (IAX2FullFrame &src)
void | CopyContents (IAX2SequenceNumbers &src)
PString | AsString () const
virtual void | PrintOn (ostream &strm) const
PBoolean | IsFirstReply ()
void | AddWrapAroundValue (PINDEX newOffset)

## Protected Types

| minSpacing = 3
enum | sequenceDefines { minSpacing = 3 }

## Protected Attributes

PINDEX | inSeqNo
PINDEX | outSeqNo
PMutex | mutex
PINDEX | lastSentTimeStamp
IAX2PacketIdList | receivedLog

## Detailed Description

A structure to hold incoming and outgoing sequence numbers

## Member Enumeration Documentation

enum IAX2SequenceNumbers::IncomingOrder

An enum to describe incoming frame. The incoming frame may be on time (perfect sequence numbers) repeated (we have already seen it before) or out of order (a frame is skipped).

Enumerator:

  InSequence | perfect sequence number
  SkippedFrame | there is a missing frame, a VNAK condition
  RepeatedFrame | we have already seen this frame...

enum IAX2SequenceNumbers::sequenceDefines `[protected]`

An enum to contain the various defines required by this clsss

Enumerator:

  minSpacing | minimum spacing in ms for the time stamp of full frames

## Constructor & Destructor Documentation

IAX2SequenceNumbers::IAX2SequenceNumbers | ( |  | ) | `[inline]`

Constructor, which sets the in and out sequence numbers to zero

virtual IAX2SequenceNumbers::~IAX2SequenceNumbers | ( |  | ) | `[inline, virtual]`

Destructor, which is provided as this class contains virtual methods

## Member Function Documentation

void IAX2SequenceNumbers::AddWrapAroundValue | ( | PINDEX | newOffset | ) |

Add an offset to the inSeqNo and outSeqNo variables

PString IAX2SequenceNumbers::AsString | ( |  | ) | const

Report the contents as a string

void IAX2SequenceNumbers::CopyContents | ( | IAX2SequenceNumbers & | src | ) |

Copy the sequence info from the source argument to this class

IncomingOrder IAX2SequenceNumbers::IncomingMessageInOrder | ( | IAX2FullFrame & | src | ) |

We have received a message from the remote node. Check sequence numbers are ok. reply with the appropriate enum to describe if the incoming frame is early, late, or on time

PINDEX IAX2SequenceNumbers::InSeqNo | ( |  | ) |

Read the incoming sequence number

PBoolean IAX2SequenceNumbers::IsFirstReply | ( |  | ) | `[inline]`

Report true if this sequnece info is the very first packet received from a remote node, where we have initiated the call

PBoolean IAX2SequenceNumbers::IsFirstReplyFrame | ( |  | ) |

Report true if the frame has inSeqNo and outSeqNo of 1 and 0 respectively, indicating this is a reply to a new frame (could be an ack, accept frame)

PBoolean IAX2SequenceNumbers::IsSequenceNosZero | ( |  | ) |

Report if the sequences numbers (in and out) are both Zero. This is the case for some frames (new, invalid)

void IAX2SequenceNumbers::MassageSequenceForSending | ( | IAX2FullFrame & | src | ) |

Increment this sequences outSeqNo, and assign the results to the source arg

PBoolean IAX2SequenceNumbers::operator!= | ( | IAX2SequenceNumbers & | other | ) |

Comparison operator - tests if sequence numbers are different

PBoolean IAX2SequenceNumbers::operator== | ( | IAX2SequenceNumbers & | other | ) |

Comparison operator - tests if sequence numbers are equal

PINDEX IAX2SequenceNumbers::OutSeqNo | ( |  | ) |

Read the outgoing sequence number

virtual void IAX2SequenceNumbers::PrintOn | ( | ostream & | strm | ) | const`[virtual]`

Pretty print in and out sequence numbers to the designated stream

void IAX2SequenceNumbers::SetAckSequenceInfo | ( | IAX2SequenceNumbers & | other | ) |

Assign the sequence nos as appropropriate for when we are sending a sequence set in a ack frame

void IAX2SequenceNumbers::SetInOutSeqNo | ( | PINDEX | inVal,
|  | PINDEX | outVal |
| ) |  |  |

Assign a new value to the seq.in and seq.out, which is used prior to sending a frame

void IAX2SequenceNumbers::SetInSeqNo | ( | PINDEX | newVal | ) |

Assign new value to the in (or expected) seq number

void IAX2SequenceNumbers::SetOutSeqNo | ( | PINDEX | newVal | ) |

Assign a new value to the sequence number used for outgoing frames

void IAX2SequenceNumbers::WrapAroundFrameSequence | ( | IAX2SequenceNumbers & | src | ) |

Take the incoming frame, and increment seq nos by some multiple of 256 to bring them into line with the current values. Use the wrapAound member variable to do this.

void IAX2SequenceNumbers::ZeroAllValues | ( |  | ) |

Initialise to Zero values

## Field Documentation

PINDEX IAX2SequenceNumbers::inSeqNo `[protected]`

Packet number (next incoming expected)

PINDEX IAX2SequenceNumbers::lastSentTimeStamp `[protected]`

Last sent time stamp - ensure 3 ms gap between time stamps.

PMutex IAX2SequenceNumbers::mutex `[protected]`

Mutex to protect access to this structrue while doing seqno changes

PINDEX IAX2SequenceNumbers::outSeqNo `[protected]`

Packet number (outgoing)

IAX2PacketIdList IAX2SequenceNumbers::receivedLog `[protected]`

Dictionary of timestamp and OutSeqNo for frames received by this iax device

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

- remote.h