[asterisk-commits] dlee: branch dlee/stasis-http r379177 - in /team/dlee/stasis-http: cog/ inclu...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 15 21:14:00 CST 2013


Author: dlee
Date: Tue Jan 15 21:13:55 2013
New Revision: 379177

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379177
Log:
Includes docs in the generated headers

Modified:
    team/dlee/stasis-http/cog/stasis_cog.py
    team/dlee/stasis-http/include/asterisk/stasis_http_asterisk.h
    team/dlee/stasis-http/include/asterisk/stasis_http_bridges.h
    team/dlee/stasis-http/include/asterisk/stasis_http_channels.h
    team/dlee/stasis-http/include/asterisk/stasis_http_endpoints.h
    team/dlee/stasis-http/include/asterisk/stasis_http_recordings.h
    team/dlee/stasis-http/rest-api/asterisk.json
    team/dlee/stasis-http/rest-api/bridges.json
    team/dlee/stasis-http/rest-api/channels.json
    team/dlee/stasis-http/rest-api/endpoints.json
    team/dlee/stasis-http/rest-api/recordings.json

Modified: team/dlee/stasis-http/cog/stasis_cog.py
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/cog/stasis_cog.py?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/cog/stasis_cog.py (original)
+++ team/dlee/stasis-http/cog/stasis_cog.py Tue Jan 15 21:13:55 2013
@@ -29,7 +29,10 @@
 import os
 import os.path
 import re
+import textwrap
 from collections import OrderedDict
+
+SWAGGER_VERSION="1.1"
 
 class ResourceListingSourceWriter(object):
     """Writes the resources.c file from Swagger API docs.
@@ -143,6 +146,8 @@
 	for operation in resource.operations.itervalues():
 	    cog.outl('%s {' % operation.get_args_name())
 	    for param in operation.get_all_parameters().itervalues():
+		if param.description:
+		    cog.outl('\t/*! %s%s */' % (param.description, required))
 		cog.out('\t%s' % param.c_type)
 		if not param.c_type.endswith('*'):
 		    cog.out(' ')
@@ -157,7 +162,29 @@
 	    self.write_impl_prototypes(child)
 
  	for operation in resource.operations.itervalues():
+	    cog.outl('/*!')
+	    if operation.summary.endswith('.'):
+		raise ValueError("Operation summary should not end with a period (%s)" % operation.summary)
+
+	    # swagger spec recommends no more than 60 chars in the summary
+	    # See https://github.com/wordnik/swagger-core/wiki/API-Declaration
+	    if len(operation.summary) > 60:
+		raise ValueError("Operaiton summary too long (%s)" % operation.summary)
+	    cog.outl(' * \\brief %s.' % operation.summary)
+	    if operation.notes:
+		cog.outl(' *')
+		for line in textwrap.wrap(operation.notes, 79, initial_indent = ' * ', subsequent_indent = ' * '):
+		    cog.outl(line)
+		cog.outl(' *')
+	    cog.outl(' * \param headers HTTP headers')
+	    cog.outl(' * \param args Swagger parameters')
+	    cog.outl(' * \param[out] response HTTP response')
+	    cog.outl(' */')
 	    cog.outl('void %s(struct ast_variable *headers, %s *args, struct stasis_http_response *response);' % (operation.get_impl_name(), operation.get_args_name()))
+
+def write_operation_declaration(operation):
+    """Common code for writing an operation handler's doc comment and prototype.
+    """
 
 class ApiDeclarationSourceWriter(object):
     """Writes the .c for for a Swagger API Declaration file.
@@ -215,27 +242,36 @@
 	self.includes = []
 	self.author = None
 	self.copyright = None
+	self.basePath = None
 
 	if not is_identifier(self.get_name()):
 	    raise ValueError("Invalid path name: %s" % path_element)
 
