# namespace TelEngine

Holds all Telephony Engine related classes. More...

List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum DebugLevel { DebugFail = 0, DebugTest = 1, DebugGoOn = 2, DebugConf = 3, DebugStub = 4, DebugWarn = 5, DebugMild = 6, DebugCall = 7, DebugNote = 8, DebugInfo = 9, DebugAll = 10 }
- class DebugEnabler
- class Debugger
- struct TokenDict
- class String
- class Mutex
- class GenObject
- class RefObject
- class RefPointerBase
- class RefPointer
- class GenPointer
- class ObjList
- class ObjVector
- class Array
- class Regexp
- class CapturedEvent
- class NamedString
- class NamedPointer
- class HashList
- class ListIterator
- class Time
- class Random
- class DataBlock
- class MD5
- class SHA1
- class Base64
- class NamedIterator
- class NamedList
- class URI
- class Lockable
- class MutexPool
- class Semaphore
- class Lock
- class Lock2
- class Runnable
- class Thread
- class Socket
- class SocketAddr
- class SocketFilter
- class Stream
- class MemoryStream
- class File
- class SctpSocket
- class DnsRecord
- class SrvRecord
- class NaptrRecord
- class Resolver
- class Cipher
- class Compressor
- class SysUsage
- class MimeHeaderLine
- class MimeAuthLine
- class MimeBody
- class MimeMultipartBody
- class MimeSdpBody
- class MimeBinaryBody
- class MimeStringBody
- class MimeLinesBody
- class Configuration
- class SharedVars
- class MessageDispatcher
- class MessageRelay
- class Engine
- class Message
- class MessageHandler
- class MessageReceiver
- class MessageNotifier
- class MessagePostHook
- class Plugin
- class EngineCheck
- struct ImageInfo
- struct FormatInfo
- class DataEndpoint
- class CallEndpoint
- class Driver
- struct TranslatorCaps
- class FormatRepository
- class DataFormat
- class DataNode
- class DataSource
- class DataTranslator
- class TranslatorFactory
- class DataConsumer
- class ThreadedSource
- class Module
- class Channel
- class Router
- class Window
- class UIWidget
- class UIFactory
- class Client
- class ClientChannel
- class ClientDriver
- class ClientLogic
- class DefaultLogic
- class ClientAccount
- class ClientAccountList
- class ClientContact
- class ClientResource
- class MucRoomMember
- class MucRoom
- class DurationUpdate
- class ClientSound

#### Public Methods

- void abortOnBug ()
- bool abortOnBug (bool doAbort)
- int debugLevel ()
- int debugLevel (int level)
- bool debugAt (int level)
- const char* debugColor (int level)
- void DDebug (int level, const char* format, ...)
- void DDebug (const char* facility, int level, const char* format, ...)
- void DDebug (const DebugEnabler* local, int level, const char* format, ...)
- void XDebug (int level, const char* format, ...)
- void XDebug (const char* facility, int level, const char* format, ...)
- void XDebug (const DebugEnabler* local, int level, const char* format, ...)
- void NDebug (int level, const char* format, ...)
- void NDebug (const char* facility, int level, const char* format, ...)
- void NDebug (const DebugEnabler* local, int level, const char* format, ...)
- void Debug (int level, const char* format, ...)
- void Debug (const char* facility, int level, const char* format, ...)
- void Debug (const DebugEnabler* local, int level, const char* format, ...)
- void Output (const char* format, ...)
- constant YSTRING (const char* string)
- void YCLASS (class type,class base)
- void YCLASS2 (class type,class base1,class base2)
- void YCLASS3 (class type,class base1,class base2,class base3)
- void YCLASSIMP (class type,class base)
- void YCLASSIMP2 (class type,class base1,class base2)
- void YCLASSIMP3 (class type,class base1,class base2,class base3)
- class* YOBJECT (class type,GenObject* pntr)
- void YNOCOPY (class type)
- inline void destruct (GenObject* obj)
- template <class Obj> void destruct (Obj*& obj)
- inline const char* c_str (const String* str)
- inline const char* c_safe (const char* str)
- inline const char* c_safe (const String* str)
- inline bool null (const char* str)
- inline bool null (const String* str)
- String operator+ (const String& s1, const String& s2)
- String operator+ (const String& s1, const char* s2)
- String operator+ (const char* s1, const String& s2)
- inline const char * strcpy (String& dest, const char* src)
- inline const char * strcat (String& dest, const char* src)
- int lookup (const char* str, const TokenDict* tokens, int defvalue = 0, int base = 0)
- const char* lookup (int value, const TokenDict* tokens, const char* defvalue = 0)
- void INIT_PLUGIN (class pclass)
- bool UNLOAD_PLUGIN (bool unloadNow)
- bool isE164 (const char* str)

