2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 2007, Digium, Inc.
6 * Russell Bryant <russell@digium.com>
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.
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.
21 * \author Russell Bryant <russell@digium.com>
22 * \brief Generic event system
25 #ifndef AST_EVENT_DEFS_H
26 #define AST_EVENT_DEFS_H
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. */
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. */
38 AST_EVENT_CUSTOM = 0x01,
39 /*! Voicemail message waiting indication */
41 /*! Someone has subscribed to events */
43 /*! Someone has unsubscribed from events */
44 AST_EVENT_UNSUB = 0x04,
45 /*! The state of a device has changed */
46 AST_EVENT_DEVICE_STATE = 0x05,
47 /*! Number of event types. This should be the last event type + 1 */
48 AST_EVENT_TOTAL = 0x06,
51 /*! \brief Event Information Element types */
52 enum ast_event_ie_type {
53 /*! Used to terminate the arguments to event functions */
54 AST_EVENT_IE_END = -1,
57 * \brief Number of new messages
58 * Used by: AST_EVENT_MWI
61 AST_EVENT_IE_NEWMSGS = 0x01,
64 * Used by: AST_EVENT_MWI
67 AST_EVENT_IE_OLDMSGS = 0x02,
69 * \brief Mailbox name \verbatim (mailbox[@context]) \endverbatim
70 * Used by: AST_EVENT_MWI
73 AST_EVENT_IE_MAILBOX = 0x03,
76 * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
79 AST_EVENT_IE_UNIQUEID = 0x04,
82 * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
85 AST_EVENT_IE_EVENTTYPE = 0x05,
87 * \brief Hint that someone cares that an IE exists
88 * Used by: AST_EVENT_SUB
89 * Payload type: UINT (ast_event_ie_type)
91 AST_EVENT_IE_EXISTS = 0x06,
94 * Used by AST_EVENT_DEVICE_STATE
97 AST_EVENT_IE_DEVICE = 0x07,
99 * \brief Generic State IE
100 * Used by AST_EVENT_DEVICE_STATE
102 * The actual state values depend on the event which
103 * this IE is a part of.
105 AST_EVENT_IE_STATE = 0x08,
108 * Used by AST_EVENT_MWI
111 AST_EVENT_IE_CONTEXT = 0x09,
115 * \brief Payload types for event information elements
117 enum ast_event_ie_pltype {
118 /*! Just check if it exists, not the value */
119 AST_EVENT_IE_PLTYPE_EXISTS,
120 /*! Unsigned Integer (Can be used for signed, too ...) */
121 AST_EVENT_IE_PLTYPE_UINT,
123 AST_EVENT_IE_PLTYPE_STR,
127 * \brief Results for checking for subscribers
129 * \ref ast_event_check_subscriber()
131 enum ast_event_subscriber_res {
132 /*! No subscribers exist */
134 /*! At least one subscriber exists */
135 AST_EVENT_SUB_EXISTS,
140 struct ast_event_sub;
142 #endif /* AST_EVENT_DEFS_H */