diff options
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/channel.h | 6 | ||||
-rw-r--r-- | include/asterisk/devicestate.h | 16 | ||||
-rw-r--r-- | include/asterisk/event_defs.h | 8 |
3 files changed, 26 insertions, 4 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 0157d761e..9b408660b 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -903,6 +903,12 @@ enum { * some non-traditional dialplans (like AGI) to continue to function. */ AST_FLAG_DISABLE_WORKAROUNDS = (1 << 20), + /*! Disable device state event caching. This allows allows channel + * drivers to selectively prevent device state events from being cached + * by certain channels such as anonymous calls which have no persistent + * represenatation that can be tracked. + */ + AST_FLAG_DISABLE_DEVSTATE_CACHE = (1 << 21), }; /*! \brief ast_bridge_config flags */ diff --git a/include/asterisk/devicestate.h b/include/asterisk/devicestate.h index 66ca2bd1a..86740bc2f 100644 --- a/include/asterisk/devicestate.h +++ b/include/asterisk/devicestate.h @@ -61,6 +61,14 @@ enum ast_device_state { AST_DEVICE_TOTAL, /*/ Total num of device states, used for testing */ }; +/*! \brief Device State Cachability + * \note This is used to define the cachability of a device state when set. + */ +enum ast_devstate_cache { + AST_DEVSTATE_NOT_CACHABLE, /*!< This device state is not cachable */ + AST_DEVSTATE_CACHABLE, /*!< This device state is cachable */ +}; + /*! \brief Devicestate provider call back */ typedef enum ast_device_state (*ast_devstate_prov_cb_type)(const char *data); @@ -129,6 +137,7 @@ enum ast_device_state ast_device_state(const char *device); * \brief Tells Asterisk the State for Device is changed * * \param state the new state of the device + * \param cachable whether this device state is cachable * \param fmt device name like a dial string with format parameters * * The new state of the device will be sent off to any subscribers @@ -138,13 +147,14 @@ enum ast_device_state ast_device_state(const char *device); * \retval 0 on success * \retval -1 on failure */ -int ast_devstate_changed(enum ast_device_state state, const char *fmt, ...) - __attribute__((format(printf, 2, 3))); +int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cachable, const char *fmt, ...) + __attribute__((format(printf, 3, 4))); /*! * \brief Tells Asterisk the State for Device is changed * * \param state the new state of the device + * \param cachable whether this device state is cachable * \param device device name like a dial string with format parameters * * The new state of the device will be sent off to any subscribers @@ -154,7 +164,7 @@ int ast_devstate_changed(enum ast_device_state state, const char *fmt, ...) * \retval 0 on success * \retval -1 on failure */ -int ast_devstate_changed_literal(enum ast_device_state state, const char *device); +int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cachable, const char *device); /*! * \brief Tells Asterisk the State for Device is changed. diff --git a/include/asterisk/event_defs.h b/include/asterisk/event_defs.h index d3514f59c..10c76d0da 100644 --- a/include/asterisk/event_defs.h +++ b/include/asterisk/event_defs.h @@ -298,8 +298,14 @@ enum ast_event_ie_type { AST_EVENT_IE_PRESENCE_SUBTYPE = 0x003b, AST_EVENT_IE_PRESENCE_MESSAGE = 0x003c, + /*! + * \brief Event non-cachability flag + * Used by: All events + * Payload type: UINT + */ + AST_EVENT_IE_CACHABLE = 0x003d, /*! \brief Must be the last IE value +1 */ - AST_EVENT_IE_TOTAL = 0x003d, + AST_EVENT_IE_TOTAL = 0x003e, }; /*! |