#### Public Members

- Forward StringMatchPrivate
- Forward MutexPrivate
- Forward SemaphorePrivate
- Forward ThreadPrivate
- typedef int (*EngineLoop) ()
- Forward ThreadedSourcePrivate
- Forward ClientWizard

## Detailed Description

Holds all Telephony Engine related classes.

void abortOnBug ()

### abortOnBug

Abort execution (and coredump if allowed) if the abort flag is set. This function may not return.

bool abortOnBug (bool doAbort)

### abortOnBug

Set the abort on bug flag. The default flag state is false.

Returns: The old state of the flag.

enum DebugLevel { DebugFail = 0, DebugTest = 1, DebugGoOn = 2, DebugConf = 3, DebugStub = 4, DebugWarn = 5, DebugMild = 6, DebugCall = 7, DebugNote = 8, DebugInfo = 9, DebugAll = 10 }

### DebugLevel

Standard debugging levels. The DebugFail level is special - it is always displayed and may abort the program if abortOnBug() is set.

int debugLevel ()

### debugLevel

Retrieve the current global debug level

Returns: The current global debug level

int debugLevel (int level)

### debugLevel

Set the current global debug level.

Parameters:

level | The desired debug level

Returns: The new global debug level (may be different)

bool debugAt (int level)

### debugAt

Check if debugging output should be generated

Parameters:

level | The global debug level we are testing

Returns: True if messages should be output, false otherwise

const char* debugColor (int level)

### debugColor

Get an ANSI string to colorize debugging output

Parameters:

level | The debug level who's color is requested. Negative or out of range will reset to the default color

Returns: ANSI string that sets color corresponding to level

DebugEnabler (class)

### DebugEnabler

Holds a local debugging level that can be modified separately from the global debugging

void DDebug (int level, const char* format, ...)

### DDebug

Convenience macro. Does the same as Debug if DEBUG is \#defined (compiling for debugging) else it does not get compiled at all.

void DDebug (const char* facility, int level, const char* format, ...)

### DDebug

Convenience macro. Does the same as Debug if DEBUG is \#defined (compiling for debugging) else it does not get compiled at all.

void DDebug (const DebugEnabler* local, int level, const char* format, ...)

### DDebug

Convenience macro. Does the same as Debug if DEBUG is \#defined (compiling for debugging) else it does not get compiled at all.

void XDebug (int level, const char* format, ...)

### XDebug

Convenience macro. Does the same as Debug if XDEBUG is \#defined (compiling for extra debugging) else it does not get compiled at all.

void XDebug (const char* facility, int level, const char* format, ...)

### XDebug

Convenience macro. Does the same as Debug if XDEBUG is \#defined (compiling for extra debugging) else it does not get compiled at all.

void XDebug (const DebugEnabler* local, int level, const char* format, ...)

### XDebug

Convenience macro. Does the same as Debug if XDEBUG is \#defined (compiling for extra debugging) else it does not get compiled at all.

void NDebug (int level, const char* format, ...)

### NDebug

Convenience macro. Does the same as Debug if NDEBUG is not \#defined else it does not get compiled at all (compiling for mature release).

void NDebug (const char* facility, int level, const char* format, ...)

### NDebug

Convenience macro. Does the same as Debug if NDEBUG is not \#defined else it does not get compiled at all (compiling for mature release).

void NDebug (const DebugEnabler* local, int level, const char* format, ...)

### NDebug

Convenience macro. Does the same as Debug if NDEBUG is not \#defined else it does not get compiled at all (compiling for mature release).

void Debug (int level, const char* format, ...)

### Debug

Outputs a debug string.

Parameters:

level | The level of the message
format | A printf() style format string

