Wed Jan 8 2020 09:49:47

Asterisk developer's documentation


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 
28 /*! \brief Event types
29  * \note These values can *never* change. */
31  /*! Reserved to provide the ability to subscribe to all events. A specific
32  * event should never have a payload of 0. */
33  AST_EVENT_ALL = 0x00,
34  /*! This event type is reserved for use by third-party modules to create
35  * custom events without having to modify this file.
36  * \note There are no "custom" IE types, because IEs only have to be
37  * unique to the event itself, not necessarily across all events. */
39  /*! Voicemail message waiting indication */
40  AST_EVENT_MWI = 0x02,
41  /*! Someone has subscribed to events */
42  AST_EVENT_SUB = 0x03,
43  /*! Someone has unsubscribed from events */
45  /*! The aggregate state of a device across all servers configured to be
46  * a part of a device state cluster has changed. */
48  /*! The state of a device has changed on _one_ server. This should not be used
49  * directly, in general. Use AST_EVENT_DEVICE_STATE instead. */
51  /*! Channel Event Logging events */
52  AST_EVENT_CEL = 0x07,
53  /*! A report of a security related event (see security_events.h) */
55  /*! Used by res_stun_monitor to alert listeners to an exernal network address change. */
57  /*! Number of event types. This should be the last event type + 1 */
59 };
60 
61 /*! \brief Event Information Element types */
63  /*! Used to terminate the arguments to event functions */
65 
66  /*!
67  * \brief Number of new messages
68  * Used by: AST_EVENT_MWI
69  * Payload type: UINT
70  */
72  /*!
73  * \brief Number of
74  * Used by: AST_EVENT_MWI
75  * Payload type: UINT
76  */
78  /*!
79  * \brief Mailbox name \verbatim (mailbox[@context]) \endverbatim
80  * Used by: AST_EVENT_MWI
81  * Payload type: STR
82  */
84  /*!
85  * \brief Unique ID
86  * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
87  * Payload type: UINT
88  */
90  /*!
91  * \brief Event type
92  * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
93  * Payload type: UINT
94  */
96  /*!
97  * \brief Hint that someone cares that an IE exists
98  * Used by: AST_EVENT_SUB
99  * Payload type: UINT (ast_event_ie_type)
100  */
102  /*!
103  * \brief Device Name
104  * Used by AST_EVENT_DEVICE_STATE_CHANGE
105  * Payload type: STR
106  */
108  /*!
109  * \brief Generic State IE
110  * Used by AST_EVENT_DEVICE_STATE_CHANGE
111  * Payload type: UINT
112  * The actual state values depend on the event which
113  * this IE is a part of.
114  */
116  /*!
117  * \brief Context IE
118  * Used by AST_EVENT_MWI
119  * Payload type: str
120  */
122  /*!
123  * \brief Channel Event Type
124  * Used by: AST_EVENT_CEL
125  * Payload type: UINT
126  */
128  /*!
129  * \brief Channel Event Time (seconds)
130  * Used by: AST_EVENT_CEL
131  * Payload type: UINT
132  */
134  /*!
135  * \brief Channel Event Time (micro-seconds)
136  * Used by: AST_EVENT_CEL
137  * Payload type: UINT
138  */
140  /*!
141  * \brief Channel Event User Event Name
142  * Used by: AST_EVENT_CEL
143  * Payload type: STR
144  */
146  /*!
147  * \brief Channel Event CID name
148  * Used by: AST_EVENT_CEL
149  * Payload type: STR
150  */
152  /*!
153  * \brief Channel Event CID num
154  * Used by: AST_EVENT_CEL
155  * Payload type: STR
156  */
158  /*!
159  * \brief Channel Event extension name
160  * Used by: AST_EVENT_CEL
161  * Payload type: STR
162  */
164  /*!
165  * \brief Channel Event context name
166  * Used by: AST_EVENT_CEL
167  * Payload type: STR
168  */
170  /*!
171  * \brief Channel Event channel name
172  * Used by: AST_EVENT_CEL
173  * Payload type: STR
174  */
176  /*!
177  * \brief Channel Event app name
178  * Used by: AST_EVENT_CEL
179  * Payload type: STR
180  */
182  /*!
183  * \brief Channel Event app args/data
184  * Used by: AST_EVENT_CEL
185  * Payload type: STR
186  */
188  /*!
189  * \brief Channel Event AMA flags
190  * Used by: AST_EVENT_CEL
191  * Payload type: UINT
192  */
194  /*!
195  * \brief Channel Event AccountCode
196  * Used by: AST_EVENT_CEL
197  * Payload type: STR
198  */
200  /*!
201  * \brief Channel Event UniqueID
202  * Used by: AST_EVENT_CEL
203  * Payload type: STR
204  */
206  /*!
207  * \brief Channel Event Userfield
208  * Used by: AST_EVENT_CEL
209  * Payload type: STR
210  */
212  /*!
213  * \brief Channel Event CID ANI field
214  * Used by: AST_EVENT_CEL
215  * Payload type: STR
216  */
218  /*!
219  * \brief Channel Event CID RDNIS field
220  * Used by: AST_EVENT_CEL
221  * Payload type: STR
222  */
224  /*!
225  * \brief Channel Event CID dnid
226  * Used by: AST_EVENT_CEL
227  * Payload type: STR
228  */
230  /*!
231  * \brief Channel Event Peer -- for Things involving multiple channels, like BRIDGE
232  * Used by: AST_EVENT_CEL
233  * Payload type: STR
234  */
236  /*!
237  * \brief Channel Event LinkedID
238  * Used by: AST_EVENT_CEL
239  * Payload type: STR
240  */
242  /*!
243  * \brief Channel Event peeraccount
244  * Used by: AST_EVENT_CEL
245  * Payload type: STR
246  */
248  /*!
249  * \brief Channel Event extra data
250  * Used by: AST_EVENT_CEL
251  * Payload type: STR
252  */
254  /*!
255  * \brief Description
256  * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
257  * Payload type: STR
258  */
260  /*!
261  * \brief Entity ID
262  * Used by All events
263  * Payload type: RAW
264  * This IE indicates which server the event originated from
265  */
286  /*!
287  * \brief Event non-cachability flag
288  * Used by: All events
289  * Payload type: UINT
290  */
292  /*! \brief Must be the last IE value +1 */
294 };
295 
296 /*!
297  * \brief Payload types for event information elements
298  */
301  /*! Just check if it exists, not the value */
303  /*! Unsigned Integer (Can be used for signed, too ...) */
305  /*! String */
307  /*! Raw data, compared with memcmp */
309  /*! Bit flags (unsigned integer, compared using boolean logic) */
311 };
312 
313 /*!
314  * \brief Results for checking for subscribers
315  *
316  * \ref ast_event_check_subscriber()
317  */
319  /*! No subscribers exist */
321  /*! At least one subscriber exists */
323 };
324 
325 struct ast_event;
326 struct ast_event_ie;
327 struct ast_event_sub;
328 struct ast_event_iterator;
329 
330 /*!
331  * \brief supposed to be an opaque type
332  *
333  * This is only here so that it can be declared on the stack.
334  */
336  uint16_t event_len;
337  const struct ast_event *event;
338  struct ast_event_ie *ie;
339 };
340 
341 #endif /* AST_EVENT_DEFS_H */
Channel Event CID name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:151
Channel Event app name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:181
An event.
Definition: event.c:85
struct ast_event_ie * ie
Definition: event_defs.h:338
Channel Event extra data Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:253
ast_event_ie_pltype
Payload types for event information elements.
Definition: event_defs.h:299
Must be the last IE value +1.
Definition: event_defs.h:293
Channel Event channel name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:175
Hint that someone cares that an IE exists Used by: AST_EVENT_SUB Payload type: UINT (ast_event_ie_typ...
Definition: event_defs.h:101
Channel Event UniqueID Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:205
Channel Event context name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:169
ast_event_subscriber_res
Results for checking for subscribers.
Definition: event_defs.h:318
Channel Event app args/data Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:187
Channel Event peeraccount Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:247
Channel Event Time (micro-seconds) Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:139
Channel Event CID dnid Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:229
Description Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: STR.
Definition: event_defs.h:259
Number of new messages Used by: AST_EVENT_MWI Payload type: UINT.
Definition: event_defs.h:71
Number of Used by: AST_EVENT_MWI Payload type: UINT.
Definition: event_defs.h:77
supposed to be an opaque type
Definition: event_defs.h:335
Channel Event Type Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:127
Entity ID Used by All events Payload type: RAW This IE indicates which server the event originated fr...
Definition: event_defs.h:266
Channel Event Time (seconds) Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:133
Channel Event CID num Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:157
Channel Event extension name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:163
ast_event_ie_type
Event Information Element types.
Definition: event_defs.h:62
ast_event_type
Event types.
Definition: event_defs.h:30
Context IE Used by AST_EVENT_MWI Payload type: str.
Definition: event_defs.h:121
An event information element.
Definition: event.c:57
Channel Event Userfield Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:211
Channel Event CID RDNIS field Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:223
Event non-cachability flag Used by: All events Payload type: UINT.
Definition: event_defs.h:291
Event type Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.
Definition: event_defs.h:95
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:145
Event subscription.
Definition: event.c:124
Channel Event Peer – for Things involving multiple channels, like BRIDGE Used by: AST_EVENT_CEL Paylo...
Definition: event_defs.h:235
Channel Event CID ANI field Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:217
Channel Event AMA flags Used by: AST_EVENT_CEL Payload type: UINT.
Definition: event_defs.h:193
uint16_t event_len
Definition: event_defs.h:336
Channel Event LinkedID Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:241
struct ast_event * event
Definition: event_defs.h:337
Unique ID Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.
Definition: event_defs.h:89
Generic State IE Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: UINT The actual state values dep...
Definition: event_defs.h:115
Device Name Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: STR.
Definition: event_defs.h:107
Channel Event AccountCode Used by: AST_EVENT_CEL Payload type: STR.
Definition: event_defs.h:199
Mailbox name.
Definition: event_defs.h:83