[asterisk-commits] dlee: branch dlee/better-nicknames r402527 - in /team/dlee/better-nicknames: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 7 15:07:49 CST 2013


Author: dlee
Date: Thu Nov  7 15:07:45 2013
New Revision: 402527

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402527
Log:
Improve nicknames for new operations (ring and send_dtmf)

Modified:
    team/dlee/better-nicknames/res/ari/resource_channels.c
    team/dlee/better-nicknames/res/ari/resource_channels.h
    team/dlee/better-nicknames/res/res_ari_channels.c
    team/dlee/better-nicknames/rest-api/api-docs/channels.json

Modified: team/dlee/better-nicknames/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/res/ari/resource_channels.c?view=diff&rev=402527&r1=402526&r2=402527
==============================================================================
--- team/dlee/better-nicknames/res/ari/resource_channels.c (original)
+++ team/dlee/better-nicknames/res/ari/resource_channels.c Thu Nov  7 15:07:45 2013
@@ -124,8 +124,8 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_channels_ring_channel(struct ast_variable *headers,
-	struct ast_ari_channels_ring_channel_args *args,
+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);
@@ -216,7 +216,9 @@
 	ast_ari_response_no_content(response);
 }
 
-void ast_ari_channels_send_dtmfchannel(struct ast_variable *headers, struct ast_ari_channels_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);
 

Modified: team/dlee/better-nicknames/res/ari/resource_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/res/ari/resource_channels.h?view=diff&rev=402527&r1=402526&r2=402527
==============================================================================
--- team/dlee/better-nicknames/res/ari/resource_channels.h (original)
+++ team/dlee/better-nicknames/res/ari/resource_channels.h Thu Nov  7 15:07:45 2013
@@ -139,8 +139,8 @@
  * \param[out] response HTTP response
  */
 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_channel() */
-struct ast_ari_channels_ring_channel_args {
+/*! \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_channels_ring_channel(struct ast_variable *headers, struct ast_ari_channels_ring_channel_args *args, struct ast_ari_response *response);
-/*! \brief Argument struct for ast_ari_channels_send_dtmfchannel() */
-struct ast_ari_channels_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,7 +174,7 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_channels_send_dtmfchannel(struct ast_variable *headers, struct ast_ari_channels_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);
 /*! \brief Argument struct for ast_ari_channels_mute() */
 struct ast_ari_channels_mute_args {
 	/*! \brief Channel's id */

Modified: team/dlee/better-nicknames/res/res_ari_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/res/res_ari_channels.c?view=diff&rev=402527&r1=402526&r2=402527
==============================================================================
--- team/dlee/better-nicknames/res/res_ari_channels.c (original)
+++ team/dlee/better-nicknames/res/res_ari_channels.c Thu Nov  7 15:07:45 2013
@@ -434,24 +434,24 @@
  * \param headers HTTP headers.
  * \param[out] response Response to the HTTP request.
  */
-static void ast_ari_channels_ring_channel_cb(
-	struct ast_variable *get_params, struct ast_variable *path_vars,
-	struct ast_variable *headers, struct ast_ari_response *response)
-{
-	struct ast_ari_channels_ring_channel_args args = {};
-	struct ast_variable *i;
-#if defined(AST_DEVMODE)
-	int is_valid;
-	int code;
-#endif /* AST_DEVMODE */
-
-	for (i = path_vars; i; i = i->next) {
-		if (strcmp(i->name, "channelId") == 0) {
-			args.channel_id = (i->value);
-		} else
-		{}
-	}
-	ast_ari_channels_ring_channel(headers, &args, response);
+static void ast_ari_channels_ring_cb(
+	struct ast_variable *get_params, struct ast_variable *path_vars,
+	struct ast_variable *headers, struct ast_ari_response *response)
+{
+	struct ast_ari_channels_ring_args args = {};
+	struct ast_variable *i;
+#if defined(AST_DEVMODE)
+	int is_valid;
+	int code;
+#endif /* AST_DEVMODE */
+
+	for (i = path_vars; i; i = i->next) {
+		if (strcmp(i->name, "channelId") == 0) {
+			args.channel_id = (i->value);
+		} else
+		{}
+	}
+	ast_ari_channels_ring(headers, &args, response);
 #if defined(AST_DEVMODE)
 	code = response->response_code;
 
@@ -492,11 +492,11 @@
  * \param headers HTTP headers.
  * \param[out] response Response to the HTTP request.
  */
-static void ast_ari_channels_send_dtmfchannel_cb(
-	struct ast_variable *get_params, struct ast_variable *path_vars,
-	struct ast_variable *headers, struct ast_ari_response *response)
-{
-	struct ast_ari_channels_send_dtmfchannel_args args = {};
+static void ast_ari_channels_send_dtmf_cb(
+	struct ast_variable *get_params, struct ast_variable *path_vars,
+	struct ast_variable *headers, struct ast_ari_response *response)
+{
+	struct ast_ari_channels_send_dtmf_args args = {};
 	struct ast_variable *i;
 #if defined(AST_DEVMODE)
 	int is_valid;
@@ -527,7 +527,7 @@
 		} else
 		{}
 	}
-	ast_ari_channels_send_dtmfchannel(headers, &args, response);
+	ast_ari_channels_send_dtmf(headers, &args, response);
 #if defined(AST_DEVMODE)
 	code = response->response_code;
 
@@ -1241,7 +1241,7 @@
 static struct stasis_rest_handlers channels_channelId_ring = {
 	.path_segment = "ring",
 	.callbacks = {
-		[AST_HTTP_POST] = ast_ari_channels_ring_channel_cb,
+		[AST_HTTP_POST] = ast_ari_channels_ring_cb,
 	},
 	.num_children = 0,
 	.children = {  }
@@ -1250,7 +1250,7 @@
 static struct stasis_rest_handlers channels_channelId_dtmf = {
 	.path_segment = "dtmf",
 	.callbacks = {
-		[AST_HTTP_POST] = ast_ari_channels_send_dtmfchannel_cb,
+		[AST_HTTP_POST] = ast_ari_channels_send_dtmf_cb,
 	},
 	.num_children = 0,
 	.children = {  }

Modified: team/dlee/better-nicknames/rest-api/api-docs/channels.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/rest-api/api-docs/channels.json?view=diff&rev=402527&r1=402526&r2=402527
==============================================================================
--- team/dlee/better-nicknames/rest-api/api-docs/channels.json (original)
+++ team/dlee/better-nicknames/rest-api/api-docs/channels.json Thu Nov  7 15:07:45 2013
@@ -265,7 +265,7 @@
 				{
 					"httpMethod": "POST",
 					"summary": "Indicate ringing to a channel.",
-					"nickname": "ringChannel",
+					"nickname": "ring",
 					"responseClass": "void",
 					"parameters": [
 						{
@@ -297,7 +297,7 @@
 				{
 					"httpMethod": "POST",
 					"summary": "Send provided DTMF to a given channel.",
-					"nickname": "sendDTMFChannel",
+					"nickname": "sendDTMF",
 					"responseClass": "void",
 					"parameters": [
 						{




More information about the asterisk-commits mailing list