void Debug (const char* facility, int level, const char* format, ...)

### Debug

Outputs a debug string for a specific facility.

Parameters:

facility | Facility that outputs the message
level | The level of the message
format | A printf() style format string

void Debug (const DebugEnabler* local, int level, const char* format, ...)

### Debug

Outputs a debug string for a specific facility.

Parameters:

local | Pointer to a DebugEnabler holding current debugging settings
level | The level of the message
format | A printf() style format string

void Output (const char* format, ...)

### Output

Outputs a string to the debug console with formatting

Parameters:

format | A printf() style format string

Debugger (class)

### Debugger

This class is used as an automatic variable that logs messages on creation and destruction (when the instruction block is left or function returns). IMPORTANT: the name is not copied so it should best be static.

TokenDict (struct)

### TokenDict

A structure to build (mainly static) Token-to-ID translation tables. A table of such structures must end with an entry with a null token

String (class)

### String

A simple string handling class for C style (one byte) strings. For simplicity and read speed no copy-on-write is performed. Strings have hash capabilities and comparations are using the hash for fast inequality check.

Mutex (class)

### Mutex

A simple mutual exclusion for locking access between threads

constant YSTRING (const char* string)

### YSTRING

Macro to create a local static String if supported by compiler, use with caution

Parameters:

string | Literal constant string

Returns: A const String& if supported, literal string if not supported

void YCLASS (class type,class base)

### YCLASS

Macro to create a GenObject class from a base class and implement GenObject::getObject

Parameters:

type | Class that is declared
base | Base class that is inherited

void YCLASS2 (class type,class base1,class base2)

### YCLASS2

Macro to create a GenObject class from two base classes and implement GenObject::getObject

Parameters:

type | Class that is declared
base1 | First base class that is inherited
base2 | Second base class that is inherited

void YCLASS3 (class type,class base1,class base2,class base3)

### YCLASS3

Macro to create a GenObject class from three base classes and implement GenObject::getObject

Parameters:

type | Class that is declared
base1 | First base class that is inherited
base2 | Second base class that is inherited
base3 | Third base class that is inherited

void YCLASSIMP (class type,class base)

### YCLASSIMP

Macro to implement GenObject::getObject in a derived class

Parameters:

type | Class that is declared
base | Base class that is inherited

void YCLASSIMP2 (class type,class base1,class base2)

### YCLASSIMP2

Macro to implement GenObject::getObject in a derived class

Parameters:

type | Class that is declared
base1 | First base class that is inherited
base2 | Second base class that is inherited

void YCLASSIMP3 (class type,class base1,class base2,class base3)

### YCLASSIMP3

Macro to implement GenObject::getObject in a derived class

Parameters:

type | Class that is declared
base1 | First base class that is inherited
base2 | Second base class that is inherited
base3 | Third base class that is inherited

class* YOBJECT (class type,GenObject* pntr)

### YOBJECT

Macro to retrieve a typed pointer to an interface from an object

Parameters:

type | Class we want to return
pntr | Pointer to the object we want to get the interface from

Returns: Pointer to the class we want or NULL

void YNOCOPY (class type)

### YNOCOPY

Macro to disable automatic copy and assignment operators

Parameters:

type | Class that is declared

GenObject (class)

### GenObject

An object with just a public virtual destructor

inline void destruct (GenObject* obj)

### destruct

Helper function that destroys a GenObject only if the pointer is non-NULL. Use it instead of the delete operator.

Parameters:

obj | Pointer (rvalue) to the object to destroy

template <class Obj> void destruct (Obj*& obj)

### destruct

Helper template function that destroys a GenObject descendant if the pointer is non-NULL and also zeros out the pointer. Use it instead of the delete operator.

Parameters:

obj | Reference to pointer (lvalue) to the object to destroy

RefObject (class)

### RefObject

A reference counted object. Whenever using multiple inheritance you should inherit this class virtually.

RefPointerBase (class)

### RefPointerBase

Internal helper class providing a non-inline method to RefPointer. Please don't use this class directly, use RefPointer instead.

RefPointer (class)

### RefPointer

GenPointer (class)

### GenPointer

ObjList (class)

### ObjList

A simple single-linked object list handling class

ObjVector (class)

### ObjVector

