A Plugin that implements a module. More...
#include <yatephone.h>
Public Member Functions | |
virtual void * | getObject (const String &name) const |
const String & | name () const |
const String & | type () const |
void | changed () |
bool | filterInstalled () const |
bool | filterDebug (const String &item) const |
Static Public Member Functions | |
static unsigned int | updateDelay () |
static void | updateDelay (unsigned int delay) |
static bool | itemComplete (String &itemList, const String &item, const String &partWord) |
Protected Types | |
enum | { Status = 0x00000001, Timer = 0x00000002, Level = 0x00000004, Command = 0x00000008, Help = 0x00000010, Halt = 0x00000020, Route = 0x00000040, Execute = 0x00000100, Drop = 0x00000200, Locate = 0x00000400, Masquerade = 0x00000800, Ringing = 0x00001000, Answered = 0x00002000, Tone = 0x00004000, Text = 0x00008000, Progress = 0x00010000, Update = 0x00020000, Transfer = 0x00040000, Control = 0x00080000, ImRoute = 0x00100000, ImExecute = 0x00200000, PubLast = 0x0fffffff, Private = 0x10000000 } |
Protected Member Functions | |
Module (const char *name, const char *type=0, bool earlyInit=false) | |
virtual | ~Module () |
virtual void | initialize () |
void | setup () |
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 bool | received (Message &msg, int id) |
virtual void | genUpdate (Message &msg) |
virtual void | msgTimer (Message &msg) |
virtual void | msgStatus (Message &msg) |
virtual bool | msgRoute (Message &msg) |
virtual bool | msgCommand (Message &msg) |
virtual void | statusModule (String &str) |
virtual void | statusParams (String &str) |
virtual void | statusDetail (String &str) |
virtual bool | commandExecute (String &retVal, const String &line) |
virtual bool | commandComplete (Message &msg, const String &partLine, const String &partWord) |
virtual bool | setDebug (Message &msg, const String &target) |
Static Protected Member Functions | |
static const char * | messageName (int id) |
Protected Attributes | |
enum TelEngine::Module:: { ... } | RelayID |
A Plugin that implements a module.
Module is a descendent of Plugin specialized in implementing modules
anonymous enum [protected] |
IDs of the installed relays
Module | ( | const char * | name, | |
const char * | type = 0 , |
|||
bool | earlyInit = false | |||
) | [protected] |
Constructor
name | Plugin name of this driver | |
type | Type of the driver: "misc", "route", etc. | |
earlyInit | True to attempt to initialize module before others |
virtual ~Module | ( | ) | [protected, virtual] |
Destructor
void changed | ( | ) |
Mark the driver statistics "dirty" therefore triggring a delayed status update.
Execute a specific command
retVal | String to append the textual command output to | |
line | Command line to attempt to execute |
bool filterDebug | ( | const String & | item | ) | const |
Check by filter rule if debugging should be active
item | Value of the item to match |
bool filterInstalled | ( | ) | const [inline] |
Check if a debug filter is installed
virtual void genUpdate | ( | Message & | msg | ) | [protected, virtual] |
Opportunity to modify the update message
msg | Status update message |
Reimplemented in Driver.
virtual void* getObject | ( | const String & | name | ) | const [virtual] |
virtual void initialize | ( | ) | [protected, virtual] |
This method is called to initialize the loaded module
Implements Plugin.
Reimplemented in Driver, ClientDriver, and ChanAssistList.
bool installRelay | ( | MessageRelay * | relay | ) | [protected] |
Install a custom message relay
relay | Custom message relay |
bool installRelay | ( | int | id, | |
const char * | name, | |||
unsigned | priority = 100 | |||
) | [protected] |
Install a custom message relay
id | RelayID of the new relay to create | |
name | Name of the custom relay to create | |
priority | Priority of the handler, 0 = top |
bool installRelay | ( | const char * | name, | |
unsigned | priority = 100 | |||
) | [protected] |
Install a standard message relay
name | Name of the relay to create, must match a RelayID | |
priority | Priority of the handler, 0 = top |
bool installRelay | ( | int | id, | |
unsigned | priority = 100 | |||
) | [protected] |
Install a standard message relay
id | RelayID of the new relay to create | |
priority | Priority of the handler, 0 = top |
static bool itemComplete | ( | String & | itemList, | |
const String & | item, | |||
const String & | partWord | |||
) | [static] |
Helper function to complete just one item on a command line
itemList | Tab separated list of possible values to complete | |
item | Item to possibly insert in the list | |
partWord | Partial word to complete, may be empty |
static const char* messageName | ( | int | id | ) | [static, protected] |
Find the name of a specific Relay ID
id | RelayID of the message |
virtual bool msgCommand | ( | Message & | msg | ) | [protected, virtual] |
Handler for special commands and line completion requests. By default it calls commandExecute() or commandComplete().
msg | Command message |
virtual bool msgRoute | ( | Message & | msg | ) | [protected, virtual] |
Routing message handler that is invoked for all call.route messages.
msg | Call routing message |
Reimplemented in Driver, and ClientDriver.
virtual void msgStatus | ( | Message & | msg | ) | [protected, virtual] |
Status message handler that is invoked only for matching messages.
msg | Status message |
virtual void msgTimer | ( | Message & | msg | ) | [protected, virtual] |
const String& name | ( | ) | const [inline] |
Retrive the name of the module
virtual bool received | ( | Message & | msg, | |
int | id | |||
) | [protected, virtual] |
Message receiver handler
msg | The received message | |
id | The identifier with which the relay was created |
Implements MessageReceiver.
Reimplemented in Driver, ClientDriver, and ChanAssistList.
void setup | ( | ) | [protected] |
Install standard message relays
Reimplemented in ClientDriver.
virtual void statusDetail | ( | String & | str | ) | [protected, virtual] |
virtual void statusModule | ( | String & | str | ) | [protected, virtual] |
virtual void statusParams | ( | String & | str | ) | [protected, virtual] |
const String& type | ( | ) | const [inline] |
Retrive the type of the module
bool uninstallRelay | ( | int | id, | |
bool | delRelay = true | |||
) | [protected] |
Uninstall a message relay
id | RelayID to uninstall, relay will be deleted | |
delRelay | True to delete the relay after removing it |
bool uninstallRelay | ( | MessageRelay * | relay, | |
bool | delRelay = true | |||
) | [protected] |
Uninstall a message relay
relay | Pointer to message relay | |
delRelay | True to delete the relay after removing it |
bool uninstallRelays | ( | ) | [protected] |
Uninstall all installed relays in preparation for unloading
static void updateDelay | ( | unsigned int | delay | ) | [inline, static] |
Set the global update notification delay
delay | New update delay value in seconds, 0 to disable |
static unsigned int updateDelay | ( | ) | [inline, static] |
Retrive the global update notification delay
enum { ... } RelayID [protected] |
IDs of the installed relays