# class IAXFrame | This class holds an IAX frame. More...
Full name | `TelEngine::IAXFrame`
Definition | `#include <libs/yiax/yateiax.h>`
Inherits | TelEngine::RefObject [public ]
Inherited by | IAXFrameOut, IAXFullFrame
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### 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 Methods

- 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 ()
- inline Type type () const
- inline DataBlock& data ()
- inline bool retrans () const
- inline u_int16_t sourceCallNo () const
- inline u_int32_t timeStamp () const
- inline bool mark () const
- virtual IAXFullFrame* fullFrame ()

#### Public Static Methods

- static IAXFrame* parse (const unsigned char* buf, unsigned int len, IAXEngine* engine = 0, const SocketAddr* addr = 0)
- static inline 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 inline const char* typeText (int type)

#### Protected Members

- DataBlock m_data
- bool m_retrans

## Detailed Description

This class holds all data needded to manage an IAX frame

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

IAX frame type enumeration

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

Constructor. Constructs an incoming frame

Parameters:

type | Frame type
sCallNo | Source call number
tStamp | Frame timestamp
retrans | Retransmission flag
buf | IE buffer
len | IE buffer length
mark | Mark flag

~IAXFrame () | ### ~IAXFrame

[virtual]

Destructor

inline Type type () | ### type

[const]

Get the type of this frame as enumeration

Returns: The type of this frame as enumeration

inline DataBlock& data () | ### data

Get the data buffer of the frame

Returns: The data buffer of the frame

inline bool retrans () | ### retrans

[const]

Get the retransmission flag of this frame

Returns: The retransmission flag of this frame

inline u_int16_t sourceCallNo () | ### sourceCallNo

[const]

Get the source call number of this frame

Returns: The source call number of this frame

inline u_int32_t timeStamp () | ### timeStamp

[const]

Get the timestamp of this frame

Returns: The timestamp of this frame

inline bool mark () | ### mark

[const]

Get the mark flag

Returns: The mark flag

IAXFullFrame* fullFrame () | ### 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

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

[static]

Parse a received buffer and returns a IAXFrame pointer if valid

Parameters:

buf | Received buffer
len | Buffer length
engine | The IAXEngine who requested the operation
addr | The source address

Returns: A frame pointer on success or 0

inline void buildMiniFrame (DataBlock& dest, u_int16_t sCallNo, u_int32_t ts, void* data, unsigned int len) | ### buildMiniFrame

[static]

Build a miniframe buffer

Parameters:

dest | Destination buffer
sCallNo | Source call number
ts | Frame timestamp
data | Data
len | Data length

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

[static]

Build a video meta frame buffer

Parameters:

dest | Destination buffer
sCallNo | Source call number
tStamp | Frame timestamp
mark | Frame mark
data | Data
len | Data length

u_int8_t packSubclass (u_int32_t value) | ### packSubclass

[static]

Pack a subclass value according to IAX protocol

Parameters:

value | Value to pack

Returns: The packed subclass value or 0 if invalid (>255 and not a power of 2)

u_int32_t unpackSubclass (u_int8_t value) | ### unpackSubclass

[static]

Unpack a subclass value according to IAX protocol

Parameters:

value | Value to unpack

Returns: The unpacked subclass value

inline const char* typeText (int type) | ### typeText

[static]

Get the string associated with the given IAX frame type

Parameters:

type | The requested type

Returns: The text if type is valid or 0

DataBlock m_data | ### m_data

[protected]

bool m_retrans | ### m_retrans

[protected]

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.