Simple vector class that holds objects derived from GenObject

Array (class)

### Array

A simple Array class derivated from RefObject It uses one ObjList to keep the pointers to other ObjList's. Data is organized in columns - the main ObjList holds pointers to one ObjList for each column. This class has been written by Diana

Regexp (class)

### Regexp

A regular expression matching class.

inline const char* c_str (const String* str)

### c_str

Utility function to retrieve a C string from a possibly NULL String pointer

Parameters:

str | Pointer to a String that may be NULL

Returns: String data pointer or NULL

inline const char* c_safe (const char* str)

### c_safe

Utility function to replace NULL C string pointers with an empty C string

Parameters:

str | Pointer to a C string that may be NULL

Returns: Original pointer or pointer to an empty C string

inline const char* c_safe (const String* str)

### c_safe

Utility function to replace NULL String pointers with an empty C string

Parameters:

str | Pointer to a String that may be NULL

Returns: String data pointer or pointer to an empty C string

inline bool null (const char* str)

### null

Utility function to check if a C string is null or empty

Parameters:

str | Pointer to a C string

Returns: True if str is NULL or starts with a NUL character

inline bool null (const String* str)

### null

Utility function to check if a String is null or empty

Parameters:

str | Pointer to a String

Returns: True if str is NULL or is empty

String operator+ (const String& s1, const String& s2)

### operator+

Concatenation operator for strings.

String operator+ (const String& s1, const char* s2)

### operator+

Concatenation operator for strings.

String operator+ (const char* s1, const String& s2)

### operator+

Concatenation operator for strings.

inline const char * strcpy (String& dest, const char* src)

### strcpy

Prevent careless programmers from overwriting the string

See also: operator=

inline const char * strcat (String& dest, const char* src)

### strcat

Prevent careless programmers from overwriting the string

See also: operator+=

int lookup (const char* str, const TokenDict* tokens, int defvalue = 0, int base = 0)

### lookup

Utility function to look up a string in a token table, interpret as number if it fails

Parameters:

str | String to look up
tokens | Pointer to the token table
defvalue | Value to return if lookup and conversion fail
base | Default base to use to convert to number

const char* lookup (int value, const TokenDict* tokens, const char* defvalue = 0)

### lookup

Utility function to look up a number in a token table

Parameters:

value | Value to search for
tokens | Pointer to the token table
defvalue | Value to return if lookup fails

CapturedEvent (class)

### CapturedEvent

Holder for an event (output, debug or alarm) message

NamedString (class)

### NamedString

A string class with a hashed string name

NamedPointer (class)

### NamedPointer

A named string holding a pointer to arbitrary data. The pointer is owned by the object: it will be released when the object is destroyed or the string value changed

HashList (class)

### HashList

A hashed object list handling class. Objects placed in the list are distributed according to their String hash resulting in faster searches. On the other hand an object placed in a hashed list must never change its String value or it becomes unfindable.

ListIterator (class)

### ListIterator

An ObjList or HashList iterator that can be used even when list elements are changed while iterating. Note that it will not detect that an item was removed and another with the same address was inserted back in list.

Time (class)

### Time

The Time class holds a time moment with microsecond accuracy

Random (class)

### Random

Implementation of a system independent pseudo random number generator

DataBlock (class)

### DataBlock

The DataBlock holds a data buffer with no specific formatting.

MD5 (class)

### MD5

A class to compute and check MD5 digests

SHA1 (class)

### SHA1

A class to compute and check SHA1 digests

Base64 (class)

### Base64

Base64 encoder/decoder class

NamedIterator (class)

### NamedIterator

An iterator for NamedString parameters of a NamedList. Fast but unsafe, the list must not be modified during iteration.

NamedList (class)

### NamedList

This class holds a named list of named strings

URI (class)

### URI

Uniform Resource Identifier encapsulation and parser. For efficiency reason the parsing is delayed as long as possible

Lockable (class)

### Lockable

An abstract base class for implementing lockable objects

MutexPool (class)

### MutexPool

This class holds a Mutex array. Mutexes can be retrieved based on object pointers. A mutex pool can be used to associate a smaller set of Mutex objects with a much larger set of objects needing lock.

Semaphore (class)

### Semaphore