-    def load_resource_listing(self, resources_file):
-	"""Loads resources from a Swagger resources.json file.
+    def load_resource_listing(self, resource_listing_file):
+	"""Loads resource_listing from a Swagger resources.json file.
 	"""
 	assert not self.children, "Should not reload existing resource"
 	assert not self.operations, "Should not reload existing resource"
 
-	resources_dir = os.path.dirname(resources_file)
-	with open(resources_file) as fp:
-	    resources = json.load(fp)
-
-	self.author = self.author or resources.get('_author')
-	self.copyright = self.copyright or resources.get('_copyright')
-
-	for api in resources['apis']:
+	resource_listing_dir = os.path.dirname(resource_listing_file)
+	with open(resource_listing_file) as fp:
+	    resource_listing = json.load(fp)
+
+	self.author = resource_listing.get('_author')
+	self.copyright = resource_listing.get('_copyright')
+
+	swagger_version = resource_listing.get('swaggerVersion')
+	if not swagger_version == SWAGGER_VERSION:
+	    raise ValueError("Unsupported Swagger version %s" % swagger_version)
+
+	self.basePath = resource_listing.get('basePath')
+	if self.basePath is None:
+	    raise ValueError("basePath missing from %s" % resource_listing_file)
+
+	for api in resource_listing['apis']:
 	    # Path in json is URI relative, so we need to drop the initial /api/
 	    path = api['path'].replace('/api/', '', 1)
-	    api_declaration_file = os.path.abspath(os.path.join(resources_dir, path)).format(format = 'json')
+	    api_declaration_file = os.path.abspath(os.path.join(resource_listing_dir, path)).format(format = 'json')
 	    (basename, ext) = os.path.splitext(os.path.basename(api_declaration_file))
 	    self.includes.append('asterisk/stasis_http_%s.h' % basename)
 	    self.load_api_declaration(api_declaration_file)
@@ -244,20 +280,30 @@
 	"""Loads a resource from a single Swagger resource.json file.
 	"""
 	with open(api_declaration_file) as fp:
-	    resource = json.load(fp)
-
-	self.author = self.author or resource.get('_author')
-	self.copyright = self.copyright or resource.get('_copyright')
-
-	for api in resource['apis']:
+	    api_declaration = json.load(fp)
+
+	self.author = self.author or api_declaration.get('_author')
+	self.copyright = self.copyright or api_declaration.get('_copyright')
+
+	swagger_version = api_declaration.get('swaggerVersion')
+	if swagger_version != SWAGGER_VERSION:
+	    raise ValueError("Unsupported Swagger version %s" % swagger_version)
+
+	if self.basePath and api_declaration.get('basePath') != self.basePath:
+	    raise ValueError("invalid basePath in %s" % api_declaration_file)
+
+	for api in api_declaration['apis']:
 	    resource_path = api['path'].split('/')
 	    # remove empty strings from resource_path
 	    resource_path = filter(lambda x: x, resource_path)
 	    resource = self.get_child(resource_path)
 	    for operation in api['operations']:
 		op = resource.add_operation(operation['httpMethod'], operation['nickname'])
+		op.summary = operation.get('summary')
+		op.notes = operation.get('notes')
 		for param in operation.get('parameters') or []:
 		    op.add_parameter(name = param['name'],
+				     description = param['description'],
 				     param_type = param['paramType'],
 				     required = param.get('required'),
 				     allowMultiple = param.get('allowMultiple'),
@@ -302,18 +348,20 @@
 	self.nickname = snakify(nickname)
 	self.query_parameters = OrderedDict()
 	self.path_parameters = OrderedDict()
+	self.summary = None
+	self.notes = None
 
 	if not is_identifier(self.get_callback_name()) or not is_identifier(self.nickname):
 	    raise ValueError("Invalid operation nickname: %s" % nickname)
 
-    def add_parameter(self, name, param_type, required, allowMultiple, dataType, defaultValue):
+    def add_parameter(self, name, description, param_type, required, allowMultiple, dataType, defaultValue):
 	if param_type == 'path':
 	    p = self.path_parameters
 	elif param_type == 'query':
 	    p = self.query_parameters
 	else:
 	    raise ValueError("Invalid param_type: %s" % param_type)
-	p[name] = Parameter(name, required, allowMultiple, dataType, defaultValue)
+	p[name] = Parameter(name = name, description = description, required = required, allowMultiple = allowMultiple, dataType = dataType, defaultValue = defaultValue)
 
     def get_all_parameters(self):
 	return OrderedDict(self.path_parameters.items() + self.query_parameters.items())
@@ -336,8 +384,9 @@
 class Parameter(object):
     """Swagger operation parameter.
     """
-    def __init__(self, name, required, allowMultiple, dataType, defaultValue):
+    def __init__(self, name, description, required, allowMultiple, dataType, defaultValue):
 	self.name = name
+	self.description = description
 	self.required = required
 	self.allowMultiple = allowMultiple
 	self.dataType = dataType

Modified: team/dlee/stasis-http/include/asterisk/stasis_http_asterisk.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/include/asterisk/stasis_http_asterisk.h?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/include/asterisk/stasis_http_asterisk.h (original)
+++ team/dlee/stasis-http/include/asterisk/stasis_http_asterisk.h Tue Jan 15 21:13:55 2013
@@ -35,7 +35,14 @@
 #ifndef _ASTERISK_STASIS_HTTP_ASTERISK_H
 #define _ASTERISK_STASIS_HTTP_ASTERISK_H
 struct ast_get_asterisk_info_args {
+	/*! Filter information returned */
 	const char *only;
 };
+/*!
+ * \brief Gets Asterisk system information.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct stasis_http_response *response);
 #endif /* _ASTERISK_STASIS_HTTP_ASTERISK_H */

Modified: team/dlee/stasis-http/include/asterisk/stasis_http_bridges.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/include/asterisk/stasis_http_bridges.h?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/include/asterisk/stasis_http_bridges.h (original)
+++ team/dlee/stasis-http/include/asterisk/stasis_http_bridges.h Tue Jan 15 21:13:55 2013
@@ -35,37 +35,92 @@
 #ifndef _ASTERISK_STASIS_HTTP_BRIDGES_H
 #define _ASTERISK_STASIS_HTTP_BRIDGES_H
 struct ast_add_channel_to_bridge_args {
+	/*! Bridge's id (required) */
 	const char *bridge_id;
+	/*! Channel's id (required) */
 	const char *channel;
 };
 struct ast_remove_channel_from_bridge_args {
+	/*! Bridge's id (required) */
 	const char *bridge_id;
+	/*! Channel's id (required) */
 	const char *channel;
 };
 struct ast_record_bridge_args {
+	/*! Bridge's id (required) */
 	const char *bridge_id;
+	/*! Recording's filename (required) */
 	const char *name;
+	/*! Maximum duration of the recording, in seconds. 0 for no limit. */
 	int max_duration_seconds;
+	/*! Maximum duration of silence, in seconds. 0 for no limit. */
 	int max_silence_seconds;
+	/*! If true, and recording already exists, append to recording. */
 	int append;
+	/*! Play beep when recording begins */
 	int beep;
+	/*! DTMF input to terminate recording. */
 	const char *terminate_on;
 };
 struct ast_get_bridge_args {
+	/*! Bridge's id (required) */
 	const char *bridge_id;
 };
 struct ast_delete_bridge_args {
+	/*! Bridge's id (required) */
 	const char *bridge_id;
 };
 struct ast_get_bridges_args {
 };
 struct ast_new_bridge_args {
 };
+/*!
+ * \brief Add a channel to a bridge.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Remove a channel from a bridge.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Start a recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Get bridge details.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Delete bridge.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct stasis_http_response *response);
+/*!
+ * \brief List active bridges.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Create a new bridge.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct stasis_http_response *response);
 #endif /* _ASTERISK_STASIS_HTTP_BRIDGES_H */

Modified: team/dlee/stasis-http/include/asterisk/stasis_http_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/include/asterisk/stasis_http_channels.h?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/include/asterisk/stasis_http_channels.h (original)
+++ team/dlee/stasis-http/include/asterisk/stasis_http_channels.h Tue Jan 15 21:13:55 2013
@@ -35,62 +35,157 @@
 #ifndef _ASTERISK_STASIS_HTTP_CHANNELS_H
 #define _ASTERISK_STASIS_HTTP_CHANNELS_H
 struct ast_dial_args {
+	/*! Endpoint to call. If not specified, dial is routed via dialplan */
 	const char *endpoint;
+	/*! Number to dial */
 	const char *number;
+	/*! When routing via dialplan, the context use. If omitted, uses 'default' */
 	const char *context;
 };
 struct ast_continue_in_dialplan_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
 };
 struct ast_reject_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
 };
 struct ast_answer_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
 };
 struct ast_hangup_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
 };
 struct ast_mute_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
+	/*! Direction in which to unmute audio */
 	const char *direction;
 };
 struct ast_unmute_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
+	/*! Direction in which to unmute audio */
 	const char *direction;
 };
 struct ast_record_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
+	/*! Recording's filename (required) */
 	const char *name;
+	/*! Maximum duration of the recording, in seconds. 0 for no limit */
 	int max_duration_seconds;
+	/*! Maximum duration of silence, in seconds. 0 for no limit */
 	int max_silence_seconds;
+	/*! If true, and recording already exists, append to recording */
 	int append;
+	/*! Play beep when recording begins */
 	int beep;
+	/*! DTMF input to terminate recording */
 	const char *terminate_on;
 };
 struct ast_get_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
 };
 struct ast_delete_channel_args {
+	/*! Channel's id (required) */
 	const char *channel_id;
 };
 struct ast_get_channels_args {
 };
 struct ast_originate_args {
+	/*! Endpoint to call. If not specified, originate is routed via dialplan */
 	const char *endpoint;
+	/*! Number to dial */
 	const char *number;
+	/*! When routing via dialplan, the context use. If omitted, uses 'default' */
 	const char *context;
 };
+/*!
+ * \brief Create a new channel (originate) and bridge to this channel.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_dial(struct ast_variable *headers, struct ast_dial_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Exit application; continue execution in the dialplan.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_continue_in_dialplan(struct ast_variable *headers, struct ast_continue_in_dialplan_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Reject a channel.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_reject_channel(struct ast_variable *headers, struct ast_reject_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Answer a channel.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_answer_channel(struct ast_variable *headers, struct ast_answer_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Hangup a channel.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_hangup_channel(struct ast_variable *headers, struct ast_hangup_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Mute a channel.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Unmute a channel.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Start a recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_record_channel(struct ast_variable *headers, struct ast_record_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Channel details.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_channel(struct ast_variable *headers, struct ast_get_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Delete (i.e. hangup) a channel.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_delete_channel(struct ast_variable *headers, struct ast_delete_channel_args *args, struct stasis_http_response *response);
+/*!
+ * \brief List active channels.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_channels(struct ast_variable *headers, struct ast_get_channels_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Create a new channel (originate).
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_originate(struct ast_variable *headers, struct ast_originate_args *args, struct stasis_http_response *response);
 #endif /* _ASTERISK_STASIS_HTTP_CHANNELS_H */

Modified: team/dlee/stasis-http/include/asterisk/stasis_http_endpoints.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/include/asterisk/stasis_http_endpoints.h?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/include/asterisk/stasis_http_endpoints.h (original)
+++ team/dlee/stasis-http/include/asterisk/stasis_http_endpoints.h Tue Jan 15 21:13:55 2013
@@ -35,11 +35,25 @@
 #ifndef _ASTERISK_STASIS_HTTP_ENDPOINTS_H
 #define _ASTERISK_STASIS_HTTP_ENDPOINTS_H
 struct ast_get_endpoint_args {
+	/*! ID of the endpoint */
 	const char *endpoint_id;
 };
 struct ast_get_endpoints_args {
+	/*! Filter endpoints by type (sip,iax2,dhadi,...) */
 	const char *with_type;
 };
+/*!
+ * \brief Details for an endpoint.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_endpoint(struct ast_variable *headers, struct ast_get_endpoint_args *args, struct stasis_http_response *response);
+/*!
+ * \brief List available endoints.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_endpoints(struct ast_variable *headers, struct ast_get_endpoints_args *args, struct stasis_http_response *response);
 #endif /* _ASTERISK_STASIS_HTTP_ENDPOINTS_H */

Modified: team/dlee/stasis-http/include/asterisk/stasis_http_recordings.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/include/asterisk/stasis_http_recordings.h?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/include/asterisk/stasis_http_recordings.h (original)
+++ team/dlee/stasis-http/include/asterisk/stasis_http_recordings.h Tue Jan 15 21:13:55 2013
@@ -35,34 +35,89 @@
 #ifndef _ASTERISK_STASIS_HTTP_RECORDINGS_H
 #define _ASTERISK_STASIS_HTTP_RECORDINGS_H
 struct ast_stop_recording_args {
+	/*! Recording's id (required) */
 	const char *recording_id;
 };
 struct ast_pause_recording_args {
+	/*! Recording's id (required) */
 	const char *recording_id;
 };
 struct ast_unpause_recording_args {
+	/*! Recording's id (required) */
 	const char *recording_id;
 };
 struct ast_mute_recording_args {
+	/*! Recording's id (required) */
 	const char *recording_id;
 };
 struct ast_unmute_recording_args {
+	/*! Recording's id (required) */
 	const char *recording_id;
 };
 struct ast_get_recording_args {
+	/*! Recording's id (required) */
 	const char *recording_id;
 };
 struct ast_delete_recording_args {
+	/*! Recording's id (required) */
 	const char *recording_id;
 };
 struct ast_get_recordings_args {
 };
+/*!
+ * \brief Stop recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_stop_recording(struct ast_variable *headers, struct ast_stop_recording_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Pause recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_pause_recording(struct ast_variable *headers, struct ast_pause_recording_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Unpause recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_unpause_recording(struct ast_variable *headers, struct ast_unpause_recording_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Mute recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_mute_recording(struct ast_variable *headers, struct ast_mute_recording_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Unmute recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_unmute_recording(struct ast_variable *headers, struct ast_unmute_recording_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Get recording details.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_recording(struct ast_variable *headers, struct ast_get_recording_args *args, struct stasis_http_response *response);
+/*!
+ * \brief Delete recording.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_delete_recording(struct ast_variable *headers, struct ast_delete_recording_args *args, struct stasis_http_response *response);
+/*!
+ * \brief List recordings.
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
 void stasis_http_get_recordings(struct ast_variable *headers, struct ast_get_recordings_args *args, struct stasis_http_response *response);
 #endif /* _ASTERISK_STASIS_HTTP_RECORDINGS_H */

Modified: team/dlee/stasis-http/rest-api/asterisk.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/rest-api/asterisk.json?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/rest-api/asterisk.json (original)
+++ team/dlee/stasis-http/rest-api/asterisk.json Tue Jan 15 21:13:55 2013
@@ -4,7 +4,8 @@
     "_svn_revision": "$Revision$",
     "apiVersion": "0.0.1",
     "swaggerVersion": "1.1",
-    "resourcePath": "/asterisk",
+    "basePath": "http://localhost:8088/stasis",
+    "resourcePath": "/api/asterisk",
     "apis": [
         {
             "path": "/asterisk/info",

Modified: team/dlee/stasis-http/rest-api/bridges.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/rest-api/bridges.json?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/rest-api/bridges.json (original)
+++ team/dlee/stasis-http/rest-api/bridges.json Tue Jan 15 21:13:55 2013
@@ -4,6 +4,7 @@
     "_svn_revision": "$Revision$",
     "apiVersion": "0.0.1",
     "swaggerVersion": "1.1",
+    "basePath": "http://localhost:8088/stasis",
     "resourcePath": "/bridges.json",
     "apis": [
         {

Modified: team/dlee/stasis-http/rest-api/channels.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/rest-api/channels.json?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/rest-api/channels.json (original)
+++ team/dlee/stasis-http/rest-api/channels.json Tue Jan 15 21:13:55 2013
@@ -4,6 +4,7 @@
     "_svn_revision": "$Revision$",
     "apiVersion": "0.0.1",
     "swaggerVersion": "1.1",
+    "basePath": "http://localhost:8088/stasis",
     "resourcePath": "/channels",
     "apis": [
         {
@@ -18,13 +19,13 @@
                 },
                 {
                     "httpMethod": "POST",
-                    "summary": "Create a new channel (i.e. originate)",
+                    "summary": "Create a new channel (originate)",
                     "nickname": "originate",
                     "responseClass": "Originated",
                     "parameters": [
                         {
                             "name": "endpoint",
-                            "description": "Endpoint to call. If not specified, originate is routed via dialplan.",
+                            "description": "Endpoint to call. If not specified, originate is routed via dialplan",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,
@@ -32,7 +33,7 @@
                         },
                         {
                             "name": "number",
-                            "description": "Number to dial.",
+                            "description": "Number to dial",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,
@@ -72,7 +73,7 @@
                 },
                 {
                     "httpMethod": "DELETE",
-                    "summary": "Delete (i.e. hangup) a channel.",
+                    "summary": "Delete (i.e. hangup) a channel",
                     "nickname": "deleteChannel",
                     "responseClass": "void",
                     "parameters": [
@@ -90,17 +91,17 @@
         },
         {
             "path": "/channels/{channelId}/dial",
-            "description": "Create a new channel (i.e. originate) and bridge to this channel",
-            "operations": [
-                {
-                    "httpMethod": "POST",
-                    "summary": "Create a new channel (i.e. originate) and bridge to this channel",
+            "description": "Create a new channel (originate) and bridge to this channel",
+            "operations": [
+                {
+                    "httpMethod": "POST",
+                    "summary": "Create a new channel (originate) and bridge to this channel",
                     "nickname": "dial",
                     "responseClass": "Dialed",
                     "parameters": [
                         {
                             "name": "endpoint",
-                            "description": "Endpoint to call. If not specified, dial is routed via dialplan.",
+                            "description": "Endpoint to call. If not specified, dial is routed via dialplan",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,
@@ -108,7 +109,7 @@
                         },
                         {
                             "name": "number",
-                            "description": "Number to dial.",
+                            "description": "Number to dial",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,
@@ -128,11 +129,11 @@
         },
         {
             "path": "/channels/{channelId}/continue",
-            "description": "Exit application; continue execution in the dialplan.",
-            "operations": [
-                {
-                    "httpMethod": "POST",
-                    "summary": "Exit application; continue execution in the dialplan.",
+            "description": "Exit application; continue execution in the dialplan",
+            "operations": [
+                {
+                    "httpMethod": "POST",
+                    "summary": "Exit application; continue execution in the dialplan",
                     "nickname": "continueInDialplan",
                     "responseClass": "void",
                     "parameters": [
@@ -320,7 +321,7 @@
                         },
                         {
                             "name": "maxDurationSeconds",
-                            "description": "Maximum duration of the recording, in seconds. 0 for no limit.",
+                            "description": "Maximum duration of the recording, in seconds. 0 for no limit",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,
@@ -329,7 +330,7 @@
                         },
                         {
                             "name": "maxSilenceSeconds",
-                            "description": "Maximum duration of silence, in seconds. 0 for no limit.",
+                            "description": "Maximum duration of silence, in seconds. 0 for no limit",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,
@@ -338,7 +339,7 @@
                         },
                         {
                             "name": "append",
-                            "description": "If true, and recording already exists, append to recording.",
+                            "description": "If true, and recording already exists, append to recording",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,
@@ -356,7 +357,7 @@
                         },
                         {
                             "name": "terminateOn",
-                            "description": "DTMF input to terminate recording.",
+                            "description": "DTMF input to terminate recording",
                             "paramType": "query",
                             "required": false,
                             "allowMultiple": false,

Modified: team/dlee/stasis-http/rest-api/endpoints.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/rest-api/endpoints.json?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/rest-api/endpoints.json (original)
+++ team/dlee/stasis-http/rest-api/endpoints.json Tue Jan 15 21:13:55 2013
@@ -4,6 +4,7 @@
     "_svn_revision": "$Revision$",
     "apiVersion": "0.0.1",
     "swaggerVersion": "1.1",
+    "basePath": "http://localhost:8088/stasis",
     "resourcePath": "/endpoints",
     "apis": [
         {

Modified: team/dlee/stasis-http/rest-api/recordings.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/rest-api/recordings.json?view=diff&rev=379177&r1=379176&r2=379177
==============================================================================
--- team/dlee/stasis-http/rest-api/recordings.json (original)
+++ team/dlee/stasis-http/rest-api/recordings.json Tue Jan 15 21:13:55 2013
@@ -4,6 +4,7 @@
     "_svn_revision": "$Revision$",
     "apiVersion": "0.0.1",
     "swaggerVersion": "1.1",
+    "basePath": "http://localhost:8088/stasis",
     "resourcePath": "/recordings",
     "apis": [
         {




More information about the asterisk-commits mailing list