Yate

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
ClientDriver Class Referenceabstract

Base Driver with client specific functions. More...

`#include <yatecbase.h>`

Inheritance diagram for ClientDriver:

## Public Member Functions
virtual void | initialize ()=0
virtual bool | msgExecute (Message &msg, String &dest)
virtual void | msgTimer (Message &msg)
virtual bool | msgRoute (Message &msg)
virtual bool | received (Message &msg, int id)
const String & | activeId () const
bool | setActive (const String &id=String::empty())
ClientChannel * | findLine (int line)
Public Member Functions inherited from Driver
virtual void * | getObject (const String &name) const
const String & | prefix () const
bool | varchan () const
ObjList & | channels ()
virtual Channel * | find (const String &id) const
virtual bool | isBusy () const
virtual void | dropAll (Message &msg)
virtual bool | canAccept (bool routers=true)
virtual bool | canRoute ()
unsigned int | nextid ()
unsigned int | lastid () const
int | timeout () const
int | routing () const
int | routed () const
int | total () const
int | chanCount () const
int | maxChans () const
Public Member Functions inherited from Module
const String & | type () const
void | changed ()
bool | filterInstalled () const
bool | filterDebug (const String &item) const
Public Member Functions inherited from Plugin
| Plugin (const char *name, bool earlyInit=false)
virtual | ~Plugin ()
virtual const String & | toString () const
const String & | name () const
NamedCounter * | objectsCounter () const
bool | earlyInit () const
Public Member Functions inherited from GenObject
| GenObject ()
virtual | ~GenObject ()
virtual bool | alive () const
virtual void | destruct ()
virtual const String & | traceId () const
NamedCounter * | getObjCounter () const
NamedCounter * | setObjCounter (NamedCounter *counter)
Public Member Functions inherited from DebugEnabler
| DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true)
int | debugLevel () const
int | debugLevel (int level)
bool | debugEnabled () const
void | debugEnabled (bool enable)
const char * | debugName () const
bool | debugAt (int level) const
bool | debugChained () const
void | debugChain (const DebugEnabler *chain=0)
void | debugCopy (const DebugEnabler *original=0)
Public Member Functions inherited from Mutex
| Mutex (bool recursive=false, const char *name=0)
| Mutex (const Mutex &original)
| ~Mutex ()
Mutex & | operator= (const Mutex &original)
virtual bool | lock (long maxwait=-1)
virtual bool | unlock ()
virtual bool | locked () const
const char * | owner () const
bool | recursive () const
Public Member Functions inherited from Lockable
virtual | ~Lockable ()
virtual bool | check (long maxwait=-1)
virtual bool | unlockAll ()

## Static Public Member Functions
static ClientDriver * | self ()
static const String & | device ()
static void | dropCalls (const char *reason=0)
static bool | setAudioTransfer (const String &id, const String &target=String::empty())
static bool | setConference (const String &id, bool in, const String *confName=0, bool buildFromChan=false)
static ClientChannel * | findChan (const String &id)
static ClientChannel * | findChanByPeer (const String &peer)
static ClientChannel * | findActiveChan ()
static void | dropChan (const String &chan, const char *reason=0, bool peer=false)
Static Public Member Functions inherited from Module
static unsigned int | updateDelay ()
static void | updateDelay (unsigned int delay)
static bool | itemComplete (String &itemList, const String &item, const String &partWord)
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 NamedCounter * | getObjCounter (const String &name, bool create=true)
static ObjList & | getObjCounters ()
Static Public Member Functions inherited from Mutex
static int | count ()
static int | locks ()
static bool | efficientTimedLock ()
Static Public Member Functions inherited from Lockable
static void | wait (unsigned long maxwait)
static unsigned long | wait ()
static void | startUsingNow ()
static void | enableSafety (bool safe=true)
static bool | safety ()

## Static Public Attributes
static String | s_confName
static bool | s_dropConfPeer

## Protected Member Functions
void | setup ()
Protected Member Functions inherited from Driver
| Driver (const char *name, const char *type=0)
void | setup (const char *prefix=0, bool minimal=false)
virtual void | genUpdate (Message &msg)
virtual bool | hasLine (const String &line) const
virtual bool | commandComplete (Message &msg, const String &partLine, const String &partWord)
virtual void | statusModule (String &str)
virtual void | statusParams (String &str)
virtual void | statusDetail (String &str)
virtual bool | setDebug (Message &msg, const String &target)
virtual void | loadLimits ()
virtual bool | canStopCall () const
void | varchan (bool variable)
void | timeout (int tout)
void | maxRoute (int ncalls)
void | maxChans (int ncalls)
void | dtmfDups (bool duplicates)
Protected Member Functions inherited from Module
| Module (const char *name, const char *type=0, bool earlyInit=false)
virtual | ~Module ()
void | setup ()
bool | relayInstalled (int id) const
bool | installRelay (int id, unsigned priority=100)
bool | installRelay (const char *name, unsigned priority=100)
bool | installRelay (int id, const char *name, unsigned priority=100)
bool | installRelay (MessageRelay *relay)
bool | uninstallRelay (MessageRelay *relay, bool delRelay=true)
bool | uninstallRelay (int id, bool delRelay=true)
bool | uninstallRelays ()
virtual void | msgStatus (Message &msg)
virtual bool | msgCommand (Message &msg)
virtual bool | commandExecute (String &retVal, const String &line)
Protected Member Functions inherited from DebugEnabler
void | debugName (const char *name)

