Event message and supporting methods for plugins.
More...
#include <events.h>
|
enum | type_t {
NOTICE,
WARNING,
FAILURE,
TERMINATE,
STATE,
REALM,
CALL,
DROP,
ACTIVATE,
RELEASE,
WELCOME,
SYNC,
CONTACT,
PUBLISH
} |
|
Event message and supporting methods for plugins.
This defines what an event message is as passed from the server to clients listening on (unix or inet) sockets, and also what functions are offered in the runtime library for the server and plugins to send events to clients.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 66 of file events.h.
Enumerator |
---|
NOTICE |
|
WARNING |
|
FAILURE |
|
TERMINATE |
|
STATE |
|
REALM |
|
CALL |
|
DROP |
|
ACTIVATE |
|
RELEASE |
|
WELCOME |
|
SYNC |
|
CONTACT |
|
PUBLISH |
|
Definition at line 77 of file events.h.
Send event for first instance of user registration.
This is sent after the shared memory registry object is updated.
- Parameters
-
user | registration record activated. |
Definition at line 284 of file events.cpp.
void sipwitch::events::connect |
( |
cdr * |
rec | ) |
|
|
static |
Send call connection to clients from cdr start record.
- Parameters
-
cdr | record of started call. |
Definition at line 260 of file events.cpp.
void sipwitch::events::drop |
( |
cdr * |
rec | ) |
|
|
static |
Send call disconnected event to clients from cdr stop record.
- Parameters
-
Definition at line 273 of file events.cpp.
void sipwitch::events::failure |
( |
const char * |
reason | ) |
|
|
static |
Send error to user.
These are sent from the runtime logging, so if plugins already log messages they do not have to separately call this.
- Parameters
-
Definition at line 354 of file events.cpp.
void sipwitch::events::notice |
( |
const char * |
reason | ) |
|
|
static |
Send notice to user.
These are sent from the runtime logging, so if plugins already log messages they do not have to separately call this.
- Parameters
-
Definition at line 336 of file events.cpp.
void sipwitch::events::publish |
( |
const char * |
address | ) |
|
|
static |
Update publish address...
- Parameters
-
Definition at line 380 of file events.cpp.
bool sipwitch::events::put |
( |
events * |
event | ) |
|
|
protected |
Internal method to send an event message.
- Parameters
-
event | to send to connected clients. |
- Returns
- true if sent successfully.
static void sipwitch::events::realm |
( |
const char * |
newrealm | ) |
|
|
static |
Send realm change to connected clients.
- Parameters
-
newrealm | server changed to. |
Send event for last instance of user expired or de-registering.
This is sent after the shared memory registry object is updated.
- Parameters
-
user | registration record released. |
Definition at line 294 of file events.cpp.
void sipwitch::events::reload |
( |
void |
| ) |
|
|
static |
Refresh clients with any config events...
Definition at line 363 of file events.cpp.
bool sipwitch::events::start |
( |
void |
| ) |
|
|
static |
Start server event system by binding event session listener.
- Parameters
-
true | if sucessfully bound and started. |
Definition at line 203 of file events.cpp.
static void sipwitch::events::state |
( |
const char * |
newstate | ) |
|
|
static |
Send state change to connected clients.
- Parameters
-
newstate | server changed to. |
void sipwitch::events::sync |
( |
unsigned |
period = 0l | ) |
|
|
static |
Test connection and housekeeping notification.
A sync with a period of 0 is used to test existing sessions to see if they are connected.
- Parameters
-
period | of housekeeping event or 0 if connection test. |
Definition at line 328 of file events.cpp.
void sipwitch::events::terminate |
( |
const char * |
reason | ) |
|
|
static |
Notify server termination.
- Parameters
-
Definition at line 390 of file events.cpp.
void sipwitch::events::warning |
( |
const char * |
reason | ) |
|
|
static |
Send warning to user.
These are sent from the runtime logging, so if plugins already log messages they do not have to separately call this.
- Parameters
-
Definition at line 345 of file events.cpp.
struct { ... } sipwitch::events::call |
char sipwitch::events::contact[160] |
unsigned sipwitch::events::extension |
union { ... } sipwitch::events::msg |
Content of message, based on type.
unsigned sipwitch::events::period |
void sipwitch::events::realm |
char sipwitch::events::reason[160] |
struct { ... } sipwitch::events::server |
time_t sipwitch::events::started |
void sipwitch::events::state |
Type of event message.
Definition at line 82 of file events.h.
struct { ... } sipwitch::events::user |
char sipwitch::events::version[16] |
The documentation for this class was generated from the following files: