diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-06-01 23:34:43 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-06-01 23:34:43 +0000 |
commit | 605368649ef8280e3b52a45a80fd30562a767af3 (patch) | |
tree | ca2f21d45b7f24e39079d1aec0006a66cad40dec /include/asterisk/event_defs.h | |
parent | c9cf12b6758eba923746fc47e36b9684ac593944 (diff) |
Merge major changes to the way device state is passed around Asterisk. The two
places that cared about device states were app_queue and the hint code in pbx.c.
The changes include converting it to use the Asterisk event system, as well as
other efficiency improvements.
* app_queue: This module used to register a callback into devicestate.c to
monitor device state changes. Now, it is just a subscriber to Asterisk
events with the type, device state.
* pbx.c hints: Previously, the device state processing thread in devicestate.c
would call ast_hint_state_changed() each time the state of a device changed.
Then, that code would go looking for all the hints that monitor that device,
and call their callbacks. All of this blocked the device state processing
thread. Now, the hint code is a subscriber of Asterisk events with the
type, device state. Furthermore, when this code receives a device state
change event, it queues it up to be processed by another thread so that it
doesn't block one of the event processing threads.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/event_defs.h')
-rw-r--r-- | include/asterisk/event_defs.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/include/asterisk/event_defs.h b/include/asterisk/event_defs.h index b1e27c981..2627bae8d 100644 --- a/include/asterisk/event_defs.h +++ b/include/asterisk/event_defs.h @@ -37,13 +37,15 @@ enum ast_event_type { unique to the event itself, not necessarily across all events. */ AST_EVENT_CUSTOM = 0x01, /*! Voicemail message waiting indication */ - AST_EVENT_MWI = 0x02, + AST_EVENT_MWI = 0x02, /*! Someone has subscribed to events */ - AST_EVENT_SUB = 0x03, + AST_EVENT_SUB = 0x03, /*! Someone has unsubscribed from events */ - AST_EVENT_UNSUB = 0x04, + AST_EVENT_UNSUB = 0x04, + /*! The state of a device has changed */ + AST_EVENT_DEVICE_STATE = 0x05, /*! Number of event types. This should be the last event type + 1 */ - AST_EVENT_TOTAL = 0x05, + AST_EVENT_TOTAL = 0x06, }; /*! \brief Event Information Element types */ @@ -82,11 +84,25 @@ enum ast_event_ie_type { */ AST_EVENT_IE_EVENTTYPE = 0x05, /*! - * \brief Hint that someone cares than an IE exists + * \brief Hint that someone cares that an IE exists * Used by: AST_EVENT_SUB * Payload type: UINT (ast_event_ie_type) */ AST_EVENT_IE_EXISTS = 0x06, + /*! + * \brief Device Name + * Used by AST_EVENT_DEVICE_STATE + * Payload type: STR + */ + AST_EVENT_IE_DEVICE = 0x07, + /*! + * \brief Generic State IE + * Used by AST_EVENT_DEVICE_STATE + * Payload type: UINT + * The actual state values depend on the event which + * this IE is a part of. + */ + AST_EVENT_IE_STATE = 0x08, }; /*! |