30 #ifndef _SIPWITCH_SERVICE_H_
31 #define _SIPWITCH_SERVICE_H_
33 #ifndef _UCOMMON_LINKED_H_
34 #include <ucommon/linked.h>
37 #ifndef _UCOMMON_THREAD_H_
38 #include <ucommon/thread.h>
41 #ifndef _UCOMMON_STRING_H_
42 #include <ucommon/string.h>
45 #ifndef _UCOMMON_FSYS_H_
46 #include <ucommon/fsys.h>
49 #ifndef _SIPWITCH_NAMESPACE_H_
53 #ifndef _SIPWITCH_MAPPED_H_
57 #ifndef _SIPWITCH_CONTROL_H_
61 #ifndef _SIPWITCH_CDR_H_
65 #define CONFIG_KEY_SIZE 177
141 inline operator bool()
const
142 {
return node != NULL;}
145 {
return node == NULL;}
206 static char session_uuid[40];
212 {
return cfgp->alloc(size);}
215 {
return cfgp->dup(s);}
221 {
return active_flag;}
223 virtual void cdrlog(
cdr *call);
224 virtual void errlog(shell::loglevel_t level,
const char *text);
225 virtual bool check(
void);
226 virtual void snapshot(FILE *fp);
227 virtual void start(
service *cfg);
228 virtual void stop(
service *cfg);
229 virtual void reload(
service *cfg);
230 virtual void publish(
service *cfg);
238 inline static void bind(
unsigned short port)
244 static void bind(
const char *addr);
261 bool load(FILE *file,
keynode *node = NULL);
263 keynode *getPath(
const char *path);
268 keynode *getList(
const char *path);
281 static void publish(
const char *addr);
283 static void published(
struct sockaddr_storage *peer);
284 static const char *getValue(keynode *base,
const char *
id);
285 static void dump(FILE *fp, keynode *node,
unsigned level);
286 static void snapshot(
void);
287 static void dumpfile(
void);
288 static bool period(
long slice);
289 static void result(
const char *
value);
290 static void startup(
void);
291 static void shutdown(
void);
292 static long uptime(
void);
293 static bool match(
const char *digits,
const char *pattern,
bool partial);
294 static keynode *
get(void);
296 static keynode *getProtected(
const char *path);
297 static keynode *getUser(
const char *uid);
298 static keynode *path(
const char *p);
299 static keynode *list(
const char *p);
302 {
return getProtected(
"environ");}
307 static string_t getContact(
void);
310 {contact = dup(text);}
318 virtual void dump(FILE *fp);
319 virtual void confirm(
void);
322 static bool check(
void);
323 static void release(keynode *node);
351 void addAttributes(
keynode *node,
char *attrib);
354 #define RUNLEVELS (sizeof(callback::runlevels) / sizeof(LinkedObject *))
355 #define PRIORITY_RUNLEVEL 0
356 #define DEFAULT_RUNLEVEL 1
357 #define MODULE_RUNLEVEL (RUNLEVELS - 1)
358 #define GENERIC_RUNLEVEL (RUNLEVELS - 2)
Some convenience methods for manipulating SIP uri's.
static volatile char * sip_publish
static voip::context_t udp_context
static volatile char * sip_contact
Pointer to a provisioned user xml subtree.
static voip::context_t tls_context
static volatile dialmode_t dialmode
static const char * getInterface(void)
Event message and supporting methods for plugins.
bool is_active(void) const
Used to splice new chains onto an existing xml tree.
static unsigned sip_prefix
Linked list of named xml node locations.
static void bind(unsigned short port)
static LinkedObject * getModules(void)
static voip::context_t tcp_context
static const char * sip_iface
Keyword and value pair definition lists.
Definitions for memory mapped objects that may be shared between processes.
void setContact(const char *text)
static LinkedObject * runlevels[4]
Basic server call detail record.
static const char * sip_realm
static void * alloc(service *cfgp, size_t size)
GNU SIP Witch library namespace.
static condlock_t locking
static keynode * getEnviron(void)
void reset(const char *tag)
Callback methods for objects managed under the service thread.
static LinkedObject * getGenerics(void)
static void setPublic(void)
static bool is_configured(void)
static unsigned short getPort(void)
static const char * sip_tlskey
static const char * sip_domain
static const char * sip_tlsdh
static const char * sip_tlsca
A pointer to a subtree in the xml configuration tree.
static char * dup(service *cfgp, const char *s)
static voip::context_t out_context
dialmode_t
Dialing mode supported.
static const char * sip_tlsdev
static const char * sip_tlscert
System configuration instance and service functions.
Manage control interface.
keynode * operator*() const
static unsigned short sip_port
const service * operator->() const
The current singleton instance of the active xml configuration tree.
Interface class for call detail records.
Common interfaces and clases for plugins.
static unsigned sip_range
static const char * sip_tlspwd
treemap< char * > keynode
Definition of a xml node.
keynode * operator->() const