1 // Copyright (C) 2006-2014 David Sugar, Tycho Softworks.
2 // Copyright (C) 2015 Cherokees of Idaho.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16
26 #ifndef _SIPWITCH_EVENTS_H_
27 #define _SIPWITCH_EVENTS_H_
28
29 #ifndef _UCOMMON_LINKED_H_
30 #include <ucommon/linked.h>
31 #endif
32
33 #ifndef _UCOMMON_THREAD_H_
34 #include <ucommon/thread.h>
35 #endif
36
37 #ifndef _UCOMMON_STRING_H_
38 #include <ucommon/string.h>
39 #endif
40
41 #ifndef _UCOMMON_SOCKET_H_
42 #include <ucommon/socket.h>
43 #endif
44
45 #ifndef __SIPWITCH_NAMESPACE_H_
47 #endif
48
49 #ifndef __SIPWITCH_MAPPED_H_
51 #endif
52
53 #ifndef __SIPWITCH_CDR_H_
55 #endif
56
57 namespace sipwitch {
58
67 {
68 protected:
75
76 public:
77 typedef enum {NOTICE,
WARNING, FAILURE, TERMINATE, STATE, REALM, CALL, DROP, ACTIVATE, RELEASE,
WELCOME, SYNC,
CONTACT, PUBLISH}
type_t;
78
83
87 union {
88 struct {
95 } call;
96 struct {
99 } user;
100 struct {
101 time_t started;
107 char reason[160];
109 } msg;
110
115 static bool start(void);
116
121 static void state(const char *newstate);
122
127 static void realm(const char *newrealm);
128
133 static void connect(
cdr *rec);
134
139 static void drop(
cdr *rec);
140
147
154
161 static void notice(const char *reason);
162
169 static void warning(const char *reason);
170
177 static void failure(const char *reason);
178
182 static void reload(void);
183
188 static void publish(const char *address);
189
194 static void terminate(const char *reason);
195
201 static void sync(unsigned period = 0l);
202 };
203
205
206 } // namespace sipwitch
207
208 #endif
Event message and supporting methods for plugins.
Representation of a mapped active user record.
Definitions for memory mapped objects that may be shared between processes.
Basic server call detail record.
GNU SIP Witch library namespace.
type_t type
Type of event message.
Interface class for call detail records.
type_t
Enumeration for event type.