SIP Witch 1.9.15
|
System configuration instance and service functions. More...
#include <service.h>
Data Structures | |
class | callback |
Callback methods for objects managed under the service thread. More... | |
struct | define |
Keyword and value pair definition lists. More... | |
class | instance |
The current singleton instance of the active xml configuration tree. More... | |
class | keyclone |
Used to splice new chains onto an existing xml tree. More... | |
class | keymap |
Linked list of named xml node locations. More... | |
class | pointer |
A pointer to a subtree in the xml configuration tree. More... | |
class | usernode |
Pointer to a provisioned user xml subtree. More... | |
Public Types | |
enum | dialmode_t { EXT_DIALING, USER_DIALING, ALL_DIALING } |
Dialing mode supported. More... | |
typedef treemap< char * > | keynode |
Definition of a xml node. More... | |
Public Member Functions | |
service (const char *name, size_t s=0) | |
virtual | ~service () |
bool | load (FILE *file, keynode *node=NULL) |
Load xml file into xml tree. More... | |
keynode * | getPath (const char *path) |
keynode * | getNode (keynode *base, const char *id, const char *value) |
keynode * | addNode (keynode *base, define *defs) |
keynode * | addNode (keynode *base, const char *id, const char *value) |
keynode * | getNode (keynode *base, const char *grp, const char *attr, const char *value) |
keynode * | getList (const char *path) |
keynode * | getRoot (void) |
void | setContact (const char *text) |
virtual void | dump (FILE *fp) |
virtual void | confirm (void) |
void | commit (void) |
Static Public Member Functions | |
static LinkedObject * | getModules (void) |
static LinkedObject * | getGenerics (void) |
static void | publish (const char *addr) |
Set and publish public "appearing" address of the server. More... | |
static void | published (struct sockaddr_storage *peer) |
static const char * | getValue (keynode *base, const char *id) |
static void | dump (FILE *fp, keynode *node, unsigned level) |
static void | snapshot (void) |
static void | dumpfile (void) |
static bool | period (long slice) |
static void | result (const char *value) |
static void | startup (void) |
static void | shutdown (void) |
static long | uptime (void) |
static bool | match (const char *digits, const char *pattern, bool partial) |
static keynode * | get (void) |
static keynode * | getProtected (const char *path) |
static keynode * | getUser (const char *uid) |
static keynode * | path (const char *p) |
static keynode * | list (const char *p) |
static keynode * | getEnviron (void) |
static string_t | getContact (void) |
static const char * | getInterface (void) |
static unsigned short | getPort (void) |
static bool | check (void) |
static void | release (keynode *node) |
Static Public Attributes | |
static volatile dialmode_t | dialmode = service::ALL_DIALING |
Protected Member Functions | |
void | addAttributes (keynode *node, char *attrib) |
Add attributes in a XML entity as child nodes of the xml node. More... | |
Protected Attributes | |
keynode | root |
stringbuf< 1024 > | buffer |
LinkedObject * | keys [177] |
const char * | contact |
Static Protected Attributes | |
static service * | cfg = NULL |
static condlock_t | locking |
Friends | |
class | instance |
System configuration instance and service functions.
This provides an instance of a system configuration compiled from xml configs. There is an active instance which represents the current configuration, and a new instance can be created without stopping the server. This also provides high level service functions in the runtime library for the server and plugins to use. The xml tree nodes are stored in a paged allocator.
typedef treemap<char *> sipwitch::service::keynode |
sipwitch::service::service | ( | const char * | name, |
size_t | s = 0 |
||
) |
Definition at line 248 of file service.cpp.
|
virtual |
Definition at line 264 of file service.cpp.
|
protected |
Add attributes in a XML entity as child nodes of the xml node.
node | in tree of our node. |
attrib | string we must decompose into child nodes. |
Definition at line 523 of file service.cpp.
service::keynode * sipwitch::service::addNode | ( | keynode * | base, |
define * | defs | ||
) |
Definition at line 458 of file service.cpp.
service::keynode * sipwitch::service::addNode | ( | keynode * | base, |
const char * | id, | ||
const char * | value | ||
) |
Definition at line 427 of file service.cpp.
|
static |
Definition at line 894 of file service.cpp.
void sipwitch::service::commit | ( | void | ) |
Definition at line 910 of file service.cpp.
|
virtual |
Reimplemented in sipwitch::server.
Definition at line 890 of file service.cpp.
|
static |
Definition at line 735 of file service.cpp.
|
virtual |
Reimplemented in sipwitch::server.
Definition at line 765 of file service.cpp.
|
static |
Definition at line 773 of file service.cpp.
|
static |
Definition at line 387 of file service.cpp.
|
static |
Definition at line 792 of file service.cpp.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
service::keynode * sipwitch::service::getList | ( | const char * | path | ) |
Definition at line 376 of file service.cpp.
|
inlinestatic |
service::keynode * sipwitch::service::getNode | ( | keynode * | base, |
const char * | id, | ||
const char * | value | ||
) |
Definition at line 503 of file service.cpp.
service::keynode * sipwitch::service::getNode | ( | keynode * | base, |
const char * | grp, | ||
const char * | attr, | ||
const char * | value | ||
) |
Definition at line 478 of file service.cpp.
service::keynode * sipwitch::service::getPath | ( | const char * | path | ) |
Definition at line 400 of file service.cpp.
|
inlinestatic |
|
static |
Definition at line 360 of file service.cpp.
|
static |
Definition at line 335 of file service.cpp.
|
static |
Definition at line 446 of file service.cpp.
|
static |
Definition at line 320 of file service.cpp.
bool sipwitch::service::load | ( | FILE * | file, |
keynode * | node = NULL |
||
) |
Load xml file into xml tree.
This may load into the root node, or to a subnode. The <provision> xml files for users are all loaded into the <provision> subtree this way.
file | to load from. |
node | to load to or NULL to make a root node for master config. |
Definition at line 565 of file service.cpp.
|
static |
Definition at line 954 of file service.cpp.
|
static |
Definition at line 310 of file service.cpp.
|
static |
Definition at line 828 of file service.cpp.
|
static |
Set and publish public "appearing" address of the server.
This probably should also appear in the events system.
addr | we are appearing as (dns name or ip addr). |
Definition at line 272 of file service.cpp.
|
static |
Definition at line 295 of file service.cpp.
|
static |
Definition at line 394 of file service.cpp.
|
static |
|
inline |
|
static |
Definition at line 719 of file service.cpp.
|
static |
Definition at line 861 of file service.cpp.
|
static |
Definition at line 700 of file service.cpp.
|
static |
Definition at line 300 of file service.cpp.
|
static |
|
protected |