Common base class for sipwitch plugin services.
More...
#include <modules.h>
|
virtual void | period (long slice) |
| Period service request. More...
|
|
virtual bool | announce (MappedRegistry *user, const char *type, const char *event, const char *expires, const char *body) |
| Announce a SIP publish event from a registered user to plugins. More...
|
|
virtual void | activating (MappedRegistry *user) |
| Notify plugins a user registration is being activated. More...
|
|
virtual void | expiring (MappedRegistry *user) |
| Notify plugins a user registration has been expired or released. More...
|
|
virtual void | registration (voip::reg_t id, regmode_t reg) |
| Notify plugins about reply messages from external registrations. More...
|
|
virtual bool | authenticate (voip::reg_t id, const char *realm) |
| Used to verify authentication of a registered session. More...
|
|
virtual char * | referLocal (MappedRegistry *user, const char *target, char *buffer, size_t size) |
| Enables plugin to redirect locally dialed destination to new uri. More...
|
|
virtual char * | referRemote (MappedRegistry *user, const char *target, char *buffer, size_t size) |
| Enables plugin to remap users dialing remote destinations. More...
|
|
voip::context_t | getContext (const char *uri) |
|
|
static void | bind (unsigned short port) |
|
static void | bind (const char *addr) |
|
static void | setPublic (void) |
|
Common base class for sipwitch plugin services.
This provides interfaces for server and runtime library callbacks to notify plugins about server operations and events.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 66 of file modules.h.
sipwitch::modules::sipwitch::sipwitch |
( |
| ) |
|
|
protected |
Create a service instance and add to runtime list of services to start and stop.
Definition at line 30 of file modules.cpp.
static void* sipwitch::service::callback::alloc |
( |
service * |
cfgp, |
|
|
size_t |
size |
|
) |
| |
|
inlinestaticprotectedinherited |
bool sipwitch::modules::sipwitch::announce |
( |
MappedRegistry * |
user, |
|
|
const char * |
type, |
|
|
const char * |
event, |
|
|
const char * |
expires, |
|
|
const char * |
body |
|
) |
| |
|
virtual |
Announce a SIP publish event from a registered user to plugins.
- Parameters
-
user | registration who publushed. |
type | of message that is published. |
event | type description, such as "presense" message. |
expires | time for this message. |
body | of message published by user agent. |
- Returns
- true if plugin wishes to swallow this message.
Reimplemented in sipwitch::forward.
Definition at line 57 of file modules.cpp.
bool sipwitch::modules::sipwitch::authenticate |
( |
voip::reg_t |
id, |
|
|
const char * |
realm |
|
) |
| |
|
virtual |
Used to verify authentication of a registered session.
This is for use by sessions registered by plugins.
- Parameters
-
id | of registration (eXosip rid). |
realm | of this registration. |
- Returns
- true if valid, false if invalid or to ignore in this plugin.
Reimplemented in sipwitch::forward.
Definition at line 66 of file modules.cpp.
static void sipwitch::service::callback::bind |
( |
unsigned short |
port | ) |
|
|
inlinestaticinherited |
void callback::bind |
( |
const char * |
addr | ) |
|
|
staticinherited |
void callback::cdrlog |
( |
cdr * |
call | ) |
|
|
protectedvirtualinherited |
bool callback::check |
( |
void |
| ) |
|
|
protectedvirtualinherited |
static char* sipwitch::service::callback::dup |
( |
service * |
cfgp, |
|
|
const char * |
s |
|
) |
| |
|
inlinestaticprotectedinherited |
void callback::errlog |
( |
shell::loglevel_t |
level, |
|
|
const char * |
text |
|
) |
| |
|
protectedvirtualinherited |
bool sipwitch::service::callback::is_active |
( |
void |
| ) |
const |
|
inlineprotectedinherited |
static bool sipwitch::service::callback::is_configured |
( |
void |
| ) |
|
|
inlinestaticprotectedinherited |
void sipwitch::modules::sipwitch::period |
( |
long |
slice | ) |
|
|
virtual |
Period service request.
A period is an interval during which stats are flushed and refreshed. This notifies the plugin that a period has occured, and what the interval for the period was in seconds.
- Parameters
-
slice | of period in seconds. |
Definition at line 53 of file modules.cpp.
void callback::publish |
( |
service * |
cfg | ) |
|
|
protectedvirtualinherited |
char * sipwitch::modules::sipwitch::referLocal |
( |
MappedRegistry * |
user, |
|
|
const char * |
target, |
|
|
char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Enables plugin to redirect locally dialed destination to new uri.
Might be used by a plugin that does per-user speed-dialing database, for example.
- Parameters
-
user | that is dialing. |
target | user dialed. |
buffer | to store replacement uri in. |
size | of replacement buffer. |
- Returns
- pointer to buffer or NULL if ignored.
Reimplemented in sipwitch::forward.
Definition at line 71 of file modules.cpp.
char * sipwitch::modules::sipwitch::referRemote |
( |
MappedRegistry * |
user, |
|
|
const char * |
target, |
|
|
char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Enables plugin to remap users dialing remote destinations.
This might be used as a hook for a plugin that maintains gfc peer tables, for example.
- Parameters
-
user | that is dialing. |
target | of remote uri. |
buffer | to store replacement uri in. |
size | of replacement buffer. |
- Returns
- pointer to buffer of new uri or NULL ignored.
Definition at line 76 of file modules.cpp.
Notify plugins about reply messages from external registrations.
This is used to get result of eXosip SIP registration requests. This might be used to get the result of a plugin registering itself with a gateway or SIP service provider, for example.
- Parameters
-
id | of registration (eXosip rid). |
result | of registration |
Reimplemented in sipwitch::forward.
Definition at line 62 of file modules.cpp.
void callback::reload |
( |
service * |
cfg | ) |
|
|
protectedvirtualinherited |
static void sipwitch::service::callback::setPublic |
( |
void |
| ) |
|
|
inlinestaticinherited |
void callback::snapshot |
( |
FILE * |
fp | ) |
|
|
protectedvirtualinherited |
void callback::start |
( |
service * |
cfg | ) |
|
|
protectedvirtualinherited |
void callback::stop |
( |
service * |
cfg | ) |
|
|
protectedvirtualinherited |
bool sipwitch::service::callback::active_flag |
|
protectedinherited |
unsigned callback::count = 0 |
|
staticprotectedinherited |
unsigned sipwitch::service::callback::runlevel |
|
protectedinherited |
LinkedObject * callback::runlevels = {NULL, NULL, NULL, NULL} |
|
staticprotectedinherited |
char callback::session_uuid |
|
staticprotectedinherited |
volatile char * callback::sip_contact = NULL |
|
staticprotectedinherited |
const char * callback::sip_domain = NULL |
|
staticprotectedinherited |
int callback::sip_family = AF_INET |
|
staticprotectedinherited |
const char * callback::sip_iface = NULL |
|
staticprotectedinherited |
unsigned short callback::sip_port = 5060 |
|
staticprotectedinherited |
unsigned callback::sip_prefix = 0 |
|
staticprotectedinherited |
int callback::sip_protocol = IPPROTO_UDP |
|
staticprotectedinherited |
bool callback::sip_public = false |
|
staticprotectedinherited |
volatile char * callback::sip_publish = NULL |
|
staticprotectedinherited |
unsigned callback::sip_range = 0 |
|
staticprotectedinherited |
const char * callback::sip_realm = "unknown" |
|
staticprotectedinherited |
const char * callback::sip_tlsca = "/etc/ssl/ca.pem" |
|
staticprotectedinherited |
const char * callback::sip_tlscert = "/etc/ssl/sipwitch.pem" |
|
staticprotectedinherited |
const char * callback::sip_tlsdev = "/dev/random" |
|
staticprotectedinherited |
const char * callback::sip_tlsdh = "/etc/ssl/dh1024.pem" |
|
staticprotectedinherited |
const char * callback::sip_tlskey = "/etc/ssl/private/sipwitch.key" |
|
staticprotectedinherited |
int callback::sip_tlsmode = 0 |
|
staticprotectedinherited |
const char * callback::sip_tlspwd = "" |
|
staticprotectedinherited |
The documentation for this class was generated from the following files: