aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/devicestate.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/asterisk/devicestate.h b/include/asterisk/devicestate.h
index 3c7f5b40e..d93d6d996 100644
--- a/include/asterisk/devicestate.h
+++ b/include/asterisk/devicestate.h
@@ -44,8 +44,12 @@ extern "C" {
/*! Device is ringing *and* in use */
#define AST_DEVICE_RINGINUSE 7
+/*! \brief Devicestate watcher call back */
typedef int (*ast_devstate_cb_type)(const char *dev, int state, void *data);
+/*! \brief Devicestate provider call back */
+typedef int (*ast_devstate_prov_cb_type)(const char *data);
+
/*! \brief Convert device state to text string for output
* \param devstate Current device state
*/
@@ -95,8 +99,28 @@ int ast_device_state_changed_literal(const char *device);
* Return -1 on failure, ID on success
*/
int ast_devstate_add(ast_devstate_cb_type callback, void *data);
+
+/*! \brief Unregisters a device state change callback
+ * \param callback Callback
+ * \param data to pass to callback
+ * The callback is called if the state for extension is changed
+ * Return -1 on failure, ID on success
+ */
void ast_devstate_del(ast_devstate_cb_type callback, void *data);
+/*! \brief Add device state provider
+ * \param label to use in hint, like label:object
+ * \param callback Callback
+ * Return -1 on failure, ID on success
+ */
+int ast_devstate_prov_add(const char *label, ast_devstate_prov_cb_type callback);
+
+/*! \brief Remove device state provider
+ * \param label to use in hint, like label:object
+ * Return -1 on failure, ID on success
+ */
+void ast_devstate_prov_del(const char *label);
+
int ast_device_state_engine_init(void);
#if defined(__cplusplus) || defined(c_plusplus)