diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-02 18:07:35 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-02 18:07:35 +0000 |
commit | a8507e2ab499ae6d68f749a507450edc6399686c (patch) | |
tree | b49ff9ae10ea6ec0a80f9aeb4f37a17e3160aed8 /include/asterisk | |
parent | ef9c5467d3171dd0a8c81b644617e39a09fa2000 (diff) |
Merged revisions 204710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r204710 | dvossel | 2009-07-02 11:03:44 -0500 (Thu, 02 Jul 2009) | 21 lines
Merged revisions 204681 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r204681 | dvossel | 2009-07-02 10:05:57 -0500 (Thu, 02 Jul 2009) | 14 lines
Improved mapping of extension states from combined device states.
This fixes a few issues with incorrect extension states and adds
a cli command, core show device2extenstate, to display all possible
state mappings.
(closes issue #15413)
Reported by: legart
Patches:
exten_helper.diff uploaded by dvossel (license 671)
Tested by: dvossel, legart, amilcar
Review: https://reviewboard.asterisk.org/r/301/
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@204754 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/devicestate.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/include/asterisk/devicestate.h b/include/asterisk/devicestate.h index 1b7cdd4c8..ed747bf5a 100644 --- a/include/asterisk/devicestate.h +++ b/include/asterisk/devicestate.h @@ -56,6 +56,7 @@ enum ast_device_state { AST_DEVICE_RINGING, /*!< Device is ringing */ AST_DEVICE_RINGINUSE, /*!< Device is ringing *and* in use */ AST_DEVICE_ONHOLD, /*!< Device is on hold */ + AST_DEVICE_TOTAL, /*/ Total num of device states, used for testing */ }; /*! \brief Devicestate provider call back */ @@ -175,6 +176,64 @@ int ast_device_state_changed(const char *fmt, ...) */ int ast_device_state_changed_literal(const char *device); +/*! + * \brief An object to hold state when calculating aggregate device state + */ +struct ast_devstate_aggregate; + +/*! + * \brief Initialize aggregate device state + * + * \param[in] agg the state object + * + * \return nothing + */ +void ast_devstate_aggregate_init(struct ast_devstate_aggregate *agg); + +/*! + * \brief Add a device state to the aggregate device state + * + * \param[in] agg the state object + * \param[in] state the state to add + * + * \return nothing + */ +void ast_devstate_aggregate_add(struct ast_devstate_aggregate *agg, enum ast_device_state state); + +/*! + * \brief Get the aggregate device state result + * + * \param[in] agg the state object + * + * \return the aggregate device state after adding some number of device states. + */ +enum ast_device_state ast_devstate_aggregate_result(struct ast_devstate_aggregate *agg); + +/*! + * \brief Map devstate to an extension state. + * + * \param[in] device state + * + * \return the extension state mapping. + */ +enum ast_extension_states ast_devstate_to_extenstate(enum ast_device_state devstate); + +/*! + * \brief You shouldn't care about the contents of this struct + * + * This struct is only here so that it can be easily declared on the stack. + */ +struct ast_devstate_aggregate { + unsigned int all_unavail:1; + unsigned int all_busy:1; + unsigned int all_free:1; + unsigned int all_unknown:1; + unsigned int on_hold:1; + unsigned int busy:1; + unsigned int in_use:1; + unsigned int ring:1; +}; + /*! * \brief Add device state provider * |