summaryrefslogtreecommitdiff
path: root/include/asterisk/stasis_app_recording.h
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-08-30 13:28:50 +0000
committerDavid M. Lee <dlee@digium.com>2013-08-30 13:28:50 +0000
commit7f547872e41ee53ad85a5b0820a8c0ff7c7f1c04 (patch)
treea86c66df9f37f9de9ffc4f3db3c19de51cb4046a /include/asterisk/stasis_app_recording.h
parent51cd0ea28b143d6b686831b101e76a942fbbcd90 (diff)
ARI: Implement /recordings/stored API's
his patch implements the ARI API's for stored recordings. While the original task only specified deleting a recording, it was simple enough to implement the GET for all recordings, and for an individual recording. The recording playback operation was modified to use the same code for accessing the recording as the REST API, so that they will behave consistently. There were several problems with the api-docs that were also fixed, bringing the ARI spec in line with the implementation. There were some 'wishful thinking' fields on the stored recording model (duration and timestamp) that were removed, because I ended up not implementing a metadata file to go along with the recording to store such information. The GET /recordings/live operation was removed, since it's not really that useful to get a list of all recordings that are currently going on in the system. (At least, if we did that, we'd probably want to also list all of the current playbacks. Which seems weird.) (closes issue ASTERISK-21582) Review: https://reviewboard.asterisk.org/r/2693/ ........ Merged revisions 397985 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/stasis_app_recording.h')
-rw-r--r--include/asterisk/stasis_app_recording.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/asterisk/stasis_app_recording.h b/include/asterisk/stasis_app_recording.h
index e8b4558ab..aa9047054 100644
--- a/include/asterisk/stasis_app_recording.h
+++ b/include/asterisk/stasis_app_recording.h
@@ -31,6 +31,68 @@
#include "asterisk/app.h"
#include "asterisk/stasis_app.h"
+/*! @{ */
+
+/*! \brief Structure representing a recording stored on disk */
+struct stasis_app_stored_recording;
+
+/*!
+ * \brief Returns the filename for this recording, for use with streamfile.
+ *
+ * The returned string will be valid until the \a recording object is freed.
+ *
+ * \param recording Recording to query.
+ * \return Absolute path to the recording file, without the extension.
+ * \return \c NULL on error.
+ */
+const char *stasis_app_stored_recording_get_file(
+ struct stasis_app_stored_recording *recording);
+
+/*!
+ * \brief Convert stored recording info to JSON.
+ *
+ * \param recording Recording to convert.
+ * \return JSON representation.
+ * \return \c NULL on error.
+ */
+struct ast_json *stasis_app_stored_recording_to_json(
+ struct stasis_app_stored_recording *recording);
+
+/*!
+ * \brief Find all stored recordings on disk.
+ *
+ * \return Container of \ref stasis_app_stored_recording objects.
+ * \return \c NULL on error.
+ */
+struct ao2_container *stasis_app_stored_recording_find_all(void);
+
+/*!
+ * \brief Creates a stored recording object, with the given name.
+ *
+ * \param name Name of the recording.
+ * \return New recording object.
+ * \return \c NULL if recording is not found. \c errno is set to indicate why
+ * - \c ENOMEM - out of memeory
+ * - \c EACCES - file permissions (or recording is outside the config dir)
+ * - Any of the error codes for stat(), opendir(), readdir()
+ */
+struct stasis_app_stored_recording *stasis_app_stored_recording_find_by_name(
+ const char *name);
+
+/*!
+ * \brief Delete a recording from disk.
+ *
+ * \param recording Recording to delete.
+ * \return 0 on success.
+ * \return Non-zero on error.
+ */
+int stasis_app_stored_recording_delete(
+ struct stasis_app_stored_recording *recording);
+
+/*! @} */
+
+/*! @{ */
+
/*! Opaque struct for handling the recording of media to a file. */
struct stasis_app_recording;
@@ -216,4 +278,6 @@ enum stasis_app_recording_oper_results stasis_app_recording_operation(
*/
struct stasis_message_type *stasis_app_recording_snapshot_type(void);
+/*! @} */
+
#endif /* _ASTERISK_STASIS_APP_RECORDING_H */