[svn-commits] dlee: branch 12 r402528 - in /branches/12: res/ res/ari/ rest-api-templates/ ...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Nov 7 15:09:23 CST 2013


Author: dlee
Date: Thu Nov  7 15:09:18 2013
New Revision: 402528

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402528
Log:
ari: User better nicknames for ARI operations

While working on building client libraries from the Swagger API, I
noticed a problem with the nicknames.

    channel.deleteChannel()
    channel.answerChannel()
    channel.muteChannel()

Etc. We put the object name in the nickname (since we were generating C
code), but it makes OO generators redundant.

This patch makes the nicknames more OO friendly. This resulted in a lot
of name changing within the res_ari_*.so modules, but not much else.

There were a couple of other fixed I made in the process.

 * When reversible operations (POST /hold, POST /unhold) were made more
   RESTful (POST /hold, DELETE /unhold), the path for the second operation
   was left in the API declaration. This worked, but really the two
   operations should have been on the same API.
 * The POST /unmute operation had still not been REST-ified.

Review: https://reviewboard.asterisk.org/r/2940/

Modified:
    branches/12/res/ari/resource_applications.c
    branches/12/res/ari/resource_applications.h
    branches/12/res/ari/resource_asterisk.c
    branches/12/res/ari/resource_asterisk.h
    branches/12/res/ari/resource_bridges.c
    branches/12/res/ari/resource_bridges.h
    branches/12/res/ari/resource_channels.c
    branches/12/res/ari/resource_channels.h
    branches/12/res/ari/resource_endpoints.c
    branches/12/res/ari/resource_endpoints.h
    branches/12/res/ari/resource_events.c
    branches/12/res/ari/resource_events.h
    branches/12/res/ari/resource_playback.c
    branches/12/res/ari/resource_playback.h
    branches/12/res/ari/resource_recordings.c
    branches/12/res/ari/resource_recordings.h
    branches/12/res/ari/resource_sounds.c
    branches/12/res/ari/resource_sounds.h
    branches/12/res/res_ari_applications.c
    branches/12/res/res_ari_asterisk.c
    branches/12/res/res_ari_bridges.c
    branches/12/res/res_ari_channels.c
    branches/12/res/res_ari_endpoints.c
    branches/12/res/res_ari_events.c
    branches/12/res/res_ari_playback.c
    branches/12/res/res_ari_recordings.c
    branches/12/res/res_ari_sounds.c
    branches/12/rest-api-templates/ari_resource.c.mustache
    branches/12/rest-api-templates/ari_resource.h.mustache
    branches/12/rest-api-templates/asterisk_processor.py
    branches/12/rest-api-templates/res_ari_resource.c.mustache
    branches/12/rest-api-templates/rest_handler.mustache
    branches/12/rest-api-templates/swagger_model.py
    branches/12/rest-api/api-docs/applications.json
    branches/12/rest-api/api-docs/asterisk.json
    branches/12/rest-api/api-docs/bridges.json
    branches/12/rest-api/api-docs/channels.json
    branches/12/rest-api/api-docs/endpoints.json
    branches/12/rest-api/api-docs/playback.json
    branches/12/rest-api/api-docs/recordings.json
    branches/12/rest-api/api-docs/sounds.json

Modified: branches/12/res/ari/resource_applications.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_applications.c?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_applications.c (original)
+++ branches/12/res/ari/resource_applications.c Thu Nov  7 15:09:18 2013
@@ -41,8 +41,8 @@
 	return 0;
 }
 
-void ast_ari_get_applications(struct ast_variable *headers,
-	struct ast_get_applications_args *args,
+void ast_ari_applications_list(struct ast_variable *headers,
+	struct ast_ari_applications_list_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ao2_container *, apps, NULL, ao2_cleanup);
@@ -72,8 +72,8 @@
 	ast_ari_response_ok(response, json);
 }
 
