A Plugin that implements a module.
More...
#include <yatephone.h>
|
| static unsigned int | updateDelay () |
| |
| static void | updateDelay (unsigned int delay) |
| |
| static bool | itemComplete (String &itemList, const String &item, const String &partWord) |
| |
| static bool | itemComplete (String &itemList, const ObjList &list, const String &partWord) |
| |
| static bool | itemComplete (String &itemList, const TokenDict *dict, const String &partWord) |
| |
| static bool | itemComplete (String &itemList, const TokenDict64 *dict, const String &partWord) |
| |
| 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 int | count () |
| |
| static int | locks () |
| |
| static bool | efficientTimedLock () |
| |
| static void | wait (unsigned long maxwait) |
| |
| static unsigned long | wait () |
| |
| static void | startUsingNow () |
| |
| static void | enableSafety (bool safe=true) |
| |
| static bool | safety () |
| |
|
| 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
} |
| |
|
| | Module (const char *name, const char *type=0, bool earlyInit=false) |
| |
| virtual | ~Module () |
| |
| virtual void | initialize () |
| |
| void | setup () |
| |
| bool | relayInstalled (int id) const |
| |
| bool | installRelay (int id, unsigned priority=100, NamedString *filter=0) |
| |
| bool | installRelay (const char *name, unsigned priority=100, NamedString *filter=0) |
| |
| bool | installRelay (int id, const char *name, unsigned priority=100, NamedString *filter=0) |
| |
| 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) |
| |
| void | debugName (const char *name) |
| |
|
| enum TelEngine::Module:: { ... } | RelayID |
| |
A Plugin that implements a module.
Module is a descendent of Plugin specialized in implementing modules
◆ anonymous enum
IDs of the installed relays
◆ Module()
| Module |
( |
const char * | name, |
|
|
const char * | type = 0, |
|
|
bool | earlyInit = false ) |
|
protected |
Constructor
- Parameters
-
| name | Plugin name of this driver |
| type | Type of the driver: "misc", "route", etc. |
| earlyInit | True to attempt to initialize module before others |
◆ ~Module()
◆ changed()
Mark the driver statistics "dirty" therefore triggring a delayed status update.
◆ commandComplete()
| virtual bool commandComplete |
( |
Message & | msg, |
|
|
const String & | partLine, |
|
|
const String & | partWord ) |
|
protectedvirtual |
Complete a command line
- Parameters
-
| msg | Message to return completion into |
| partLine | Partial line to complete, excluding the last word |
| partWord | Partial word to complete |
- Returns
- True to stop processing the message, false to try other handlers
Reimplemented in Driver.
◆ commandExecute()
| virtual bool commandExecute |
( |
String & | retVal, |
|
|
const String & | line ) |
|
protectedvirtual |
Execute a specific command
- Parameters
-
| retVal | String to append the textual command output to |
| line | Command line to attempt to execute |
- Returns
- True to stop processing the message, false to try other handlers
◆ filterDebug()
| bool filterDebug |
( |
const String & | item | ) |
const |
Check by filter rule if debugging should be active
- Parameters
-
| item | Value of the item to match |
- Returns
- True if debugging should be activated
◆ filterInstalled()
| bool filterInstalled |
( |
| ) |
const |
|
inline |
Check if a debug filter is installed
- Returns
- True if debugging should be filtered
References String::null().
◆ genUpdate()
| virtual void genUpdate |
( |
Message & | msg | ) |
|
|
protectedvirtual |
Opportunity to modify the update message
- Parameters
-
Reimplemented in Driver.
◆ getObject()
| virtual void * getObject |
( |
const String & | name | ) |
const |
|
virtual |
Get a pointer to a derived class given that class name
- Parameters
-
| name | Name of the class we are asking for |
- Returns
- Pointer to the requested class or NULL if this object doesn't implement it
Reimplemented from Plugin.
Reimplemented in Driver.
◆ initialize()
| virtual void initialize |
( |
| ) |
|
|
protectedvirtual |
◆ installRelay() [1/4]
| bool installRelay |
( |
const char * | name, |
|
|
unsigned | priority = 100, |
|
|
NamedString * | filter = 0 ) |
|
protected |
Install a standard message relay
- Parameters
-
| name | Name of the relay to create, must match a RelayID |
| priority | Priority of the handler, 0 = top |
| filter | Optional filter for relay. It will be consumed |
- Returns
- True if installed or already was one installed
◆ installRelay() [2/4]
| bool installRelay |
( |
int | id, |
|
|
const char * | name, |
|
|
unsigned | priority = 100, |
|
|
NamedString * | filter = 0 ) |
|
protected |
Install a custom message relay
- Parameters
-
| id | RelayID of the new relay to create |
| name | Name of the custom relay to create |
| priority | Priority of the handler, 0 = top |
| filter | Optional filter for relay. It will be consumed |
- Returns
- True if installed or already was one installed
◆ installRelay() [3/4]
| bool installRelay |
( |
int | id, |
|
|
unsigned | priority = 100, |
|
|
NamedString * | filter = 0 ) |
|
protected |
Install a standard message relay
- Parameters
-
| id | RelayID of the new relay to create |
| priority | Priority of the handler, 0 = top |
| filter | Optional filter for relay. It will be consumed |
- Returns
- True if installed or already was one installed
◆ installRelay() [4/4]
Install a custom message relay
- Parameters
-
| relay | Custom message relay |
- Returns
- True if installed, false if there was already one with same ID
◆ itemComplete() [1/4]
Helper function to complete a list if strings (use toString()) on a command line
- Parameters
-
| itemList | Tab separated list of possible values to complete |
| list | Items to possibly insert in the list |
| partWord | Partial word to complete, may be empty |
- Returns
- True if at least one item was added to list, false if not
References Module::itemComplete(), ObjList::skipNull(), and String::toString().
◆ itemComplete() [2/4]
| static bool itemComplete |
( |
String & | itemList, |
|
|
const String & | item, |
|
|
const String & | partWord ) |
|
static |
Helper function to complete just one item on a command line
- Parameters
-
| 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 |
- Returns
- True if the item was added to list, false if it didn't match
Referenced by Module::itemComplete(), Module::itemComplete(), and Module::itemComplete().
◆ itemComplete() [3/4]
Helper function to complete a dictionary on a command line
- Parameters
-
| itemList | Tab separated list of possible values to complete |
| dict | Items to possibly insert in the list |
| partWord | Partial word to complete, may be empty |
- Returns
- True if at least one item was added to list, false if not
References Module::itemComplete(), and TokenDict::token.
◆ itemComplete() [4/4]
Helper function to complete a dictionary on a command line
- Parameters
-
| itemList | Tab separated list of possible values to complete |
| dict | Items to possibly insert in the list |
| partWord | Partial word to complete, may be empty |
- Returns
- True if at least one item was added to list, false if not
References Module::itemComplete(), and TokenDict64::token.
◆ messageName()
| static const char * messageName |
( |
int | id | ) |
|
|
staticprotected |
Find the name of a specific Relay ID
- Parameters
-
- Returns
- Pointer to name of the message or NULL if not found
◆ msgCommand()
| virtual bool msgCommand |
( |
Message & | msg | ) |
|
|
protectedvirtual |
Handler for special commands and line completion requests. By default it calls commandExecute() or commandComplete().
- Parameters
-
- Returns
- True to stop processing the message, false to try other handlers
◆ msgRoute()
| virtual bool msgRoute |
( |
Message & | msg | ) |
|
|
protectedvirtual |
Routing message handler that is invoked for all call.route messages.
- Parameters
-
- Returns
- True to stop processing the message, false to try other handlers
Reimplemented in ClientDriver, and Driver.
◆ msgStatus()
| virtual void msgStatus |
( |
Message & | msg | ) |
|
|
protectedvirtual |
Status message handler that is invoked only for matching messages.
- Parameters
-
◆ msgTimer()
| virtual void msgTimer |
( |
Message & | msg | ) |
|
|
protectedvirtual |
Timer message handler.
- Parameters
-
Reimplemented in ClientDriver.
◆ received()
| virtual bool received |
( |
Message & | msg, |
|
|
int | id ) |
|
protectedvirtual |
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
Implements MessageReceiver.
Reimplemented in ClientDriver, and Driver.
◆ relayId()
| static int relayId |
( |
const char * | name | ) |
|
|
inlinestaticprotected |
Find the ID or a specific Relay name
- Parameters
-
| name | Name of the Relay to search for |
- Returns
- ID of the Relay, zero if not found
References Plugin::name().
◆ relayInstalled()
| bool relayInstalled |
( |
int | id | ) |
const |
|
inlineprotected |
Check if a specific relay ID is installed
- Parameters
-
- Returns
- True if such a relay is installed
◆ setDebug()
Set the local debugging level
- Parameters
-
| msg | Debug setting message |
| target | String to match for local settings |
Reimplemented in Driver.
◆ setup()
Install standard message relays
◆ statusDetail()
| virtual void statusDetail |
( |
String & | str | ) |
|
|
protectedvirtual |
Build the details reporting part of the status answer
- Parameters
-
Reimplemented in Driver.
◆ statusModule()
| virtual void statusModule |
( |
String & | str | ) |
|
|
protectedvirtual |
Build the module identification part of the status answer
- Parameters
-
Reimplemented in Driver.
◆ statusParams()
| virtual void statusParams |
( |
String & | str | ) |
|
|
protectedvirtual |
Build the parameter reporting part of the status answer
- Parameters
-
Reimplemented in Driver.
◆ type()
Retrieve the type of the module
- Returns
- The module's type as String
◆ uninstallRelay() [1/2]
| bool uninstallRelay |
( |
int | id, |
|
|
bool | delRelay = true ) |
|
protected |
Uninstall a message relay
- Parameters
-
| id | RelayID to uninstall, relay will be deleted |
| delRelay | True to delete the relay after removing it |
- Returns
- True if uninstalled, false if if was not present
◆ uninstallRelay() [2/2]
| bool uninstallRelay |
( |
MessageRelay * | relay, |
|
|
bool | delRelay = true ) |
|
protected |
Uninstall a message relay
- Parameters
-
| relay | Pointer to message relay |
| delRelay | True to delete the relay after removing it |
- Returns
- True if uninstalled, false if if was not present
◆ uninstallRelays()
Uninstall all installed relays in preparation for unloading
- Returns
- True if all relays were uninstalled, false if something wrong
◆ updateDelay() [1/2]
| static unsigned int updateDelay |
( |
| ) |
|
|
inlinestatic |
Retrieve the global update notification delay
- Returns
- Update delay value in seconds
◆ updateDelay() [2/2]
| static void updateDelay |
( |
unsigned int | delay | ) |
|
|
inlinestatic |
Set the global update notification delay
- Parameters
-
| delay | New update delay value in seconds, 0 to disable |
◆ []
IDs of the installed relays
The documentation for this class was generated from the following file: