[asterisk-commits] qwell: branch qwell/ari_channel_variables r392723 - in /team/qwell/ari_channe...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 24 10:45:21 CDT 2013


Author: qwell
Date: Mon Jun 24 10:45:19 2013
New Revision: 392723

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392723
Log:
Rename getVar/setVar, to denote channel.

Modified:
    team/qwell/ari_channel_variables/include/asterisk/stasis_app.h
    team/qwell/ari_channel_variables/res/res_stasis_http_channels.c
    team/qwell/ari_channel_variables/res/stasis/control.c
    team/qwell/ari_channel_variables/res/stasis_http/resource_channels.c
    team/qwell/ari_channel_variables/res/stasis_http/resource_channels.h
    team/qwell/ari_channel_variables/res/stasis_json/resource_sounds.h
    team/qwell/ari_channel_variables/rest-api/api-docs/channels.json

Modified: team/qwell/ari_channel_variables/include/asterisk/stasis_app.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/include/asterisk/stasis_app.h?view=diff&rev=392723&r1=392722&r2=392723
==============================================================================
--- team/qwell/ari_channel_variables/include/asterisk/stasis_app.h (original)
+++ team/qwell/ari_channel_variables/include/asterisk/stasis_app.h Mon Jun 24 10:45:19 2013
@@ -159,7 +159,7 @@
  * \param variable The name of the variable
  * \return The value of the variable.
  */
-char *stasis_app_control_get_var(struct stasis_app_control *control, const char *variable);
+char *stasis_app_control_get_channel_var(struct stasis_app_control *control, const char *variable);
 
 /*!
  * \brief Set a variable on the channel associated with this control to value.
@@ -170,7 +170,7 @@
  * \return 0 for success.
  * \return -1 for error.
  */
-int stasis_app_control_set_var(struct stasis_app_control *control, const char *variable, const char *value);
+int stasis_app_control_set_channel_var(struct stasis_app_control *control, const char *variable, const char *value);
 
 /*!
  * \brief Returns the most recent snapshot for the associated channel.

Modified: team/qwell/ari_channel_variables/res/res_stasis_http_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/res/res_stasis_http_channels.c?view=diff&rev=392723&r1=392722&r2=392723
==============================================================================
--- team/qwell/ari_channel_variables/res/res_stasis_http_channels.c (original)
+++ team/qwell/ari_channel_variables/res/res_stasis_http_channels.c Mon Jun 24 10:45:19 2013
@@ -411,11 +411,11 @@
  * \param headers HTTP headers.
  * \param[out] response Response to the HTTP request.
  */
-static void stasis_http_get_var_cb(
-    struct ast_variable *get_params, struct ast_variable *path_vars,
-    struct ast_variable *headers, struct stasis_http_response *response)
-{
-	struct ast_get_var_args args = {};
+static void stasis_http_get_channel_var_cb(
+    struct ast_variable *get_params, struct ast_variable *path_vars,
+    struct ast_variable *headers, struct stasis_http_response *response)
+{
+	struct ast_get_channel_var_args args = {};
 	struct ast_variable *i;
 
 	for (i = get_params; i; i = i->next) {
@@ -430,7 +430,7 @@
 		} else
 		{}
 	}
-	stasis_http_get_var(headers, &args, response);
+	stasis_http_get_channel_var(headers, &args, response);
 }
 /*!
  * \brief Parameter parsing callback for /channels/{channelId}/variable.
@@ -439,11 +439,11 @@
  * \param headers HTTP headers.
  * \param[out] response Response to the HTTP request.
  */
-static void stasis_http_set_var_cb(
-    struct ast_variable *get_params, struct ast_variable *path_vars,
-    struct ast_variable *headers, struct stasis_http_response *response)
-{
-	struct ast_set_var_args args = {};
+static void stasis_http_set_channel_var_cb(
+    struct ast_variable *get_params, struct ast_variable *path_vars,
+    struct ast_variable *headers, struct stasis_http_response *response)
+{
+	struct ast_set_channel_var_args args = {};
 	struct ast_variable *i;
 
 	for (i = get_params; i; i = i->next) {
@@ -461,7 +461,7 @@
 		} else
 		{}
 	}
-	stasis_http_set_var(headers, &args, response);
+	stasis_http_set_channel_var(headers, &args, response);
 }
 
 /*! \brief REST handler for /api-docs/channels.{format} */
@@ -549,8 +549,8 @@
 static struct stasis_rest_handlers channels_channelId_variable = {
 	.path_segment = "variable",
 	.callbacks = {
-		[AST_HTTP_GET] = stasis_http_get_var_cb,
-		[AST_HTTP_POST] = stasis_http_set_var_cb,
+		[AST_HTTP_GET] = stasis_http_get_channel_var_cb,
+		[AST_HTTP_POST] = stasis_http_set_channel_var_cb,
 	},
 	.num_children = 0,
 	.children = {  }

Modified: team/qwell/ari_channel_variables/res/stasis/control.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/res/stasis/control.c?view=diff&rev=392723&r1=392722&r2=392723
==============================================================================
--- team/qwell/ari_channel_variables/res/stasis/control.c (original)
+++ team/qwell/ari_channel_variables/res/stasis/control.c Mon Jun 24 10:45:19 2013
@@ -105,7 +105,7 @@
 	stasis_app_send_command_async(control, app_control_continue, NULL);
 }
 
-char *stasis_app_control_get_var(struct stasis_app_control *control, const char *variable)
+char *stasis_app_control_get_channel_var(struct stasis_app_control *control, const char *variable)
 {
 	const char *value;
 
@@ -122,7 +122,7 @@
 	return ast_strdup(value);
 }
 
