17 #include <sipwitch-config.h>
22 static const char *dirpath = NULL;
23 static char prior[65] =
"down";
42 shell::log(shell::INFO,
"scripting plugin loaded");
55 const char *state = cfg->
getRoot()->getPointer();
59 if(String::equal(state, prior))
64 String::set(prior,
sizeof(prior), state);
74 if(fsys::is_dir(DEFAULT_CFGPATH
"/sysconfig/sipwitch-scripts"))
75 dirpath = DEFAULT_CFGPATH
"/sysconfig/sipwitch-scripts";
76 else if(fsys::is_dir(DEFAULT_LIBEXEC
"/sipwitch"))
77 dirpath = DEFAULT_LIBEXEC
"/sipwitch";
79 snprintf(buf,
sizeof(buf),
"%s/.sipwitch-scripts", home);
85 shell::log(shell::INFO,
"scripting plugin path %s", dirpath);
87 shell::log(shell::ERR,
"scripting plugin disabled; no script directory");
96 Socket::query((
struct sockaddr *)&rr->
contact, addr,
sizeof(addr));
98 addr, Socket::port((
struct sockaddr *)&rr->
contact),
Representation of a mapped active user record.
sockaddr_internet contact
Top level include directory for GNU Telephony SIP Witch Server.
void reload(service *cfg)
static bool libexec(const char *fmt,...) __PRINTF(1
Execute an external shell command on behalf of the server.
void expiring(MappedRegistry *rr)
Notify plugins a user registration has been expired or released.
void activating(MappedRegistry *rr)
Notify plugins a user registration is being activated.
System configuration instance and service functions.
Common interfaces and clases for plugins.
Common base class for sipwitch plugin services.
static const char * env(const char *id)
Return the value of a server environment variable.
enum sipwitch::MappedRegistry::@5 type