A semaphore object for synchronizing threads, can also be used as a token bucket

Lock (class)

### Lock

A lock is a stack allocated (automatic) object that locks a lockable object on creation and unlocks it on destruction - typically when exiting a block

Lock2 (class)

### Lock2

A dual lock is a stack allocated (automatic) object that locks a pair of mutexes on creation and unlocks them on destruction. The mutexes are always locked in the same order to prevent trivial deadlocks

Runnable (class)

### Runnable

This class holds the action to execute a certain task, usually in a different execution thread.

Thread (class)

### Thread

A thread is a separate execution context that exists in the same address space. Threads make better use of multiple processor machines and allow blocking one execution thread while allowing other to run.

Socket (class)

### Socket

This class encapsulates a system dependent socket in a system independent abstraction

SocketAddr (class)

### SocketAddr

Wrapper class to keep a socket address

SocketFilter (class)

### SocketFilter

Abstract interface for an object that filters socket received data packets

Stream (class)

### Stream

Base class for encapsulating system dependent stream capable objects

MemoryStream (class)

### MemoryStream

An implementation of a Stream that reads and writes data in a DataBlock

File (class)

### File

Class to encapsulate a system dependent file in a system independent abstraction

SctpSocket (class)

### SctpSocket

The SctpSocket interface provides access to SCTP specific functions

DnsRecord (class)

### DnsRecord

This class holds a DNS (resolver) record

SrvRecord (class)

### SrvRecord

This class holds a SRV (Service Location) record

NaptrRecord (class)

### NaptrRecord

This class holds a NAPTR (Naming Authority Pointer) record

Resolver (class)

### Resolver

This class offers DNS query services

Cipher (class)

### Cipher

The Cipher class provides an abstraction for data encryption classes

Compressor (class)

### Compressor

The Compressor class provides an abstraction for data (de)compressor classes. The String component keeps an optional object name to be used for debug purposes

SysUsage (class)

### SysUsage

The SysUsage class allows collecting some statistics about engine's usage of system resources

MimeHeaderLine (class)

### MimeHeaderLine

A MIME header line. The NamedString's value contain the first parameter after the header name

MimeAuthLine (class)

### MimeAuthLine

A MIME header line containing authentication data.

MimeBody (class)

### MimeBody

Abstract base class for holding Multipurpose Internet Mail Extensions data. Keeps a Content-Type header line with body type and parameters and any additional header lines the body may have. The body type contains lower case characters.

MimeMultipartBody (class)

### MimeMultipartBody

An object holding the bodies of a multipart MIME

MimeSdpBody (class)

### MimeSdpBody

An object holding the lines of an application/sdp MIME type

MimeBinaryBody (class)

### MimeBinaryBody

An object holding a binary block of MIME data

MimeStringBody (class)

### MimeStringBody

An object holding MIME data as just one text string

MimeLinesBody (class)

### MimeLinesBody

An object holding MIME data as separate text lines

Configuration (class)

### Configuration

A class for parsing and quickly accessing INI style configuration files

SharedVars (class)

### SharedVars

Class that implements atomic / locked access and operations to its shared variables

MessageDispatcher (class)

### MessageDispatcher

The dispatcher class is a hub that holds a list of handlers to be called for the messages that pass trough the hub. It can also handle a queue of messages that are typically dispatched by a separate thread.

MessageRelay (class)

### MessageRelay

A message handler that allows to relay several messages to a single receiver

Engine (class)

### Engine

This class holds global information about the engine. Note: this is a singleton class.

Message (class)

### Message

This class holds the messages that are moved around in the engine.

MessageHandler (class)

### MessageHandler

The purpose of this class is to hold a message received method that is called for matching messages. It holds as well the matching criteria and priority among other handlers.

MessageReceiver (class)

### MessageReceiver

A multiple message receiver to be invoked by a message relay

MessageNotifier (class)

### MessageNotifier

An abstract class to implement hook methods called after any message has been dispatched. If an object implementing MessageNotifier is set as user data in a Message then the dispatched() method will be called.

MessagePostHook (class)

### MessagePostHook

An abstract message notifier that can be inserted in a MessageDispatcher to implement hook methods called after any message has been dispatched. No new methods are provided - we only need the multiple inheritance.

Plugin (class)

