[asterisk-commits] file: branch file/stasis-tweaking r400693 - in /team/file/stasis-tweaking: in...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Oct 8 13:16:42 CDT 2013
Author: file
Date: Tue Oct 8 13:16:40 2013
New Revision: 400693
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400693
Log:
For kicks... add the ability to send DTMF to a channel and some indications (ringing/busy/congestion).
Modified:
team/file/stasis-tweaking/include/asterisk/stasis_app.h
team/file/stasis-tweaking/res/ari/resource_channels.c
team/file/stasis-tweaking/res/ari/resource_channels.h
team/file/stasis-tweaking/res/res_ari_channels.c
team/file/stasis-tweaking/res/stasis/control.c
team/file/stasis-tweaking/rest-api/api-docs/channels.json
Modified: team/file/stasis-tweaking/include/asterisk/stasis_app.h
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis-tweaking/include/asterisk/stasis_app.h?view=diff&rev=400693&r1=400692&r2=400693
==============================================================================
--- team/file/stasis-tweaking/include/asterisk/stasis_app.h (original)
+++ team/file/stasis-tweaking/include/asterisk/stasis_app.h Tue Oct 8 13:16:40 2013
@@ -272,6 +272,19 @@
int stasis_app_control_continue(struct stasis_app_control *control, const char *context, const char *extension, int priority);
/*!
+ * \brief Send DTMF to the channel associated with this control.
+ *
+ * \param control Control for \c res_stasis.
+ * \param dtmf DTMF string.
+ * \param between Amount of time between each DTMF digit.
+ * \param duration Amount of time each DTMF digit lasts for.
+ *
+ * \return 0 for success.
+ * \return -1 for error.
+ */
+int stasis_app_control_dtmf(struct stasis_app_control *control, const char *dtmf, int between, unsigned int duration);
+
+/*!
* \brief Mute the channel associated with this control.
*
* \param control Control for \c res_stasis.
@@ -304,6 +317,24 @@
int stasis_app_control_answer(struct stasis_app_control *control);
/*!
+ * \brief Indicate ringing to the channel associated with this control.
+ * \param control Control for \c res_stasis.
+ */
+void stasis_app_control_ring(struct stasis_app_control *control);
+
+/*!
+ * \brief Indicate busy to the channel associated with this control.
+ * \param control Control for \c res_stasis.
+ */
+void stasis_app_control_busy(struct stasis_app_control *control);
+
+/*!
+ * \brief Indicate congestion to the channel associated with this control.
+ * \param control Control for \c res_stasis.
+ */
+void stasis_app_control_congestion(struct stasis_app_control *control);
+
+/*!
* \brief Get the value of a variable on the channel associated with this control.
* \param control Control for \c res_stasis.
* \param variable The name of the variable.
Modified: team/file/stasis-tweaking/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis-tweaking/res/ari/resource_channels.c?view=diff&rev=400693&r1=400692&r2=400693
==============================================================================
--- team/file/stasis-tweaking/res/ari/resource_channels.c (original)
+++ team/file/stasis-tweaking/res/ari/resource_channels.c Tue Oct 8 13:16:40 2013
@@ -137,6 +137,64 @@
"Failed to answer channel");
return;
}
+
+ 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)
+{
+ RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
+
+ control = find_control(response, args->channel_id);
+ if (control == NULL) {
+ return;
+ }
+
+ stasis_app_control_ring(control);
+
+ ast_ari_response_no_content(response);
+}
+
+void ast_ari_busy_channel(struct ast_variable *headers, struct ast_busy_channel_args *args, struct ast_ari_response *response)
+{
+ RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
+
+ control = find_control(response, args->channel_id);
+ if (control == NULL) {
+ return;
+ }
+
+ stasis_app_control_busy(control);
+
+ ast_ari_response_no_content(response);
+}
+
+void ast_ari_congestion_channel(struct ast_variable *headers, struct ast_congestion_channel_args *args, struct ast_ari_response *response)
+{
+ RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
+
+ control = find_control(response, args->channel_id);
+ if (control == NULL) {
+ return;
+ }
+
+ stasis_app_control_congestion(control);
+
+ 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)
+{
+ RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
+
+ control = find_control(response, args->channel_id);
+ if (control == NULL) {
+ return;
+ }
+
+ stasis_app_control_dtmf(control, args->dtmf, args->between, args->duration);
ast_ari_response_no_content(response);
}
Modified: team/file/stasis-tweaking/res/ari/resource_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis-tweaking/res/ari/resource_channels.h?view=diff&rev=400693&r1=400692&r2=400693
==============================================================================
--- team/file/stasis-tweaking/res/ari/resource_channels.h (original)
+++ team/file/stasis-tweaking/res/ari/resource_channels.h Tue Oct 8 13:16:40 2013
@@ -160,6 +160,64 @@
* \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 {
+ /*! \brief Channel's id */
+ const char *channel_id;
+};
+/*!
+ * \brief Indicate ringing to a channel.
+ *
+ * \param headers HTTP headers
+ * \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_busy_channel() */
+struct ast_busy_channel_args {
+ /*! \brief Channel's id */
+ const char *channel_id;
+};
+/*!
+ * \brief Indicate busy to a channel.
+ *
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
+void ast_ari_busy_channel(struct ast_variable *headers, struct ast_busy_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_congestion_channel() */
+struct ast_congestion_channel_args {
+ /*! \brief Channel's id */
+ const char *channel_id;
+};
+/*!
+ * \brief Indicate congestion to a channel.
+ *
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ * \param[out] response HTTP response
+ */
+void ast_ari_congestion_channel(struct ast_variable *headers, struct ast_congestion_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_send_dtmfchannel() */
+struct ast_send_dtmfchannel_args {
+ /*! \brief Channel's id */
+ const char *channel_id;
+ /*! \brief DTMF To send. */
+ const char *dtmf;
+ /*! \brief Amount of time in between DTMF digits (specified in milliseconds). */
+ int between;
+ /*! \brief Length of each DTMF digit (specified in milliseconds). */
+ int duration;
+};
+/*!
+ * \brief Send provided DTMF to a given channel.
+ *
+ * \param headers HTTP headers
+ * \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 {
/*! \brief Channel's id */
Modified: team/file/stasis-tweaking/res/res_ari_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis-tweaking/res/res_ari_channels.c?view=diff&rev=400693&r1=400692&r2=400693
==============================================================================
--- team/file/stasis-tweaking/res/res_ari_channels.c (original)
+++ team/file/stasis-tweaking/res/res_ari_channels.c Tue Oct 8 13:16:40 2013
@@ -497,6 +497,250 @@
return;
}
/*!
+ * \brief Parameter parsing callback for /channels/{channelId}/ring.
+ * \param get_params GET parameters in the HTTP request.
+ * \param path_vars Path variables extracted from the request.
+ * \param headers HTTP headers.
+ * \param[out] response Response to the HTTP request.
+ */
+static void ast_ari_ring_channel_cb(
+ struct ast_variable *get_params, struct ast_variable *path_vars,
+ struct ast_variable *headers, struct ast_ari_response *response)
+{
+ struct ast_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_ring_channel(headers, &args, response);
+#if defined(AST_DEVMODE)
+ code = response->response_code;
+
+ switch (code) {
+ case 0: /* Implementation is still a stub, or the code wasn't set */
+ is_valid = response->message == NULL;
+ break;
+ case 500: /* Internal Server Error */
+ case 501: /* Not Implemented */
+ case 404: /* Channel not found */
+ case 409: /* Channel not in a Stasis application */
+ is_valid = 1;
+ break;
+ default:
+ if (200 <= code && code <= 299) {
+ is_valid = ast_ari_validate_void(
+ response->message);
+ } else {
+ ast_log(LOG_ERROR, "Invalid error response %d for /channels/{channelId}/ring\n", code);
+ is_valid = 0;
+ }
+ }
+
+ if (!is_valid) {
+ ast_log(LOG_ERROR, "Response validation failed for /channels/{channelId}/ring\n");
+ ast_ari_response_error(response, 500,
+ "Internal Server Error", "Response validation failed");
+ }
+#endif /* AST_DEVMODE */
+
+fin: __attribute__((unused))
+ return;
+}
+/*!
+ * \brief Parameter parsing callback for /channels/{channelId}/busy.
+ * \param get_params GET parameters in the HTTP request.
+ * \param path_vars Path variables extracted from the request.
+ * \param headers HTTP headers.
+ * \param[out] response Response to the HTTP request.
+ */
+static void ast_ari_busy_channel_cb(
+ struct ast_variable *get_params, struct ast_variable *path_vars,
+ struct ast_variable *headers, struct ast_ari_response *response)
+{
+ struct ast_busy_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_busy_channel(headers, &args, response);
+#if defined(AST_DEVMODE)
+ code = response->response_code;
+
+ switch (code) {
+ case 0: /* Implementation is still a stub, or the code wasn't set */
+ is_valid = response->message == NULL;
+ break;
+ case 500: /* Internal Server Error */
+ case 501: /* Not Implemented */
+ case 404: /* Channel not found */
+ case 409: /* Channel not in a Stasis application */
+ is_valid = 1;
+ break;
+ default:
+ if (200 <= code && code <= 299) {
+ is_valid = ast_ari_validate_void(
+ response->message);
+ } else {
+ ast_log(LOG_ERROR, "Invalid error response %d for /channels/{channelId}/busy\n", code);
+ is_valid = 0;
+ }
+ }
+
+ if (!is_valid) {
+ ast_log(LOG_ERROR, "Response validation failed for /channels/{channelId}/busy\n");
+ ast_ari_response_error(response, 500,
+ "Internal Server Error", "Response validation failed");
+ }
+#endif /* AST_DEVMODE */
+
+fin: __attribute__((unused))
+ return;
+}
+/*!
+ * \brief Parameter parsing callback for /channels/{channelId}/congestion.
+ * \param get_params GET parameters in the HTTP request.
+ * \param path_vars Path variables extracted from the request.
+ * \param headers HTTP headers.
+ * \param[out] response Response to the HTTP request.
+ */
+static void ast_ari_congestion_channel_cb(
+ struct ast_variable *get_params, struct ast_variable *path_vars,
+ struct ast_variable *headers, struct ast_ari_response *response)
+{
+ struct ast_congestion_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_congestion_channel(headers, &args, response);
+#if defined(AST_DEVMODE)
+ code = response->response_code;
+
+ switch (code) {
+ case 0: /* Implementation is still a stub, or the code wasn't set */
+ is_valid = response->message == NULL;
+ break;
+ case 500: /* Internal Server Error */
+ case 501: /* Not Implemented */
+ case 404: /* Channel not found */
+ case 409: /* Channel not in a Stasis application */
+ is_valid = 1;
+ break;
+ default:
+ if (200 <= code && code <= 299) {
+ is_valid = ast_ari_validate_void(
+ response->message);
+ } else {
+ ast_log(LOG_ERROR, "Invalid error response %d for /channels/{channelId}/congestion\n", code);
+ is_valid = 0;
+ }
+ }
+
+ if (!is_valid) {
+ ast_log(LOG_ERROR, "Response validation failed for /channels/{channelId}/congestion\n");
+ ast_ari_response_error(response, 500,
+ "Internal Server Error", "Response validation failed");
+ }
+#endif /* AST_DEVMODE */
+
+fin: __attribute__((unused))
+ return;
+}
+/*!
+ * \brief Parameter parsing callback for /channels/{channelId}/dtmf.
+ * \param get_params GET parameters in the HTTP request.
+ * \param path_vars Path variables extracted from the request.
+ * \param headers HTTP headers.
+ * \param[out] response Response to the HTTP request.
+ */
+static void ast_ari_send_dtmfchannel_cb(
+ struct ast_variable *get_params, struct ast_variable *path_vars,
+ struct ast_variable *headers, struct ast_ari_response *response)
+{
+ struct ast_send_dtmfchannel_args args = {};
+ struct ast_variable *i;
+#if defined(AST_DEVMODE)
+ int is_valid;
+ int code;
+#endif /* AST_DEVMODE */
+
+ for (i = get_params; i; i = i->next) {
+ if (strcmp(i->name, "dtmf") == 0) {
+ args.dtmf = (i->value);
+ } else
+ if (strcmp(i->name, "between") == 0) {
+ args.between = atoi(i->value);
+ } else
+ if (strcmp(i->name, "duration") == 0) {
+ args.duration = atoi(i->value);
+ } else
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
+ ast_ari_send_dtmfchannel(headers, &args, response);
+#if defined(AST_DEVMODE)
+ code = response->response_code;
+
+ switch (code) {
+ case 0: /* Implementation is still a stub, or the code wasn't set */
+ is_valid = response->message == NULL;
+ break;
+ case 500: /* Internal Server Error */
+ case 501: /* Not Implemented */
+ case 404: /* Channel not found */
+ case 409: /* Channel not in a Stasis application */
+ is_valid = 1;
+ break;
+ default:
+ if (200 <= code && code <= 299) {
+ is_valid = ast_ari_validate_void(
+ response->message);
+ } else {
+ ast_log(LOG_ERROR, "Invalid error response %d for /channels/{channelId}/dtmf\n", code);
+ is_valid = 0;
+ }
+ }
+
+ if (!is_valid) {
+ ast_log(LOG_ERROR, "Response validation failed for /channels/{channelId}/dtmf\n");
+ ast_ari_response_error(response, 500,
+ "Internal Server Error", "Response validation failed");
+ }
+#endif /* AST_DEVMODE */
+
+fin: __attribute__((unused))
+ return;
+}
+/*!
* \brief Parameter parsing callback for /channels/{channelId}/mute.
* \param get_params GET parameters in the HTTP request.
* \param path_vars Path variables extracted from the request.
@@ -1183,6 +1427,42 @@
.children = { }
};
/*! \brief REST handler for /api-docs/channels.{format} */
+static struct stasis_rest_handlers channels_channelId_ring = {
+ .path_segment = "ring",
+ .callbacks = {
+ [AST_HTTP_POST] = ast_ari_ring_channel_cb,
+ },
+ .num_children = 0,
+ .children = { }
+};
+/*! \brief REST handler for /api-docs/channels.{format} */
+static struct stasis_rest_handlers channels_channelId_busy = {
+ .path_segment = "busy",
+ .callbacks = {
+ [AST_HTTP_POST] = ast_ari_busy_channel_cb,
+ },
+ .num_children = 0,
+ .children = { }
+};
+/*! \brief REST handler for /api-docs/channels.{format} */
+static struct stasis_rest_handlers channels_channelId_congestion = {
+ .path_segment = "congestion",
+ .callbacks = {
+ [AST_HTTP_POST] = ast_ari_congestion_channel_cb,
+ },
+ .num_children = 0,
+ .children = { }
+};
+/*! \brief REST handler for /api-docs/channels.{format} */
+static struct stasis_rest_handlers channels_channelId_dtmf = {
+ .path_segment = "dtmf",
+ .callbacks = {
+ [AST_HTTP_POST] = ast_ari_send_dtmfchannel_cb,
+ },
+ .num_children = 0,
+ .children = { }
+};
+/*! \brief REST handler for /api-docs/channels.{format} */
static struct stasis_rest_handlers channels_channelId_mute = {
.path_segment = "mute",
.callbacks = {
@@ -1272,8 +1552,8 @@
[AST_HTTP_GET] = ast_ari_get_channel_cb,
[AST_HTTP_DELETE] = ast_ari_delete_channel_cb,
},
- .num_children = 12,
- .children = { &channels_channelId_dial,&channels_channelId_continue,&channels_channelId_answer,&channels_channelId_mute,&channels_channelId_unmute,&channels_channelId_hold,&channels_channelId_unhold,&channels_channelId_mohstart,&channels_channelId_mohstop,&channels_channelId_play,&channels_channelId_record,&channels_channelId_variable, }
+ .num_children = 16,
+ .children = { &channels_channelId_dial,&channels_channelId_continue,&channels_channelId_answer,&channels_channelId_ring,&channels_channelId_busy,&channels_channelId_congestion,&channels_channelId_dtmf,&channels_channelId_mute,&channels_channelId_unmute,&channels_channelId_hold,&channels_channelId_unhold,&channels_channelId_mohstart,&channels_channelId_mohstop,&channels_channelId_play,&channels_channelId_record,&channels_channelId_variable, }
};
/*! \brief REST handler for /api-docs/channels.{format} */
static struct stasis_rest_handlers channels = {
Modified: team/file/stasis-tweaking/res/stasis/control.c
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis-tweaking/res/stasis/control.c?view=diff&rev=400693&r1=400692&r2=400693
==============================================================================
--- team/file/stasis-tweaking/res/stasis/control.c (original)
+++ team/file/stasis-tweaking/res/stasis/control.c Tue Oct 8 13:16:40 2013
@@ -38,6 +38,7 @@
#include "asterisk/frame.h"
#include "asterisk/pbx.h"
#include "asterisk/musiconhold.h"
+#include "asterisk/app.h"
struct stasis_app_control {
ast_cond_t wait_cond;
@@ -280,6 +281,39 @@
return 0;
}
+struct stasis_app_control_dtmf_data {
+ int between;
+ unsigned int duration;
+ char dtmf[];
+};
+
+static void *app_control_dtmf(struct stasis_app_control *control,
+ struct ast_channel *chan, void *data)
+{
+ RAII_VAR(struct stasis_app_control_dtmf_data *, dtmf_data, data, ast_free);
+
+ ast_dtmf_stream(chan, NULL, dtmf_data->dtmf, dtmf_data->between, dtmf_data->duration);
+
+ return NULL;
+}
+
+int stasis_app_control_dtmf(struct stasis_app_control *control, const char *dtmf, int between, unsigned int duration)
+{
+ struct stasis_app_control_dtmf_data *dtmf_data;
+
+ if (!(dtmf_data = ast_calloc(1, sizeof(*dtmf_data) + strlen(dtmf) + 1))) {
+ return -1;
+ }
+
+ dtmf_data->between = between;
+ dtmf_data->duration = duration;
+ strcpy(dtmf_data->dtmf, dtmf);
+
+ stasis_app_send_command_async(control, app_control_dtmf, dtmf_data);
+
+ return 0;
+}
+
struct stasis_app_control_mute_data {
enum ast_frame_type frametype;
unsigned int direction;
@@ -337,6 +371,45 @@
stasis_app_send_command_async(control, app_control_unmute, mute_data);
return 0;
+}
+
+static void *app_control_ring(struct stasis_app_control *control,
+ struct ast_channel *chan, void *data)
+{
+ ast_indicate(control->channel, AST_CONTROL_RINGING);
+
+ return NULL;
+}
+
+void stasis_app_control_ring(struct stasis_app_control *control)
+{
+ stasis_app_send_command_async(control, app_control_ring, NULL);
+}
+
+static void *app_control_busy(struct stasis_app_control *control,
+ struct ast_channel *chan, void *data)
+{
+ ast_indicate(control->channel, AST_CONTROL_BUSY);
+
+ return NULL;
+}
+
+void stasis_app_control_busy(struct stasis_app_control *control)
+{
+ stasis_app_send_command_async(control, app_control_busy, NULL);
+}
+
+static void *app_control_congestion(struct stasis_app_control *control,
+ struct ast_channel *chan, void *data)
+{
+ ast_indicate(control->channel, AST_CONTROL_CONGESTION);
+
+ return NULL;
+}
+
+void stasis_app_control_congestion(struct stasis_app_control *control)
+{
+ stasis_app_send_command_async(control, app_control_congestion, NULL);
}
char *stasis_app_control_get_channel_var(struct stasis_app_control *control, const char *variable)
Modified: team/file/stasis-tweaking/rest-api/api-docs/channels.json
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis-tweaking/rest-api/api-docs/channels.json?view=diff&rev=400693&r1=400692&r2=400693
==============================================================================
--- team/file/stasis-tweaking/rest-api/api-docs/channels.json (original)
+++ team/file/stasis-tweaking/rest-api/api-docs/channels.json Tue Oct 8 13:16:40 2013
@@ -295,6 +295,160 @@
"required": true,
"allowMultiple": false,
"dataType": "string"
+ }
+ ],
+ "errorResponses": [
+ {
+ "code": 404,
+ "reason": "Channel not found"
+ },
+ {
+ "code": 409,
+ "reason": "Channel not in a Stasis application"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/channels/{channelId}/ring",
+ "description": "Indicate ringing to a channel",
+ "operations": [
+ {
+ "httpMethod": "POST",
+ "summary": "Indicate ringing to a channel.",
+ "nickname": "ringChannel",
+ "responseClass": "void",
+ "parameters": [
+ {
+ "name": "channelId",
+ "description": "Channel's id",
+ "paramType": "path",
+ "required": true,
+ "allowMultiple": false,
+ "dataType": "string"
+ }
+ ],
+ "errorResponses": [
+ {
+ "code": 404,
+ "reason": "Channel not found"
+ },
+ {
+ "code": 409,
+ "reason": "Channel not in a Stasis application"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/channels/{channelId}/busy",
+ "description": "Indicate busy to a channel",
+ "operations": [
+ {
+ "httpMethod": "POST",
+ "summary": "Indicate busy to a channel.",
+ "nickname": "busyChannel",
+ "responseClass": "void",
+ "parameters": [
+ {
+ "name": "channelId",
+ "description": "Channel's id",
+ "paramType": "path",
+ "required": true,
+ "allowMultiple": false,
+ "dataType": "string"
+ }
+ ],
+ "errorResponses": [
+ {
+ "code": 404,
+ "reason": "Channel not found"
+ },
+ {
+ "code": 409,
+ "reason": "Channel not in a Stasis application"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/channels/{channelId}/congestion",
+ "description": "Indicate congestion to a channel",
+ "operations": [
+ {
+ "httpMethod": "POST",
+ "summary": "Indicate congestion to a channel.",
+ "nickname": "congestionChannel",
+ "responseClass": "void",
+ "parameters": [
+ {
+ "name": "channelId",
+ "description": "Channel's id",
+ "paramType": "path",
+ "required": true,
+ "allowMultiple": false,
+ "dataType": "string"
+ }
+ ],
+ "errorResponses": [
+ {
+ "code": 404,
+ "reason": "Channel not found"
+ },
+ {
+ "code": 409,
+ "reason": "Channel not in a Stasis application"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/channels/{channelId}/dtmf",
+ "description": "Send DTMF to a channel",
+ "operations": [
+ {
+ "httpMethod": "POST",
+ "summary": "Send provided DTMF to a given channel.",
+ "nickname": "sendDTMFChannel",
+ "responseClass": "void",
+ "parameters": [
+ {
+ "name": "channelId",
+ "description": "Channel's id",
+ "paramType": "path",
+ "required": true,
+ "allowMultiple": false,
+ "dataType": "string"
+ },
+ {
+ "name": "dtmf",
+ "description": "DTMF To send.",
+ "paramType": "query",
+ "required": false,
+ "allowMultiple": false,
+ "dataType": "string"
+ },
+ {
+ "name": "between",
+ "description": "Amount of time in between DTMF digits (specified in milliseconds).",
+ "paramType": "query",
+ "required": false,
+ "allowMultiple": false,
+ "dataType": "int",
+ "defaultValue": 100
+ },
+ {
+ "name": "duration",
+ "description": "Length of each DTMF digit (specified in milliseconds).",
+ "paramType": "query",
+ "required": false,
+ "allowMultiple": false,
+ "dataType": "int",
+ "defaultValue": 100
}
],
"errorResponses": [
More information about the asterisk-commits
mailing list