Asterisk - The Open Source Telephony Project GIT-master-85241bd
event_defs.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2007 - 2008, Digium, Inc.
5 *
6 * Russell Bryant <russell@digium.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19/*!
20 * \file
21 * \author Russell Bryant <russell@digium.com>
22 * \brief Generic event system
23 */
24
25#ifndef AST_EVENT_DEFS_H
26#define AST_EVENT_DEFS_H
27
29 /*! Reserved to provide the ability to subscribe to all events. A specific
30 * event should never have a payload of 0. */
32 /*! This event type is reserved for use by third-party modules to create
33 * custom events without having to modify this file.
34 * \note There are no "custom" IE types, because IEs only have to be
35 * unique to the event itself, not necessarily across all events. */
37 /*! Voicemail message waiting indication */
39 /*! Someone has subscribed to events */
41 /*! Someone has unsubscribed from events */
43 /*! The aggregate state of a device across all servers configured to be
44 * a part of a device state cluster has changed. */
46 /*! The state of a device has changed on _one_ server. This should not be used
47 * directly, in general. Use AST_EVENT_DEVICE_STATE instead. */
49 /*! Channel Event Logging events */
51 /*! A report of a security related event (see security_events.h) */
53 /*! Used by res_stun_monitor to alert listeners to an exernal network address change. */
55 /*! The presence state for a presence provider */
57 /*! Used to alert listeners when a named ACL has changed. */
59 /*! Send out a ping for debugging distributed events */
61 /*! A cluster discovery message */
63 /*! Number of event types. This should be the last event type + 1 */
65};
66
67/*! \brief Event Information Element types */
69 /*! Used to terminate the arguments to event functions */
71
72 /*!
73 * \brief Number of new messages
74 * Used by: AST_EVENT_MWI
75 * Payload type: UINT
76 */
78 /*!
79 * \brief Number of
80 * Used by: AST_EVENT_MWI
81 * Payload type: UINT
82 */
84 /*!
85 * \brief Mailbox name \verbatim (mailbox[@context]) \endverbatim
86 * Used by: AST_EVENT_MWI
87 * Payload type: STR
88 */
90 /*!
91 * \brief Unique ID
92 * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
93 * Payload type: UINT
94 */
96 /*!
97 * \brief Event type
98 * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
99 * Payload type: UINT
100 */
102 /*!
103 * \brief Hint that someone cares that an IE exists
104 * Used by: AST_EVENT_SUB
105 * Payload type: UINT (ast_event_ie_type)
106 */
108 /*!
109 * \brief Device Name
110 * Used by AST_EVENT_DEVICE_STATE_CHANGE
111 * Payload type: STR
112 */
114 /*!
115 * \brief Generic State IE
116 * Used by AST_EVENT_DEVICE_STATE_CHANGE
117 * Payload type: UINT
118 * The actual state values depend on the event which
119 * this IE is a part of.
120 */
122 /*!
123 * \brief Context IE
124 * Used by AST_EVENT_MWI
125 * Payload type: str
126 */
128 /*!
129 * \brief Channel Event Type
130 * Used by: AST_EVENT_CEL
131 * Payload type: UINT
132 */
134 /*!
135 * \brief Channel Event Time (seconds)
136 * Used by: AST_EVENT_CEL
137 * Payload type: UINT
138 */
140 /*!
141 * \brief Channel Event Time (micro-seconds)
142 * Used by: AST_EVENT_CEL
143 * Payload type: UINT
144 */
146 /*!
147 * \brief Channel Event User Event Name
148 * Used by: AST_EVENT_CEL
149 * Payload type: STR
150 */
152 /*!
153 * \brief Channel Event CID name
154 * Used by: AST_EVENT_CEL
155 * Payload type: STR
156 */
158 /*!
159 * \brief Channel Event CID num
160 * Used by: AST_EVENT_CEL
161 * Payload type: STR
162 */
164 /*!
165 * \brief Channel Event extension name
166 * Used by: AST_EVENT_CEL
167 * Payload type: STR
168 */
170 /*!
171 * \brief Channel Event context name
172 * Used by: AST_EVENT_CEL
173 * Payload type: STR
174 */
176 /*!
177 * \brief Channel Event channel name
178 * Used by: AST_EVENT_CEL
179 * Payload type: STR
180 */
182 /*!
183 * \brief Channel Event app name
184 * Used by: AST_EVENT_CEL
185 * Payload type: STR
186 */
188 /*!
189 * \brief Channel Event app args/data
190 * Used by: AST_EVENT_CEL
191 * Payload type: STR
192 */
194 /*!
195 * \brief Channel Event AMA flags
196 * Used by: AST_EVENT_CEL
197 * Payload type: UINT
198 */
200 /*!
201 * \brief Channel Event AccountCode
202 * Used by: AST_EVENT_CEL
203 * Payload type: STR
204 */
206 /*!
207 * \brief Channel Event UniqueID
208 * Used by: AST_EVENT_CEL
209 * Payload type: STR
210 */
212 /*!
213 * \brief Channel Event Userfield
214 * Used by: AST_EVENT_CEL
215 * Payload type: STR
216 */
218 /*!
219 * \brief Channel Event CID ANI field
220 * Used by: AST_EVENT_CEL
221 * Payload type: STR
222 */
224 /*!
225 * \brief Channel Event CID RDNIS field
226 * Used by: AST_EVENT_CEL
227 * Payload type: STR
228 */
230 /*!
231 * \brief Channel Event CID dnid
232 * Used by: AST_EVENT_CEL
233 * Payload type: STR
234 */
236 /*!
237 * \brief Channel Event Peer -- for Things involving multiple channels, like BRIDGE
238 * Used by: AST_EVENT_CEL
239 * Payload type: STR
240 */
242 /*!
243 * \brief Channel Event LinkedID
244 * Used by: AST_EVENT_CEL
245 * Payload type: STR
246 */
248 /*!
249 * \brief Channel Event peeraccount
250 * Used by: AST_EVENT_CEL
251 * Payload type: STR
252 */
254 /*!
255 * \brief Channel Event extra data
256 * Used by: AST_EVENT_CEL
257 * Payload type: STR
258 */
260 /*!
261 * \brief Description
262 * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
263 * Payload type: STR
264 */
266 /*!
267 * \brief Entity ID
268 * Used by All events
269 * Payload type: RAW
270 * This IE indicates which server the event originated from
271 */
300
301 /*!
302 * \brief Event non-cacheability flag
303 * Used by: All events
304 * Payload type: UINT
305 */
307
308 /*!
309 * \brief Cluster node ID
310 * Used by: Corosync
311 * Payload type: UINT
312 */
314 /*! \brief Must be the last IE value +1 */
316};
317
318/*!
319 * \brief Payload types for event information elements
320 */
323 /*! Just check if it exists, not the value */
325 /*! Unsigned Integer (Can be used for signed, too ...) */
327 /*! String */
329 /*! Raw data, compared with memcmp */
331 /*! Bit flags (unsigned integer, compared using boolean logic) */
333};
334
335/*! \brief Results for checking for subscribers */
337 /*! No subscribers exist */
339 /*! At least one subscriber exists */
341};
342
343struct ast_event;
344struct ast_event_ie;
345struct ast_event_iterator;
346
347/*!
348 * \brief supposed to be an opaque type
349 *
350 * This is only here so that it can be declared on the stack.
351 */
353 uint16_t event_len;
354 const struct ast_event *event;
356};
357
358#endif /* AST_EVENT_DEFS_H */
ast_event_ie_type
Event Information Element types.
Definition: event_defs.h:68
@ AST_EVENT_IE_CEL_ACCTCODE
Channel Event AccountCode Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:205
@ AST_EVENT_IE_EVENT_VERSION
Definition: event_defs.h:274
@ AST_EVENT_IE_END
Definition: event_defs.h:70
@ AST_EVENT_IE_CEL_EXTRA
Channel Event extra data Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:259
@ AST_EVENT_IE_CEL_CONTEXT
Channel Event context name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:175
@ AST_EVENT_IE_CEL_PEERACCT
Channel Event peeraccount Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:253
@ AST_EVENT_IE_REMOTE_ADDR
Definition: event_defs.h:282
@ AST_EVENT_IE_STATE
Generic State IE Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: UINT The actual state values dep...
Definition: event_defs.h:121
@ AST_EVENT_IE_ATTEMPTED_TRANSPORT
Definition: event_defs.h:295
@ AST_EVENT_IE_MODULE
Definition: event_defs.h:276
@ AST_EVENT_IE_CONTEXT
Context IE Used by AST_EVENT_MWI Payload type: str.
Definition: event_defs.h:127
@ AST_EVENT_IE_CEL_CIDRDNIS
Channel Event CID RDNIS field Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:229
@ AST_EVENT_IE_CEL_EVENT_TIME
Channel Event Time (seconds) Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:139
@ AST_EVENT_IE_EVENT_TV
Definition: event_defs.h:283
@ AST_EVENT_IE_ACCOUNT_ID
Definition: event_defs.h:277
@ AST_EVENT_IE_SESSION_ID
Definition: event_defs.h:278
@ AST_EVENT_IE_UNIQUEID
Unique ID Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.
Definition: event_defs.h:95
@ AST_EVENT_IE_SECURITY_EVENT
Definition: event_defs.h:273
@ AST_EVENT_IE_CHALLENGE
Definition: event_defs.h:289
@ AST_EVENT_IE_CEL_CHANNAME
Channel Event channel name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:181
@ AST_EVENT_IE_PRESENCE_STATE
Definition: event_defs.h:297
@ AST_EVENT_IE_LOCAL_ADDR
Definition: event_defs.h:281
@ AST_EVENT_IE_RECEIVED_HASH
Definition: event_defs.h:293
@ AST_EVENT_IE_CEL_CIDANI
Channel Event CID ANI field Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:223
@ AST_EVENT_IE_PRESENCE_MESSAGE
Definition: event_defs.h:299
@ AST_EVENT_IE_DEVICE
Device Name Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: STR.
Definition: event_defs.h:113
@ AST_EVENT_IE_CEL_CIDDNID
Channel Event CID dnid Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:235
@ AST_EVENT_IE_ACL_NAME
Definition: event_defs.h:280
@ AST_EVENT_IE_AUTH_METHOD
Definition: event_defs.h:286
@ AST_EVENT_IE_TOTAL
Must be the last IE value +1.
Definition: event_defs.h:315
@ AST_EVENT_IE_PRESENCE_SUBTYPE
Definition: event_defs.h:298
@ AST_EVENT_IE_PRESENCE_PROVIDER
Definition: event_defs.h:296
@ AST_EVENT_IE_CEL_EXTEN
Channel Event extension name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:169
@ AST_EVENT_IE_EID
Entity ID Used by All events Payload type: RAW This IE indicates which server the event originated fr...
Definition: event_defs.h:272
@ AST_EVENT_IE_CEL_CIDNAME
Channel Event CID name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:157
@ AST_EVENT_IE_SEVERITY
Definition: event_defs.h:287
@ AST_EVENT_IE_CEL_AMAFLAGS
Channel Event AMA flags Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:199
@ AST_EVENT_IE_CEL_USEREVENT_NAME
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:151
@ AST_EVENT_IE_CEL_LINKEDID
Channel Event LinkedID Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:247
@ AST_EVENT_IE_CEL_EVENT_TIME_USEC
Channel Event Time (micro-seconds) Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:145
@ AST_EVENT_IE_MAILBOX
Mailbox name.
Definition: event_defs.h:89
@ AST_EVENT_IE_CEL_EVENT_TYPE
Channel Event Type Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:133
@ AST_EVENT_IE_EXISTS
Hint that someone cares that an IE exists Used by: AST_EVENT_SUB Payload type: UINT (ast_event_ie_typ...
Definition: event_defs.h:107
@ AST_EVENT_IE_RECEIVED_CHALLENGE
Definition: event_defs.h:292
@ AST_EVENT_IE_REQUEST_TYPE
Definition: event_defs.h:284
@ AST_EVENT_IE_EXPECTED_RESPONSE
Definition: event_defs.h:291
@ AST_EVENT_IE_CEL_UNIQUEID
Channel Event UniqueID Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:211
@ AST_EVENT_IE_CACHABLE
Event non-cacheability flag Used by: All events Payload type: UINT.
Definition: event_defs.h:306
@ AST_EVENT_IE_EXPECTED_ADDR
Definition: event_defs.h:288
@ AST_EVENT_IE_USING_PASSWORD
Definition: event_defs.h:294
@ AST_EVENT_IE_EVENTTYPE
Event type Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.
Definition: event_defs.h:101
@ AST_EVENT_IE_RESPONSE
Definition: event_defs.h:290
@ AST_EVENT_IE_CEL_APPNAME
Channel Event app name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:187
@ AST_EVENT_IE_NODE_ID
Cluster node ID Used by: Corosync Payload type: UINT.
Definition: event_defs.h:313
@ AST_EVENT_IE_CEL_APPDATA
Channel Event app args/data Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:193
@ AST_EVENT_IE_DESCRIPTION
Description Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: STR.
Definition: event_defs.h:265
@ AST_EVENT_IE_SESSION_TV
Definition: event_defs.h:279
@ AST_EVENT_IE_OLDMSGS
Number of Used by: AST_EVENT_MWI Payload type: UINT.
Definition: event_defs.h:83
@ AST_EVENT_IE_REQUEST_PARAMS
Definition: event_defs.h:285
@ AST_EVENT_IE_CEL_PEER
Channel Event Peer – for Things involving multiple channels, like BRIDGE Used by: AST_EVENT_CEL Paylo...
Definition: event_defs.h:241
@ AST_EVENT_IE_CEL_CIDNUM
Channel Event CID num Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:163
@ AST_EVENT_IE_SERVICE
Definition: event_defs.h:275
@ AST_EVENT_IE_CEL_USERFIELD
Channel Event Userfield Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:217
@ AST_EVENT_IE_NEWMSGS
Number of new messages Used by: AST_EVENT_MWI Payload type: UINT.
Definition: event_defs.h:77
ast_event_type
Definition: event_defs.h:28
@ AST_EVENT_TOTAL
Definition: event_defs.h:64
@ AST_EVENT_ACL_CHANGE
Definition: event_defs.h:58
@ AST_EVENT_UNSUB
Definition: event_defs.h:42
@ AST_EVENT_PING
Definition: event_defs.h:60
@ AST_EVENT_DEVICE_STATE_CHANGE
Definition: event_defs.h:48
@ AST_EVENT_DEVICE_STATE
Definition: event_defs.h:45
@ AST_EVENT_CEL
Definition: event_defs.h:50
@ AST_EVENT_MWI
Definition: event_defs.h:38
@ AST_EVENT_ALL
Definition: event_defs.h:31
@ AST_EVENT_CLUSTER_DISCOVERY
Definition: event_defs.h:62
@ AST_EVENT_CUSTOM
Definition: event_defs.h:36
@ AST_EVENT_NETWORK_CHANGE
Definition: event_defs.h:54
@ AST_EVENT_PRESENCE_STATE
Definition: event_defs.h:56
@ AST_EVENT_SUB
Definition: event_defs.h:40
@ AST_EVENT_SECURITY
Definition: event_defs.h:52
ast_event_ie_pltype
Payload types for event information elements.
Definition: event_defs.h:321
@ AST_EVENT_IE_PLTYPE_RAW
Definition: event_defs.h:330
@ AST_EVENT_IE_PLTYPE_UINT
Definition: event_defs.h:326
@ AST_EVENT_IE_PLTYPE_BITFLAGS
Definition: event_defs.h:332
@ AST_EVENT_IE_PLTYPE_EXISTS
Definition: event_defs.h:324
@ AST_EVENT_IE_PLTYPE_STR
Definition: event_defs.h:328
@ AST_EVENT_IE_PLTYPE_UNKNOWN
Definition: event_defs.h:322
ast_event_subscriber_res
Results for checking for subscribers.
Definition: event_defs.h:336
@ AST_EVENT_SUB_EXISTS
Definition: event_defs.h:340
@ AST_EVENT_SUB_NONE
Definition: event_defs.h:338
An event information element.
Definition: event.c:53
supposed to be an opaque type
Definition: event_defs.h:352
const struct ast_event * event
Definition: event_defs.h:354
uint16_t event_len
Definition: event_defs.h:353
struct ast_event_ie * ie
Definition: event_defs.h:355
An event.
Definition: event.c:81