### Plugin

Initialization and information about plugins. Plugins are located in shared libraries that are loaded at runtime.

     // Create static Plugin object by using the provided macro
     INIT_PLUGIN(Plugin);

void INIT_PLUGIN (class pclass)

### INIT_PLUGIN

Macro to create static instance of the plugin

Parameters:

pclass | Class of the plugin to create

bool UNLOAD_PLUGIN (bool unloadNow)

### UNLOAD_PLUGIN

Macro to create the unloading function

Parameters:

unloadNow | True if asked to unload immediately, false if just checking

Returns: True if the plugin can be unloaded, false if not

EngineCheck (class)

### EngineCheck

Base class for engine running stage checkers. Descendants may check specific conditions and decide to stop the engine. There should be only one (static) instance of an engine checker

typedef int (*EngineLoop) ()

### (*EngineLoop)

Prototype for engine main loop callback

ImageInfo (struct)

### ImageInfo

A structure to hold information about a static picture or video frame.

FormatInfo (struct)

### FormatInfo

A structure to hold information about a data format.

DataEndpoint (class)

### DataEndpoint

The DataEndpoint holds an endpoint capable of performing unidirectional or bidirectional data transfers

CallEndpoint (class)

### CallEndpoint

A class that holds common call control and data related features

Driver (class)

### Driver

Driver is a module specialized for implementing channel drivers

TranslatorCaps (struct)

### TranslatorCaps

A structure to build (mainly static) translator capability tables. A table of such structures must end with an entry with null format names.

FormatRepository (class)

### FormatRepository

This is just a holder for the list of media formats supported by Yate

DataFormat (class)

### DataFormat

An extension of a String that can parse data formats

DataNode (class)

### DataNode

A generic data handling object

DataSource (class)

### DataSource

A data source

DataTranslator (class)

### DataTranslator

The DataTranslator holds a translator (codec) capable of unidirectional conversion of data from one type to another.

TranslatorFactory (class)

### TranslatorFactory

A factory for constructing data translators by format name conversion of data from one type to another

DataConsumer (class)

### DataConsumer

A data consumer

ThreadedSource (class)

### ThreadedSource

A data source with a thread of its own

Module (class)

### Module

Module is a descendent of Plugin specialized in implementing modules

Channel (class)

### Channel

A class that holds common channel related features (a.k.a. call leg)

Router (class)

### Router

Asynchronous call routing thread

bool isE164 (const char* str)

### isE164

Find if a string appears to be an E164 phone number

Parameters:

str | String to check

Returns: True if str appears to be a valid E164 number

Window (class)

### Window

A window is the basic user interface element. Everything inside is implementation specific functionality.

UIWidget (class)

### UIWidget

UIFactory (class)

### UIFactory

Each instance of UIFactory creates special user interface elements by type. Keeps a global list with all factories. The list doesn't own the facotries

Client (class)

### Client

Singleton class that holds the User Interface's main methods

ClientChannel (class)

### ClientChannel

This class implements a Channel used by client programs

ClientDriver (class)

### ClientDriver

Abstract client Driver that implements some of the specific functionality

ClientLogic (class)

### ClientLogic

This class implements the logic behind different actions in the client. It specifies the way the graphical interface of the client will behave in different circumstances.

DefaultLogic (class)

### DefaultLogic

This class implements the default client behaviour.

ClientAccount (class)

### ClientAccount

This class holds an account

ClientAccountList (class)

### ClientAccountList

This class holds an account list

ClientContact (class)

### ClientContact

A client contact The contact is using the owner's mutex to lock it's operations

ClientResource (class)

### ClientResource

This class holds data about a client account/contact resource

MucRoomMember (class)

### MucRoomMember

This class holds data about a MUC room member. The resource name holds the nickname

MucRoom (class)

### MucRoom

This class holds a client account's MUC room contact. The list of resources contains MucRoomMember items. Contact nick is held by own MucRoomMember name The contact uri is the room uri The contact name is the room name The contact resource member uri is the account's uri

DurationUpdate (class)

### DurationUpdate

Class used to update UI durations. The string keeps the object's id. This object can be used to keep additional data associated with a client channel

ClientSound (class)

### ClientSound

This class holds a sound file along with an output device used to play it

Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.