## Protected Attributes
String | m_activeId
Protected Attributes inherited from Module
enum TelEngine::Module:: { ... } | RelayID

## Static Protected Attributes
static ClientDriver * | s_driver
static String | s_device

## Friends
class | ClientChannel

## Additional Inherited Members
Protected Types inherited from Module
enum | { Status = 0x00000001, Timer = 0x00000002, Level = 0x00000004, Command = 0x00000008, Help = 0x00000010, Halt = 0x00000020, Route = 0x00000040, Stop = 0x00000080, Execute = 0x00000100, Drop = 0x00000200, Locate = 0x00000400, Masquerade = 0x00000800, Ringing = 0x00001000, Answered = 0x00002000, Tone = 0x00004000, Text = 0x00008000, Progress = 0x00010000, Update = 0x00020000, Transfer = 0x00040000, Control = 0x00080000, MsgExecute = 0x00100000, PubLast = 0x00ffffff, Private = 0x01000000 }
Static Protected Member Functions inherited from Module
static const char * | messageName (int id)
static int | relayId (const char *name)

## Detailed Description

Base Driver with client specific functions.

Abstract client Driver that implements some of the specific functionality

## Member Function Documentation

const String& activeId | ( |  | ) | const
| inline

Get the active channel's id

Returns
  The active channel's id

static const String& device | ( |  | ) |
| inline static

Get the current audio device's name

Returns
  The current audio device's name

static void dropCalls | ( | const char * | reason = `0` | ) |
| static

Drop all calls belonging to the active driver

Parameters

  reason | Optional drop reason

static void dropChan | ( | const String & | chan,
|  | const char * | reason = `0`,
|  | bool | peer = `false`
| ) |  |
| static

Drop a channel

Parameters

  chan | Channel id
  reason | Optional reason
  peer | Set it to true to drop a client channel peer used to reconnect

static ClientChannel* findActiveChan | ( |  | ) |
| inline static

Get the active channel

Returns
  Referenced ClientChannel pointer or 0

References ClientDriver::findChan().

static ClientChannel* findChan | ( | const String & | id | ) |
| static

Get a referenced channel found by its id

Parameters

  id | The id of the channel to find

Returns
  Referenced ClientChannel pointer or 0

Referenced by ClientDriver::findActiveChan().

static ClientChannel* findChanByPeer | ( | const String & | peer | ) |
| static

Get a referenced channel whose stored peer is the given one

Parameters

  peer | Peer id to check

Returns
  Referenced ClientChannel pointer or 0

ClientChannel* findLine | ( | int | line | ) |

Find a channel by its line

Parameters

  line | The line to find

Returns
  ClientChannel pointer of 0

virtual void initialize | ( |  | ) |
| pure virtual

This method is called to initialize the loaded module

Reimplemented from Driver.

virtual bool msgExecute | ( | Message & | msg,
|  | String & | dest
| ) |  |
| virtual

Create an outgoing calling channel

Parameters

  msg | Call execute message
  dest | Destination of the new call

Returns
  True if outgoing call was created

Implements Driver.

virtual bool msgRoute | ( | Message & | msg | ) |
| virtual

Routing message handler. The default implementation routes to this driver if it owns a line named in the "account" or "line" parameter.

Parameters

  msg | Call routing message

Returns
  True to stop processing the message, false to try other handlers

Reimplemented from Driver.

virtual void msgTimer | ( | Message & | msg | ) |
| virtual

Timer message handler.

Parameters

  msg | Time message

Reimplemented from Module.

virtual bool received | ( | Message & | msg,
|  | int | id
| ) |  |
| virtual

Message receiver handler

Parameters

  msg | The received message
  id | The identifier with which the relay was created

Returns
  True to stop processing, false to try other handlers

Reimplemented from Driver.

static ClientDriver* self | ( |  | ) |
| inline static

Get the global client driver object's address

Returns
  The global client driver object's address

bool setActive | ( | const String & | id = `String::empty()` | ) |

Set/reset the active channel. Does nothing if the selected channel is the active one. Put the active channel on hold before trying to set the active channel

Parameters

  id | The new active channel's id. Set to empty if don't want to set a new active channel

Returns
  True on success

static bool setAudioTransfer | ( | const String & | id,
|  | const String & | target = `String::empty()`
| ) |  |
| static

Attach/detach client channels peers' source/consumer

Parameters

  id | The id of the channel to tranfer
  target | The transfer target. Leave blank to reset the channel's transfer id

Returns
  True on success

static bool setConference | ( | const String & | id,
|  | bool | in,
|  | const String * | confName = `0`,
|  | bool | buildFromChan = `false`
| ) |  |
| static

Attach/detach a client channel to/from a conference room

Parameters

  id | The id of the channel to process
  in | True to enter the conference room, false to exit from it
  confName | Optional id of the conference. Set to 0 to use the default one Ignored if 'in' is false
  buildFromChan | Build conference name from channel id if true

Returns
  True on success

## Member Data Documentation

String s_confName
| static

The name to use when the client is in conference

bool s_dropConfPeer
| static

Indicates wether a channel should drop its former peer when terminated while in conference

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

- yatecbase.h