mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	ARI: Add the ability to download the media associated with a stored recording
This patch adds a new feature to ARI that allows a client to download
the media associated with a stored recording. The new route is
/recordings/stored/{name}/file, and transmits the underlying binary file
using Asterisk's HTTP server's underlying file transfer facilities.
Because this REST route returns non-JSON, a few small enhancements had
to be made to the Python Swagger generation code, as well as the
mustache templates that generate the ARI bindings.
ASTERISK-26042 #close
Change-Id: I49ec5c4afdec30bb665d9c977ab423b5387e0181
			
			
This commit is contained in:
		@@ -95,6 +95,8 @@ struct ast_ari_response {
 | 
			
		||||
	/*! HTTP response code.
 | 
			
		||||
	 * See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html */
 | 
			
		||||
	int response_code;
 | 
			
		||||
	/*! File descriptor for whatever file we want to respond with */
 | 
			
		||||
	int fd;
 | 
			
		||||
	/*! Corresponding text for the response code */
 | 
			
		||||
	const char *response_text; /* Shouldn't http.c handle this? */
 | 
			
		||||
	/*! Flag to indicate that no further response is needed */
 | 
			
		||||
 
 | 
			
		||||
@@ -48,6 +48,30 @@ struct stasis_app_stored_recording;
 | 
			
		||||
const char *stasis_app_stored_recording_get_file(
 | 
			
		||||
	struct stasis_app_stored_recording *recording);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief Returns the full filename, with extension, for this recording.
 | 
			
		||||
 * \since 14.0.0
 | 
			
		||||
 *
 | 
			
		||||
 * \param recording Recording to query.
 | 
			
		||||
 *
 | 
			
		||||
 * \return Absolute path to the recording file, with the extension.
 | 
			
		||||
 * \return \c NULL on error
 | 
			
		||||
 */
 | 
			
		||||
const char *stasis_app_stored_recording_get_filename(
 | 
			
		||||
	struct stasis_app_stored_recording *recording);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief Returns the extension for this recording.
 | 
			
		||||
 * \since 14.0.0
 | 
			
		||||
 *
 | 
			
		||||
 * \param recording Recording to query.
 | 
			
		||||
 *
 | 
			
		||||
 * \return The extension associated with this recording.
 | 
			
		||||
 * \return \c NULL on error
 | 
			
		||||
 */
 | 
			
		||||
const char *stasis_app_stored_recording_get_extension(
 | 
			
		||||
	struct stasis_app_stored_recording *recording);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief Convert stored recording info to JSON.
 | 
			
		||||
 *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user