Yate
IAXFrame Class Reference

This class holds an IAX frame. More...

#include <yateiax.h>

Inheritance diagram for IAXFrame:
RefObject GenObject IAXFullFrame IAXFrameOut

Public Types

enum  Type {
  DTMF = 0x01 , Voice = 0x02 , Video = 0x03 , Control = 0x04 ,
  Null = 0x05 , IAX = 0x06 , Text = 0x07 , Image = 0x08 ,
  HTML = 0x09 , Noise = 0x0a
}
 

Public Member Functions

 IAXFrame (Type type, u_int16_t sCallNo, u_int32_t tStamp, bool retrans, const unsigned char *buf, unsigned int len, bool mark=false)
 
virtual ~IAXFrame ()
 
Type type () const
 
DataBlockdata ()
 
bool retrans () const
 
u_int16_t sourceCallNo () const
 
u_int32_t timeStamp () const
 
bool mark () const
 
virtual IAXFullFramefullFrame ()
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static IAXFrameparse (const unsigned char *buf, unsigned int len, IAXEngine *engine=0, const SocketAddr *addr=0)
 
static void buildMiniFrame (DataBlock &dest, u_int16_t sCallNo, u_int32_t ts, void *data, unsigned int len)
 
static void buildVideoMetaFrame (DataBlock &dest, u_int16_t sCallNo, u_int32_t tStamp, bool mark, void *data, unsigned int len)
 
static u_int8_t packSubclass (u_int32_t value)
 
static u_int32_t unpackSubclass (u_int8_t value)
 
static const char * typeText (int type)
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Protected Attributes

DataBlock m_data
 
bool m_retrans
 

Additional Inherited Members

- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
virtual void destroyed ()
 

Detailed Description

This class holds an IAX frame.

This class holds all data needded to manage an IAX frame

Member Enumeration Documentation

◆ Type

enum Type

IAX frame type enumeration

Constructor & Destructor Documentation

◆ IAXFrame()

IAXFrame ( Type type,
u_int16_t sCallNo,
u_int32_t tStamp,
bool retrans,
const unsigned char * buf,
unsigned int len,
bool mark = false )

Constructor. Constructs an incoming frame

Parameters
typeFrame type
sCallNoSource call number
tStampFrame timestamp
retransRetransmission flag
bufIE buffer
lenIE buffer length
markMark flag

References mark(), retrans(), and type().

Referenced by parse().

◆ ~IAXFrame()

virtual ~IAXFrame ( )
virtual

Destructor

Member Function Documentation

◆ buildMiniFrame()

static void buildMiniFrame ( DataBlock & dest,
u_int16_t sCallNo,
u_int32_t ts,
void * data,
unsigned int len )
inlinestatic

Build a miniframe buffer

Parameters
destDestination buffer
sCallNoSource call number
tsFrame timestamp
dataData
lenData length

References DataBlock::append(), DataBlock::assign(), and data().

◆ buildVideoMetaFrame()

static void buildVideoMetaFrame ( DataBlock & dest,
u_int16_t sCallNo,
u_int32_t tStamp,
bool mark,
void * data,
unsigned int len )
static

Build a video meta frame buffer

Parameters
destDestination buffer
sCallNoSource call number
tStampFrame timestamp
markFrame mark
dataData
lenData length

References data(), and mark().

◆ data()

DataBlock & data ( )
inline

Get the data buffer of the frame

Returns
The data buffer of the frame

References m_data.

Referenced by buildMiniFrame(), buildVideoMetaFrame(), and IAXEngine::writeSocket().

◆ fullFrame()

virtual IAXFullFrame * fullFrame ( )
virtual

Get a pointer to this frame if it is a full frame

Returns
A pointer to this frame if it is a full frame or 0

Reimplemented in IAXFullFrame.

◆ mark()

◆ packSubclass()

static u_int8_t packSubclass ( u_int32_t value)
static

Pack a subclass value according to IAX protocol

Parameters
valueValue to pack
Returns
The packed subclass value or 0 if invalid (>255 and not a power of 2)

◆ parse()

static IAXFrame * parse ( const unsigned char * buf,
unsigned int len,
IAXEngine * engine = 0,
const SocketAddr * addr = 0 )
static

Parse a received buffer and returns a IAXFrame pointer if valid

Parameters
bufReceived buffer
lenBuffer length
engineThe IAXEngine who requested the operation
addrThe source address
Returns
A frame pointer on success or 0

References IAXFrame().

◆ retrans()

bool retrans ( ) const
inline

Get the retransmission flag of this frame

Returns
The retransmission flag of this frame

References m_retrans.

Referenced by IAXFrame(), and IAXFullFrame::IAXFullFrame().

◆ sourceCallNo()

u_int16_t sourceCallNo ( ) const
inline

Get the source call number of this frame

Returns
The source call number of this frame

◆ timeStamp()

u_int32_t timeStamp ( ) const
inline

Get the timestamp of this frame

Returns
The timestamp of this frame

◆ type()

◆ typeText()

static const char * typeText ( int type)
inlinestatic

Get the string associated with the given IAX frame type

Parameters
typeThe requested type
Returns
The text if type is valid or 0

References type().

◆ unpackSubclass()

static u_int32_t unpackSubclass ( u_int8_t value)
static

Unpack a subclass value according to IAX protocol

Parameters
valueValue to unpack
Returns
The unpacked subclass value

Member Data Documentation

◆ m_data

DataBlock m_data
protected

Contains the frame's IE list for an incoming frame or the whole frame for an outgoing one

Referenced by data(), and IAXFrameOut::setRetrans().

◆ m_retrans

bool m_retrans
protected

Retransmission flag

Referenced by retrans(), and IAXFrameOut::setRetrans().


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