summaryrefslogtreecommitdiff
path: root/res/ari/ari_model_validators.h
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-05-30 12:42:57 +0000
committerMatthew Jordan <mjordan@digium.com>2014-05-30 12:42:57 +0000
commit53968c00b34a913e0467200b95add483f79dd3b6 (patch)
tree3e04113a3c4eda1884205df78e9527b2c72cee6a /res/ari/ari_model_validators.h
parente9f09ab2bce1e1aa1b619507b45d228bbc49f12c (diff)
TALK_DETECT: A channel function that raises events when talking is detected
This patch adds a new channel function TALK_DETECT that, when set on a channel, causes events indicating the start/stop of talking on a channel to be emitted to both AMI and ARI clients. The function allows setting both the silence threshold (the length of silence after which we decide no one is talking) as well as the talking threshold (the amount of energy that counts as talking). Parameters can be updated on a channel after talk detection has been enabled, and talk detection can be removed at any time. The events raised by the function use a nomenclature similar to existing AMI/ARI events. For AMI: ChannelTalkingStart/ChannelTalkingStop For ARI: ChannelTalkingStarted/ChannelTalkingFinished Review: https://reviewboard.asterisk.org/r/3563/ #ASTERISK-23786 #close Reported by: Matt Jordan ........ Merged revisions 414934 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/ari/ari_model_validators.h')
-rw-r--r--res/ari/ari_model_validators.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/res/ari/ari_model_validators.h b/res/ari/ari_model_validators.h
index a4512a1c7..c85115634 100644
--- a/res/ari/ari_model_validators.h
+++ b/res/ari/ari_model_validators.h
@@ -791,6 +791,42 @@ int ast_ari_validate_channel_state_change(struct ast_json *json);
ari_validator ast_ari_validate_channel_state_change_fn(void);
/*!
+ * \brief Validator for ChannelTalkingFinished.
+ *
+ * Talking is no longer detected on the channel.
+ *
+ * \param json JSON object to validate.
+ * \returns True (non-zero) if valid.
+ * \returns False (zero) if invalid.
+ */
+int ast_ari_validate_channel_talking_finished(struct ast_json *json);
+
+/*!
+ * \brief Function pointer to ast_ari_validate_channel_talking_finished().
+ *
+ * See \ref ast_ari_model_validators.h for more details.
+ */
+ari_validator ast_ari_validate_channel_talking_finished_fn(void);
+
+/*!
+ * \brief Validator for ChannelTalkingStarted.
+ *
+ * Talking was detected on the channel.
+ *
+ * \param json JSON object to validate.
+ * \returns True (non-zero) if valid.
+ * \returns False (zero) if invalid.
+ */
+int ast_ari_validate_channel_talking_started(struct ast_json *json);
+
+/*!
+ * \brief Function pointer to ast_ari_validate_channel_talking_started().
+ *
+ * See \ref ast_ari_model_validators.h for more details.
+ */
+ari_validator ast_ari_validate_channel_talking_started_fn(void);
+
+/*!
* \brief Validator for ChannelUserevent.
*
* User-generated event with additional user-defined fields in the object.
@@ -1274,6 +1310,17 @@ ari_validator ast_ari_validate_application_fn(void);
* - application: string (required)
* - timestamp: Date
* - channel: Channel (required)
+ * ChannelTalkingFinished
+ * - type: string (required)
+ * - application: string (required)
+ * - timestamp: Date
+ * - channel: Channel (required)
+ * - duration: int (required)
+ * ChannelTalkingStarted
+ * - type: string (required)
+ * - application: string (required)
+ * - timestamp: Date
+ * - channel: Channel (required)
* ChannelUserevent
* - type: string (required)
* - application: string (required)