-int stasis_app_control_set_var(struct stasis_app_control *control, const char *variable, const char *value)
+int stasis_app_control_set_channel_var(struct stasis_app_control *control, const char *variable, const char *value)
 {
 	return pbx_builtin_setvar_helper(control->channel, variable, value);
 }

Modified: team/qwell/ari_channel_variables/res/stasis_http/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/res/stasis_http/resource_channels.c?view=diff&rev=392723&r1=392722&r2=392723
==============================================================================
--- team/qwell/ari_channel_variables/res/stasis_http/resource_channels.c (original)
+++ team/qwell/ari_channel_variables/res/stasis_http/resource_channels.c Mon Jun 24 10:45:19 2013
@@ -383,7 +383,7 @@
 	stasis_http_response_no_content(response);
 }
 
-void stasis_http_get_var(struct ast_variable *headers, struct ast_get_var_args *args, struct stasis_http_response *response)
+void stasis_http_get_channel_var(struct ast_variable *headers, struct ast_get_channel_var_args *args, struct stasis_http_response *response)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
@@ -396,7 +396,7 @@
 		return;
 	}
 
-	value = stasis_app_control_get_var(control, args->variable);
+	value = stasis_app_control_get_channel_var(control, args->variable);
 
 	if (!(json = ast_json_pack("{s: s}", "value", S_OR(value, "")))) {
 		stasis_http_response_alloc_failed(response);
@@ -406,7 +406,7 @@
 	stasis_http_response_ok(response, ast_json_ref(json));
 }
 
-void stasis_http_set_var(struct ast_variable *headers, struct ast_set_var_args *args, struct stasis_http_response *response)
+void stasis_http_set_channel_var(struct ast_variable *headers, struct ast_set_channel_var_args *args, struct stasis_http_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
 
@@ -417,7 +417,7 @@
 		return;
 	}
 
-	if (stasis_app_control_set_var(control, args->variable, args->value)) {
+	if (stasis_app_control_set_channel_var(control, args->variable, args->value)) {
 		stasis_http_response_error(
 			response, 500, "Internal server error",
 			"Failed to set variable");

Modified: team/qwell/ari_channel_variables/res/stasis_http/resource_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/res/stasis_http/resource_channels.h?view=diff&rev=392723&r1=392722&r2=392723
==============================================================================
--- team/qwell/ari_channel_variables/res/stasis_http/resource_channels.h (original)
+++ team/qwell/ari_channel_variables/res/stasis_http/resource_channels.h Mon Jun 24 10:45:19 2013
@@ -254,8 +254,8 @@
  * \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 Argument struct for stasis_http_get_var() */
-struct ast_get_var_args {
+/*! \brief Argument struct for stasis_http_get_channel_var() */
+struct ast_get_channel_var_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 	/*! \brief The variable to get */
@@ -268,9 +268,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void stasis_http_get_var(struct ast_variable *headers, struct ast_get_var_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_set_var() */
-struct ast_set_var_args {
+void stasis_http_get_channel_var(struct ast_variable *headers, struct ast_get_channel_var_args *args, struct stasis_http_response *response);
+/*! \brief Argument struct for stasis_http_set_channel_var() */
+struct ast_set_channel_var_args {
 	/*! \brief Channel's id */
 	const char *channel_id;
 	/*! \brief The variable to set */
@@ -285,6 +285,6 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void stasis_http_set_var(struct ast_variable *headers, struct ast_set_var_args *args, struct stasis_http_response *response);
+void stasis_http_set_channel_var(struct ast_variable *headers, struct ast_set_channel_var_args *args, struct stasis_http_response *response);
 
 #endif /* _ASTERISK_RESOURCE_CHANNELS_H */

Modified: team/qwell/ari_channel_variables/res/stasis_json/resource_sounds.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/res/stasis_json/resource_sounds.h?view=diff&rev=392723&r1=392722&r2=392723
==============================================================================
--- team/qwell/ari_channel_variables/res/stasis_json/resource_sounds.h (original)
+++ team/qwell/ari_channel_variables/res/stasis_json/resource_sounds.h Mon Jun 24 10:45:19 2013
@@ -41,10 +41,12 @@
  * JSON models
  *
  * Sound
- * - lang: string (required)
  * - text: string
  * - id: string (required)
- * - formats: List[string] (required)
+ * - formats: List[FormatLangPair] (required)
+ * FormatLangPair
+ * - language: string (required)
+ * - format: string (required)
  */
 
 #endif /* _ASTERISK_RESOURCE_SOUNDS_H */

Modified: team/qwell/ari_channel_variables/rest-api/api-docs/channels.json
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_variables/rest-api/api-docs/channels.json?view=diff&rev=392723&r1=392722&r2=392723
==============================================================================
--- team/qwell/ari_channel_variables/rest-api/api-docs/channels.json (original)
+++ team/qwell/ari_channel_variables/rest-api/api-docs/channels.json Mon Jun 24 10:45:19 2013
@@ -592,7 +592,7 @@
 				{
 					"httpMethod": "GET",
 					"summary": "Get the value of a channel variable.",
-					"nickname": "getVar",
+					"nickname": "getChannelVar",
 					"responseClass": "Variable",
 					"parameters": [
 						{
@@ -626,7 +626,7 @@
 				{
 					"httpMethod": "POST",
 					"summary": "Set the value of a channel variable.",
-					"nickname": "setVar",
+					"nickname": "setChannelVar",
 					"responseClass": "void",
 					"parameters": [
 						{




More information about the asterisk-commits mailing list