SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Data Fields
sipwitch::history Class Reference

#include <server.h>

Inheritance diagram for sipwitch::history:
Inheritance graph
[legend]
Collaboration diagram for sipwitch::history:
Collaboration graph
[legend]

Public Member Functions

 history (shell::loglevel_t lid, const char *msg)
 
void set (shell::loglevel_t lid, const char *msg)
 

Static Public Member Functions

static void add (shell::loglevel_t lid, const char *msg)
 
static void set (unsigned size)
 
static void out (void)
 
static bool send (const char *format,...) __PRINTF(1
 Send a printf-style message to the control fifo via the file system. More...
 
static bool static char * receive (void)
 Used by the server to pull pending fifo requests. More...
 
static void reply (const char *error=NULL)
 Used by the server to send replies back to control requests. More...
 
static size_t attach (shell_t *env)
 Creates the control fifo using server configuration. More...
 
static void release (void)
 Used by the server to destroy the control fifo. More...
 
static bool state (const char *value)
 Sets server run state configuration. More...
 
static bool libexec (const char *fmt,...) __PRINTF(1
 Execute an external shell command on behalf of the server. More...
 
static bool static FILE * output (const char *id)
 Used to open an output session for returning control data. More...
 
static const char * env (const char *id)
 Return the value of a server environment variable. More...
 
static String path (const char *id)
 Get a string from a server environment variable. More...
 
static void config (shell *envp)
 

Data Fields

char text [128]
 

Detailed Description

Definition at line 754 of file server.h.

Constructor & Destructor Documentation

sipwitch::history::history ( shell::loglevel_t  lid,
const char *  msg 
)

Definition at line 26 of file history.cpp.

Member Function Documentation

void sipwitch::history::add ( shell::loglevel_t  lid,
const char *  msg 
)
static

Definition at line 47 of file history.cpp.

size_t sipwitch::control::attach ( shell_t *  env)
staticinherited

Creates the control fifo using server configuration.

This also attaches the shell environment and command line arguments to the current server instance so it can be accessed by other things.

Parameters
envof server.
Returns
size of longest control message supported.

Definition at line 61 of file control.cpp.

static void sipwitch::control::config ( shell *  envp)
inlinestaticinherited

Definition at line 144 of file control.h.

static const char* sipwitch::control::env ( const char *  id)
inlinestaticinherited

Return the value of a server environment variable.

This is commonly used by plugins to get access to the server environment.

Parameters
idof environment symbol.
Returns
value of symbol or NULL if not found.

Definition at line 131 of file control.h.

bool sipwitch::control::libexec ( const char *  fmt,
  ... 
)
staticinherited

Execute an external shell command on behalf of the server.

This might also be used by plugins to execute supporting processes. The function waits until the child process completes but does not return the child exit code.

Parameters
formatof shell command to execute.
Returns
true if successfully executed.

Definition at line 261 of file control.cpp.

void sipwitch::history::out ( void  )
static

Definition at line 85 of file history.cpp.

FILE * sipwitch::control::output ( const char *  id)
staticinherited

Used to open an output session for returning control data.

Parameters
idof output type.
Returns
file handle to write to or NULL on failure.

Definition at line 380 of file control.cpp.

static String sipwitch::control::path ( const char *  id)
inlinestaticinherited

Get a string from a server environment variable.

This is often used to get pathname variables which may then be further concatenated. This is commonly used by plugins to get paths.

Parameters
idof environment symbol.
Returns
string value of symbol requested.

Definition at line 141 of file control.h.

char * sipwitch::control::receive ( void  )
staticinherited

Used by the server to pull pending fifo requests.

Returns
string of next fifo input.

Definition at line 87 of file control.cpp.

void sipwitch::control::release ( void  )
staticinherited

Used by the server to destroy the control fifo.

Definition at line 81 of file control.cpp.

void sipwitch::control::reply ( const char *  error = NULL)
staticinherited

Used by the server to send replies back to control requests.

Parameters
errorstring to report or NULL for none.

Definition at line 218 of file control.cpp.

bool sipwitch::control::send ( const char *  format,
  ... 
)
staticinherited

Send a printf-style message to the control fifo via the file system.

While plugins can also use this to send control messages back into the server, we should create a method that does not require going to the external filesystem to do this.

Parameters
formatstring.
Returns
true if successful.

Definition at line 309 of file control.cpp.

void sipwitch::history::set ( shell::loglevel_t  lid,
const char *  msg 
)

Definition at line 33 of file history.cpp.

void sipwitch::history::set ( unsigned  size)
static

Definition at line 71 of file history.cpp.

bool sipwitch::control::state ( const char *  value)
staticinherited

Sets server run state configuration.

This is done by symlinking a state xml file when selecting a special running state.

Parameters
stateto select.
Returns
true if set to state.

Definition at line 354 of file control.cpp.

Field Documentation

char sipwitch::history::text[128]

Definition at line 757 of file server.h.


The documentation for this class was generated from the following files: