summaryrefslogtreecommitdiff
path: root/include/asterisk/stasis_channels.h
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-05-23 20:11:35 +0000
committerDavid M. Lee <dlee@digium.com>2013-05-23 20:11:35 +0000
commit10ba6bf8a8114278ca974861ecebcb3a827d8d5b (patch)
tree1406ede124cf9665cb9f9244f9339b6cb522aa8b /include/asterisk/stasis_channels.h
parent3464e0919afe398717b93b20fff37560c6d4478f (diff)
This patch implements the REST API's for POST /channels/{channelId}/play
and GET /playback/{playbackId}. This allows an external application to initiate playback of a sound on a channel while the channel is in the Stasis application. /play commands are issued asynchronously, and return immediately with the URL of the associated /playback resource. Playback commands queue up, playing in succession. The /playback resource shows the state of a playback operation as enqueued, playing or complete. (Although the operation will only be in the 'complete' state for a very short time, since it is almost immediately freed up). (closes issue ASTERISK-21283) (closes issue ASTERISK-21586) Review: https://reviewboard.asterisk.org/r/2531/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/stasis_channels.h')
-rw-r--r--include/asterisk/stasis_channels.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/asterisk/stasis_channels.h b/include/asterisk/stasis_channels.h
index 5ead93d3a..dace99af5 100644
--- a/include/asterisk/stasis_channels.h
+++ b/include/asterisk/stasis_channels.h
@@ -54,6 +54,7 @@ struct ast_channel_snapshot {
AST_STRING_FIELD(caller_number); /*!< Caller ID Number */
AST_STRING_FIELD(connected_name); /*!< Connected Line Name */
AST_STRING_FIELD(connected_number); /*!< Connected Line Number */
+ AST_STRING_FIELD(language); /*!< The default spoken language for the channel */
);
struct timeval creationtime; /*!< The time of channel creation */
@@ -124,6 +125,17 @@ struct ast_channel_snapshot *ast_channel_snapshot_create(
/*!
* \since 12
+ * \brief Get the most recent snapshot for channel with the given \a uniqueid.
+ *
+ * \param uniqueid Uniqueid of the snapshot to fetch.
+ * \return Most recent channel snapshot
+ * \return \c NULL on error
+ */
+struct ast_channel_snapshot *ast_channel_snapshot_get_latest(
+ const char *uniqueid);
+
+/*!
+ * \since 12
* \brief Creates a \ref ast_channel_blob message.
*
* The given \a blob should be treated as immutable and not modified after it is
@@ -142,6 +154,23 @@ struct stasis_message *ast_channel_blob_create(struct ast_channel *chan,
/*!
* \since 12
+ * \brief Create a \ref ast_channel_blob message, pulling channel state from
+ * the cache.
+ *
+ * \param uniqueid Uniqueid of the channel.
+ * \param type Message type for this blob.
+ * \param blob JSON object representing the data, or \c NULL for no data. If
+ * \c NULL, ast_json_null() is put into the object.
+ *
+ * \return \ref ast_channel_blob message.
+ * \return \c NULL on error
+ */
+struct stasis_message *ast_channel_blob_create_from_cache(
+ const char *uniqueid, struct stasis_message_type *type,
+ struct ast_json *blob);
+
+/*!
+ * \since 12
* \brief Create a \ref ast_multi_channel_blob suitable for a \ref stasis_message.
*
* The given \a blob should be treated as immutable and not modified after it is
@@ -223,6 +252,14 @@ void ast_multi_channel_blob_add_channel(struct ast_multi_channel_blob *obj,
/*!
* \since 12
+ * \brief Publish a \ref ast_channel_snapshot for a channel.
+ *
+ * \param chan Channel to publish.
+ */
+void ast_channel_publish_snapshot(struct ast_channel *chan);
+
+/*!
+ * \since 12
* \brief Publish a \ref ast_channel_varset for a channel.
*
* \param chan Channel to pulish the event for, or \c NULL for 'none'.