-void ast_ari_get_application(struct ast_variable *headers,
-	struct ast_get_application_args *args,
+void ast_ari_applications_get(struct ast_variable *headers,
+	struct ast_ari_applications_get_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
@@ -89,8 +89,8 @@
 	ast_ari_response_ok(response, json);
 }
 
-void ast_ari_application_subscribe(struct ast_variable *headers,
-	struct ast_application_subscribe_args *args,
+void ast_ari_applications_subscribe(struct ast_variable *headers,
+	struct ast_ari_applications_subscribe_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
@@ -134,8 +134,8 @@
 	}
 }
 
-void ast_ari_application_unsubscribe(struct ast_variable *headers,
-	struct ast_application_unsubscribe_args *args,
+void ast_ari_applications_unsubscribe(struct ast_variable *headers,
+	struct ast_ari_applications_unsubscribe_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);

Modified: branches/12/res/ari/resource_applications.h
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_applications.h?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_applications.h (original)
+++ branches/12/res/ari/resource_applications.h Thu Nov  7 15:09:18 2013
@@ -39,8 +39,8 @@
 
 #include "asterisk/ari.h"
 
-/*! \brief Argument struct for ast_ari_get_applications() */
-struct ast_get_applications_args {
+/*! \brief Argument struct for ast_ari_applications_list() */
+struct ast_ari_applications_list_args {
 };
 /*!
  * \brief List all applications.
@@ -49,9 +49,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_applications(struct ast_variable *headers, struct ast_get_applications_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_get_application() */
-struct ast_get_application_args {
+void ast_ari_applications_list(struct ast_variable *headers, struct ast_ari_applications_list_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_applications_get() */
+struct ast_ari_applications_get_args {
 	/*! \brief Application's name */
 	const char *application_name;
 };
@@ -62,9 +62,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_application(struct ast_variable *headers, struct ast_get_application_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_application_subscribe() */
-struct ast_application_subscribe_args {
+void ast_ari_applications_get(struct ast_variable *headers, struct ast_ari_applications_get_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_applications_subscribe() */
+struct ast_ari_applications_subscribe_args {
 	/*! \brief Application's name */
 	const char *application_name;
 	/*! \brief Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource} */
@@ -83,9 +83,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_application_subscribe(struct ast_variable *headers, struct ast_application_subscribe_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_application_unsubscribe() */
-struct ast_application_unsubscribe_args {
+void ast_ari_applications_subscribe(struct ast_variable *headers, struct ast_ari_applications_subscribe_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_applications_unsubscribe() */
+struct ast_ari_applications_unsubscribe_args {
 	/*! \brief Application's name */
 	const char *application_name;
 	/*! \brief Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource} */
@@ -104,6 +104,6 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_application_unsubscribe(struct ast_variable *headers, struct ast_application_unsubscribe_args *args, struct ast_ari_response *response);
+void ast_ari_applications_unsubscribe(struct ast_variable *headers, struct ast_ari_applications_unsubscribe_args *args, struct ast_ari_response *response);
 
 #endif /* _ASTERISK_RESOURCE_APPLICATIONS_H */

Modified: branches/12/res/ari/resource_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_asterisk.c?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_asterisk.c (original)
+++ branches/12/res/ari/resource_asterisk.c Thu Nov  7 15:09:18 2013
@@ -37,8 +37,8 @@
 #include "asterisk/pbx.h"
 #include "resource_asterisk.h"
 
-void ast_ari_get_asterisk_info(struct ast_variable *headers,
-	struct ast_get_asterisk_info_args *args,
+void ast_ari_asterisk_get_info(struct ast_variable *headers,
+	struct ast_ari_asterisk_get_info_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
@@ -140,7 +140,9 @@
 	ast_ari_response_ok(response, ast_json_ref(json));
 }
 
-void ast_ari_get_global_var(struct ast_variable *headers, struct ast_get_global_var_args *args, struct ast_ari_response *response)
+void ast_ari_asterisk_get_global_var(struct ast_variable *headers,
+	struct ast_ari_asterisk_get_global_var_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	RAII_VAR(struct ast_str *, tmp, NULL, ast_free);
@@ -172,7 +174,9 @@
 	ast_ari_response_ok(response, ast_json_ref(json));
 }
 
-void ast_ari_set_global_var(struct ast_variable *headers, struct ast_set_global_var_args *args, struct ast_ari_response *response)
+void ast_ari_asterisk_set_global_var(struct ast_variable *headers,
+	struct ast_ari_asterisk_set_global_var_args *args,
+	struct ast_ari_response *response)
 {
 	ast_assert(response != NULL);
 

Modified: branches/12/res/ari/resource_asterisk.h
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_asterisk.h?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_asterisk.h (original)
+++ branches/12/res/ari/resource_asterisk.h Thu Nov  7 15:09:18 2013
@@ -39,8 +39,8 @@
 
 #include "asterisk/ari.h"
 
-/*! \brief Argument struct for ast_ari_get_asterisk_info() */
-struct ast_get_asterisk_info_args {
+/*! \brief Argument struct for ast_ari_asterisk_get_info() */
+struct ast_ari_asterisk_get_info_args {
 	/*! \brief Array of Filter information returned */
 	const char **only;
 	/*! \brief Length of only array. */
@@ -55,9 +55,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_get_global_var() */
-struct ast_get_global_var_args {
+void ast_ari_asterisk_get_info(struct ast_variable *headers, struct ast_ari_asterisk_get_info_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_asterisk_get_global_var() */
+struct ast_ari_asterisk_get_global_var_args {
 	/*! \brief The variable to get */
 	const char *variable;
 };
@@ -68,9 +68,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_global_var(struct ast_variable *headers, struct ast_get_global_var_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_set_global_var() */
-struct ast_set_global_var_args {
+void ast_ari_asterisk_get_global_var(struct ast_variable *headers, struct ast_ari_asterisk_get_global_var_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_asterisk_set_global_var() */
+struct ast_ari_asterisk_set_global_var_args {
 	/*! \brief The variable to set */
 	const char *variable;
 	/*! \brief The value to set the variable to */
@@ -83,6 +83,6 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_set_global_var(struct ast_variable *headers, struct ast_set_global_var_args *args, struct ast_ari_response *response);
+void ast_ari_asterisk_set_global_var(struct ast_variable *headers, struct ast_ari_asterisk_set_global_var_args *args, struct ast_ari_response *response);
 
 #endif /* _ASTERISK_RESOURCE_ASTERISK_H */

Modified: branches/12/res/ari/resource_bridges.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_bridges.c?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_bridges.c (original)
+++ branches/12/res/ari/resource_bridges.c Thu Nov  7 15:09:18 2013
@@ -172,7 +172,9 @@
 	return list;
 }
 
-void ast_ari_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_add_channel(struct ast_variable *headers,
+	struct ast_ari_bridges_add_channel_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
 	RAII_VAR(struct control_list *, list, NULL, ao2_cleanup);
@@ -206,7 +208,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_remove_channel(struct ast_variable *headers,
+	struct ast_ari_bridges_remove_channel_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
 	RAII_VAR(struct control_list *, list, NULL, ao2_cleanup);
@@ -290,7 +294,9 @@
 	return ast_request(type, cap, NULL, "ARI", NULL);
 }
 
-void ast_ari_play_on_bridge(struct ast_variable *headers, struct ast_play_on_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_play(struct ast_variable *headers,
+	struct ast_ari_bridges_play_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
 	RAII_VAR(struct ast_channel *, play_channel, NULL, ast_hangup);
@@ -385,7 +391,9 @@
 	ast_ari_response_created(response, playback_url, json);
 }
 
-void ast_ari_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_record(struct ast_variable *headers,
+	struct ast_ari_bridges_record_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
 	RAII_VAR(struct ast_channel *, record_channel, NULL, ast_hangup);
@@ -538,7 +546,9 @@
 	ast_ari_response_created(response, recording_url, json);
 }
 
-void ast_ari_moh_start_bridge(struct ast_variable *headers, struct ast_moh_start_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_start_moh(struct ast_variable *headers,
+	struct ast_ari_bridges_start_moh_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
 	struct ast_channel *moh_channel;
@@ -561,7 +571,9 @@
 
 }
 
-void ast_ari_moh_stop_bridge(struct ast_variable *headers, struct ast_moh_stop_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_stop_moh(struct ast_variable *headers,
+	struct ast_ari_bridges_stop_moh_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
 
@@ -580,7 +592,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_get(struct ast_variable *headers,
+	struct ast_ari_bridges_get_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge_snapshot *, snapshot, ast_bridge_snapshot_get_latest(args->bridge_id), ao2_cleanup);
 	if (!snapshot) {
@@ -594,7 +608,9 @@
 		ast_bridge_snapshot_to_json(snapshot));
 }
 
-void ast_ari_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_destroy(struct ast_variable *headers,
+	struct ast_ari_bridges_destroy_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
 	if (!bridge) {
@@ -605,7 +621,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_list(struct ast_variable *headers,
+	struct ast_ari_bridges_list_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup);
 	RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
@@ -648,7 +666,9 @@
 	ast_ari_response_ok(response, ast_json_ref(json));
 }
 
-void ast_ari_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct ast_ari_response *response)
+void ast_ari_bridges_create(struct ast_variable *headers,
+	struct ast_ari_bridges_create_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_bridge *, bridge, stasis_app_bridge_create(args->type), ao2_cleanup);
 	RAII_VAR(struct ast_bridge_snapshot *, snapshot, NULL, ao2_cleanup);

Modified: branches/12/res/ari/resource_bridges.h
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_bridges.h?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_bridges.h (original)
+++ branches/12/res/ari/resource_bridges.h Thu Nov  7 15:09:18 2013
@@ -39,8 +39,8 @@
 
 #include "asterisk/ari.h"
 
-/*! \brief Argument struct for ast_ari_get_bridges() */
-struct ast_get_bridges_args {
+/*! \brief Argument struct for ast_ari_bridges_list() */
+struct ast_ari_bridges_list_args {
 };
 /*!
  * \brief List all active bridges in Asterisk.
@@ -49,9 +49,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_new_bridge() */
-struct ast_new_bridge_args {
+void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_create() */
+struct ast_ari_bridges_create_args {
 	/*! \brief Type of bridge to create. */
 	const char *type;
 };
@@ -64,9 +64,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_get_bridge() */
-struct ast_get_bridge_args {
+void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_get() */
+struct ast_ari_bridges_get_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 };
@@ -77,9 +77,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_delete_bridge() */
-struct ast_delete_bridge_args {
+void ast_ari_bridges_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_destroy() */
+struct ast_ari_bridges_destroy_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 };
@@ -92,9 +92,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_add_channel_to_bridge() */
-struct ast_add_channel_to_bridge_args {
+void ast_ari_bridges_destroy(struct ast_variable *headers, struct ast_ari_bridges_destroy_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_add_channel() */
+struct ast_ari_bridges_add_channel_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 	/*! \brief Array of Ids of channels to add to bridge */
@@ -113,9 +113,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_remove_channel_from_bridge() */
-struct ast_remove_channel_from_bridge_args {
+void ast_ari_bridges_add_channel(struct ast_variable *headers, struct ast_ari_bridges_add_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_remove_channel() */
+struct ast_ari_bridges_remove_channel_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 	/*! \brief Array of Ids of channels to remove from bridge */
@@ -132,9 +132,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_moh_start_bridge() */
-struct ast_moh_start_bridge_args {
+void ast_ari_bridges_remove_channel(struct ast_variable *headers, struct ast_ari_bridges_remove_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_start_moh() */
+struct ast_ari_bridges_start_moh_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 	/*! \brief Channel's id */
@@ -147,24 +147,24 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_moh_start_bridge(struct ast_variable *headers, struct ast_moh_start_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_moh_stop_bridge() */
-struct ast_moh_stop_bridge_args {
+void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_stop_moh() */
+struct ast_ari_bridges_stop_moh_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 };
 /*!
  * \brief Stop playing music on hold to a bridge.
  *
- * This will only stop music on hold being played via bridges/{bridgeId}/mohStart.
- *
- * \param headers HTTP headers
- * \param args Swagger parameters
- * \param[out] response HTTP response
- */
-void ast_ari_moh_stop_bridge(struct ast_variable *headers, struct ast_moh_stop_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_play_on_bridge() */
-struct ast_play_on_bridge_args {
+ * This will only stop music on hold being played via POST bridges/{bridgeId}/moh.
+ *
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
+void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_play() */
+struct ast_ari_bridges_play_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 	/*! \brief Media's URI to play. */
@@ -185,9 +185,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_play_on_bridge(struct ast_variable *headers, struct ast_play_on_bridge_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_record_bridge() */
-struct ast_record_bridge_args {
+void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_bridges_record() */
+struct ast_ari_bridges_record_args {
 	/*! \brief Bridge's id */
 	const char *bridge_id;
 	/*! \brief Recording's filename */
@@ -214,6 +214,6 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct ast_ari_response *response);
+void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response);
 
 #endif /* _ASTERISK_RESOURCE_BRIDGES_H */

Modified: branches/12/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_channels.c?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_channels.c (original)
+++ branches/12/res/ari/resource_channels.c Thu Nov  7 15:09:18 2013
@@ -81,9 +81,9 @@
 	return control;
 }
 
-void ast_ari_continue_in_dialplan(
+void ast_ari_channels_continue_in_dialplan(
 	struct ast_variable *headers,
-	struct ast_continue_in_dialplan_args *args,
+	struct ast_ari_channels_continue_in_dialplan_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
@@ -103,9 +103,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_answer_channel(struct ast_variable *headers,
-				struct ast_answer_channel_args *args,
-				struct ast_ari_response *response)
+void ast_ari_channels_answer(struct ast_variable *headers,
+	struct ast_ari_channels_answer_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -124,9 +124,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_ring_channel(struct ast_variable *headers,
-				struct ast_ring_channel_args *args,
-				struct ast_ari_response *response)
+void ast_ari_channels_ring(struct ast_variable *headers,
+	struct ast_ari_channels_ring_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -140,7 +140,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct ast_ari_response *response)
+void ast_ari_channels_mute(struct ast_variable *headers,
+	struct ast_ari_channels_mute_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 	unsigned int direction = 0;
@@ -176,7 +178,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct ast_ari_response *response)
+void ast_ari_channels_unmute(struct ast_variable *headers,
+	struct ast_ari_channels_unmute_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 	unsigned int direction = 0;
@@ -212,7 +216,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_send_dtmfchannel(struct ast_variable *headers, struct ast_send_dtmfchannel_args *args, struct ast_ari_response *response)
+void ast_ari_channels_send_dtmf(struct ast_variable *headers,
+	struct ast_ari_channels_send_dtmf_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -233,7 +239,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_hold_channel(struct ast_variable *headers, struct ast_hold_channel_args *args, struct ast_ari_response *response)
+void ast_ari_channels_hold(struct ast_variable *headers,
+	struct ast_ari_channels_hold_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -248,7 +256,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_unhold_channel(struct ast_variable *headers, struct ast_unhold_channel_args *args, struct ast_ari_response *response)
+void ast_ari_channels_unhold(struct ast_variable *headers,
+	struct ast_ari_channels_unhold_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -263,7 +273,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_moh_start_channel(struct ast_variable *headers, struct ast_moh_start_channel_args *args, struct ast_ari_response *response)
+void ast_ari_channels_start_moh(struct ast_variable *headers,
+	struct ast_ari_channels_start_moh_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -277,7 +289,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_moh_stop_channel(struct ast_variable *headers, struct ast_moh_stop_channel_args *args, struct ast_ari_response *response)
+void ast_ari_channels_stop_moh(struct ast_variable *headers,
+	struct ast_ari_channels_stop_moh_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -291,8 +305,8 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_play_on_channel(struct ast_variable *headers,
-	struct ast_play_on_channel_args *args,
+void ast_ari_channels_play(struct ast_variable *headers,
+	struct ast_ari_channels_play_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
@@ -363,8 +377,8 @@
 	ast_ari_response_created(response, playback_url, json);
 }
 
-void ast_ari_record_channel(struct ast_variable *headers,
-	struct ast_record_channel_args *args,
+void ast_ari_channels_record(struct ast_variable *headers,
+	struct ast_ari_channels_record_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
@@ -502,9 +516,9 @@
 	ast_ari_response_created(response, recording_url, json);
 }
 
-void ast_ari_get_channel(struct ast_variable *headers,
-			     struct ast_get_channel_args *args,
-			     struct ast_ari_response *response)
+void ast_ari_channels_get(struct ast_variable *headers,
+	struct ast_ari_channels_get_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 	struct stasis_cache *cache;
@@ -534,9 +548,9 @@
 				ast_channel_snapshot_to_json(snapshot));
 }
 
-void ast_ari_delete_channel(struct ast_variable *headers,
-				struct ast_delete_channel_args *args,
-				struct ast_ari_response *response)
+void ast_ari_channels_hangup(struct ast_variable *headers,
+	struct ast_ari_channels_hangup_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_channel *, chan, NULL, ao2_cleanup);
 	int cause;
@@ -568,9 +582,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_get_channels(struct ast_variable *headers,
-			      struct ast_get_channels_args *args,
-			      struct ast_ari_response *response)
+void ast_ari_channels_list(struct ast_variable *headers,
+	struct ast_ari_channels_list_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup);
 	RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
@@ -615,9 +629,9 @@
 	ast_ari_response_ok(response, ast_json_ref(json));
 }
 
-void ast_ari_originate(struct ast_variable *headers,
-			   struct ast_originate_args *args,
-			   struct ast_ari_response *response)
+void ast_ari_channels_originate(struct ast_variable *headers,
+	struct ast_ari_channels_originate_args *args,
+	struct ast_ari_response *response)
 {
 	char *dialtech;
 	char dialdevice[AST_CHANNEL_NAME];
@@ -711,7 +725,9 @@
 	ast_channel_unref(chan);
 }
 
-void ast_ari_get_channel_var(struct ast_variable *headers, struct ast_get_channel_var_args *args, struct ast_ari_response *response)
+void ast_ari_channels_get_channel_var(struct ast_variable *headers,
+	struct ast_ari_channels_get_channel_var_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
@@ -742,7 +758,9 @@
 	ast_ari_response_ok(response, ast_json_ref(json));
 }
 
-void ast_ari_set_channel_var(struct ast_variable *headers, struct ast_set_channel_var_args *args, struct ast_ari_response *response)
+void ast_ari_channels_set_channel_var(struct ast_variable *headers,
+	struct ast_ari_channels_set_channel_var_args *args,
+	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 

Modified: branches/12/res/ari/resource_channels.h
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_channels.h?view=diff&rev=402528&r1=402527&r2=402528
==============================================================================
--- branches/12/res/ari/resource_channels.h (original)
+++ branches/12/res/ari/resource_channels.h Thu Nov  7 15:09:18 2013
@@ -39,8 +39,8 @@
 
 #include "asterisk/ari.h"
 
-/*! \brief Argument struct for ast_ari_get_channels() */
-struct ast_get_channels_args {
+/*! \brief Argument struct for ast_ari_channels_list() */
+struct ast_ari_channels_list_args {
 };
 /*!
  * \brief List all active channels in Asterisk.
@@ -49,9 +49,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_channels(struct ast_variable *headers, struct ast_get_channels_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_originate() */
-struct ast_originate_args {
+void ast_ari_channels_list(struct ast_variable *headers, struct ast_ari_channels_list_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_originate() */
+struct ast_ari_channels_originate_args {
 	/*! \brief Endpoint to call. */
 	const char *endpoint;
 	/*! \brief The extension to dial after the endpoint answers */
@@ -78,9 +78,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_originate(struct ast_variable *headers, struct ast_originate_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_get_channel() */
-struct ast_get_channel_args {
+void ast_ari_channels_originate(struct ast_variable *headers, struct ast_ari_channels_originate_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_get() */
+struct ast_ari_channels_get_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 };
@@ -91,9 +91,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_get_channel(struct ast_variable *headers, struct ast_get_channel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_delete_channel() */
-struct ast_delete_channel_args {
+void ast_ari_channels_get(struct ast_variable *headers, struct ast_ari_channels_get_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_hangup() */
+struct ast_ari_channels_hangup_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 	/*! \brief Reason for hanging up the channel */
@@ -106,9 +106,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_delete_channel(struct ast_variable *headers, struct ast_delete_channel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_continue_in_dialplan() */
-struct ast_continue_in_dialplan_args {
+void ast_ari_channels_hangup(struct ast_variable *headers, struct ast_ari_channels_hangup_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_continue_in_dialplan() */
+struct ast_ari_channels_continue_in_dialplan_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 	/*! \brief The context to continue to. */
@@ -125,9 +125,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_continue_in_dialplan(struct ast_variable *headers, struct ast_continue_in_dialplan_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_answer_channel() */
-struct ast_answer_channel_args {
+void ast_ari_channels_continue_in_dialplan(struct ast_variable *headers, struct ast_ari_channels_continue_in_dialplan_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_answer() */
+struct ast_ari_channels_answer_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 };
@@ -138,9 +138,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_answer_channel(struct ast_variable *headers, struct ast_answer_channel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_ring_channel() */
-struct ast_ring_channel_args {
+void ast_ari_channels_answer(struct ast_variable *headers, struct ast_ari_channels_answer_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_ring() */
+struct ast_ari_channels_ring_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 };
@@ -151,9 +151,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_ring_channel(struct ast_variable *headers, struct ast_ring_channel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_send_dtmfchannel() */
-struct ast_send_dtmfchannel_args {
+void ast_ari_channels_ring(struct ast_variable *headers, struct ast_ari_channels_ring_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_send_dtmf() */
+struct ast_ari_channels_send_dtmf_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 	/*! \brief DTMF To send. */
@@ -174,9 +174,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_send_dtmfchannel(struct ast_variable *headers, struct ast_send_dtmfchannel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_mute_channel() */
-struct ast_mute_channel_args {
+void ast_ari_channels_send_dtmf(struct ast_variable *headers, struct ast_ari_channels_send_dtmf_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_mute() */
+struct ast_ari_channels_mute_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 	/*! \brief Direction in which to mute audio */
@@ -189,9 +189,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_unmute_channel() */
-struct ast_unmute_channel_args {
+void ast_ari_channels_mute(struct ast_variable *headers, struct ast_ari_channels_mute_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_channels_unmute() */
+struct ast_ari_channels_unmute_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 	/*! \brief Direction in which to unmute audio */
@@ -204,9 +204,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_hold_channel() */
-struct ast_hold_channel_args {
+void ast_ari_channels_unmute(struct ast_variable *headers, struct ast_ari_channels_unmute_args *args, struct ast_ari_response *response);

[... 3600 lines stripped ...]



More information about the svn-commits mailing list