[asterisk-commits] dlee: branch dlee/stasis-http r380773 - in /team/dlee/stasis-http: cog/ inclu...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Feb 1 13:35:26 CST 2013
Author: dlee
Date: Fri Feb 1 13:35:22 2013
New Revision: 380773
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380773
Log:
Style
Modified:
team/dlee/stasis-http/cog/stasis_cog.py
team/dlee/stasis-http/include/asterisk/stasis_http_channels.h
team/dlee/stasis-http/res/stasis_http_asterisk.c
team/dlee/stasis-http/res/stasis_http_bridges.c
team/dlee/stasis-http/res/stasis_http_channels.c
team/dlee/stasis-http/res/stasis_http_endpoints.c
team/dlee/stasis-http/res/stasis_http_recordings.c
team/dlee/stasis-http/res/stasis_http_resources.c
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=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/cog/stasis_cog.py (original)
+++ team/dlee/stasis-http/cog/stasis_cog.py Fri Feb 1 13:35:22 2013
@@ -71,7 +71,8 @@
def write_callback(self, operation):
"""Writes the Operations's callback function definition
"""
- cog.outl('static void %s(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {' % operation.get_callback_name())
+ cog.outl('static void %s(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)' % operation.get_callback_name())
+ cog.outl('{')
if operation.path_parameters or operation.query_parameters:
cog.outl('\tstruct ast_variable *i;');
cog.outl('\t%s args = {};' % operation.get_args_name())
@@ -212,7 +213,8 @@
self.write_impl_stubs(child)
for operation in resource.operations.itervalues():
- cog.outl('void %s(struct ast_variable *headers, %s *args, struct stasis_http_response *response) {' % (operation.get_impl_name(), operation.get_args_name()))
+ cog.outl('void %s(struct ast_variable *headers, %s *args, struct stasis_http_response *response)' % (operation.get_impl_name(), operation.get_args_name()))
+ cog.outl('{')
cog.outl('\tast_log(LOG_ERROR, "TODO: %s\\n");' % operation.get_impl_name())
cog.outl('}')
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=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/include/asterisk/stasis_http_channels.h (original)
+++ team/dlee/stasis-http/include/asterisk/stasis_http_channels.h Fri Feb 1 13:35:22 2013
@@ -51,10 +51,6 @@
const char *channel_id;
};
struct ast_answer_channel_args {
- /*! Channel's id */
- const char *channel_id;
-};
-struct ast_hangup_channel_args {
/*! Channel's id */
const char *channel_id;
};
@@ -133,13 +129,6 @@
*/
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
Modified: team/dlee/stasis-http/res/stasis_http_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http_asterisk.c?view=diff&rev=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/res/stasis_http_asterisk.c (original)
+++ team/dlee/stasis-http/res/stasis_http_asterisk.c Fri Feb 1 13:35:22 2013
@@ -33,6 +33,7 @@
#include "asterisk/stasis_http_asterisk.h"
-void stasis_http_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct stasis_http_response *response) {
+void stasis_http_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_asterisk_info\n");
}
Modified: team/dlee/stasis-http/res/stasis_http_bridges.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http_bridges.c?view=diff&rev=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/res/stasis_http_bridges.c (original)
+++ team/dlee/stasis-http/res/stasis_http_bridges.c Fri Feb 1 13:35:22 2013
@@ -33,24 +33,31 @@
#include "asterisk/stasis_http_bridges.h"
-void stasis_http_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct stasis_http_response *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)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_add_channel_to_bridge\n");
}
-void stasis_http_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct stasis_http_response *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)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_remove_channel_from_bridge\n");
}
-void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct stasis_http_response *response) {
+void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_record_bridge\n");
}
-void stasis_http_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct stasis_http_response *response) {
+void stasis_http_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_bridge\n");
}
-void stasis_http_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct stasis_http_response *response) {
+void stasis_http_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_delete_bridge\n");
}
-void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct stasis_http_response *response) {
+void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_bridges\n");
}
-void stasis_http_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct stasis_http_response *response) {
+void stasis_http_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_new_bridge\n");
}
Modified: team/dlee/stasis-http/res/stasis_http_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http_channels.c?view=diff&rev=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/res/stasis_http_channels.c (original)
+++ team/dlee/stasis-http/res/stasis_http_channels.c Fri Feb 1 13:35:22 2013
@@ -33,41 +33,48 @@
#include "asterisk/stasis_http_channels.h"
-void stasis_http_dial(struct ast_variable *headers, struct ast_dial_args *args, struct stasis_http_response *response) {
+void stasis_http_dial(struct ast_variable *headers, struct ast_dial_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_dial\n");
}
-void stasis_http_continue_in_dialplan(struct ast_variable *headers, struct ast_continue_in_dialplan_args *args, struct stasis_http_response *response) {
+void stasis_http_continue_in_dialplan(struct ast_variable *headers, struct ast_continue_in_dialplan_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_continue_in_dialplan\n");
}
-void stasis_http_reject_channel(struct ast_variable *headers, struct ast_reject_channel_args *args, struct stasis_http_response *response) {
+void stasis_http_reject_channel(struct ast_variable *headers, struct ast_reject_channel_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_reject_channel\n");
}
-void stasis_http_answer_channel(struct ast_variable *headers, struct ast_answer_channel_args *args, struct stasis_http_response *response) {
+void stasis_http_answer_channel(struct ast_variable *headers, struct ast_answer_channel_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_answer_channel\n");
}
-void stasis_http_hangup_channel(struct ast_variable *headers, struct ast_hangup_channel_args *args, struct stasis_http_response *response) {
- ast_log(LOG_ERROR, "TODO: stasis_http_hangup_channel\n");
-}
-void stasis_http_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct stasis_http_response *response) {
+void stasis_http_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_mute_channel\n");
}
-void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct stasis_http_response *response) {
+void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_unmute_channel\n");
}
-void stasis_http_record_channel(struct ast_variable *headers, struct ast_record_channel_args *args, struct stasis_http_response *response) {
+void stasis_http_record_channel(struct ast_variable *headers, struct ast_record_channel_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_record_channel\n");
}
-void stasis_http_get_channel(struct ast_variable *headers, struct ast_get_channel_args *args, struct stasis_http_response *response) {
+void stasis_http_get_channel(struct ast_variable *headers, struct ast_get_channel_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_channel\n");
}
-void stasis_http_delete_channel(struct ast_variable *headers, struct ast_delete_channel_args *args, struct stasis_http_response *response) {
+void stasis_http_delete_channel(struct ast_variable *headers, struct ast_delete_channel_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_delete_channel\n");
}
-void stasis_http_get_channels(struct ast_variable *headers, struct ast_get_channels_args *args, struct stasis_http_response *response) {
+void stasis_http_get_channels(struct ast_variable *headers, struct ast_get_channels_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_channels\n");
}
-
-void stasis_http_originate(struct ast_variable *headers, struct ast_originate_args *args, struct stasis_http_response *response) {
+void stasis_http_originate(struct ast_variable *headers, struct ast_originate_args *args, struct stasis_http_response *response)
+{
if (args->endpoint) {
ast_log(LOG_DEBUG, "Dialing specific endpoint %s\n", args->endpoint);
}
Modified: team/dlee/stasis-http/res/stasis_http_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http_endpoints.c?view=diff&rev=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/res/stasis_http_endpoints.c (original)
+++ team/dlee/stasis-http/res/stasis_http_endpoints.c Fri Feb 1 13:35:22 2013
@@ -33,9 +33,11 @@
#include "asterisk/stasis_http_endpoints.h"
-void stasis_http_get_endpoint(struct ast_variable *headers, struct ast_get_endpoint_args *args, struct stasis_http_response *response) {
+void stasis_http_get_endpoint(struct ast_variable *headers, struct ast_get_endpoint_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_endpoint\n");
}
-void stasis_http_get_endpoints(struct ast_variable *headers, struct ast_get_endpoints_args *args, struct stasis_http_response *response) {
+void stasis_http_get_endpoints(struct ast_variable *headers, struct ast_get_endpoints_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_endpoints\n");
}
Modified: team/dlee/stasis-http/res/stasis_http_recordings.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http_recordings.c?view=diff&rev=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/res/stasis_http_recordings.c (original)
+++ team/dlee/stasis-http/res/stasis_http_recordings.c Fri Feb 1 13:35:22 2013
@@ -33,27 +33,35 @@
#include "asterisk/stasis_http_recordings.h"
-void stasis_http_stop_recording(struct ast_variable *headers, struct ast_stop_recording_args *args, struct stasis_http_response *response) {
+void stasis_http_stop_recording(struct ast_variable *headers, struct ast_stop_recording_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_stop_recording\n");
}
-void stasis_http_pause_recording(struct ast_variable *headers, struct ast_pause_recording_args *args, struct stasis_http_response *response) {
+void stasis_http_pause_recording(struct ast_variable *headers, struct ast_pause_recording_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_pause_recording\n");
}
-void stasis_http_unpause_recording(struct ast_variable *headers, struct ast_unpause_recording_args *args, struct stasis_http_response *response) {
+void stasis_http_unpause_recording(struct ast_variable *headers, struct ast_unpause_recording_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_unpause_recording\n");
}
-void stasis_http_mute_recording(struct ast_variable *headers, struct ast_mute_recording_args *args, struct stasis_http_response *response) {
+void stasis_http_mute_recording(struct ast_variable *headers, struct ast_mute_recording_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_mute_recording\n");
}
-void stasis_http_unmute_recording(struct ast_variable *headers, struct ast_unmute_recording_args *args, struct stasis_http_response *response) {
+void stasis_http_unmute_recording(struct ast_variable *headers, struct ast_unmute_recording_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_unmute_recording\n");
}
-void stasis_http_get_recording(struct ast_variable *headers, struct ast_get_recording_args *args, struct stasis_http_response *response) {
+void stasis_http_get_recording(struct ast_variable *headers, struct ast_get_recording_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_recording\n");
}
-void stasis_http_delete_recording(struct ast_variable *headers, struct ast_delete_recording_args *args, struct stasis_http_response *response) {
+void stasis_http_delete_recording(struct ast_variable *headers, struct ast_delete_recording_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_delete_recording\n");
}
-void stasis_http_get_recordings(struct ast_variable *headers, struct ast_get_recordings_args *args, struct stasis_http_response *response) {
+void stasis_http_get_recordings(struct ast_variable *headers, struct ast_get_recordings_args *args, struct stasis_http_response *response)
+{
ast_log(LOG_ERROR, "TODO: stasis_http_get_recordings\n");
}
Modified: team/dlee/stasis-http/res/stasis_http_resources.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http_resources.c?view=diff&rev=380773&r1=380772&r2=380773
==============================================================================
--- team/dlee/stasis-http/res/stasis_http_resources.c (original)
+++ team/dlee/stasis-http/res/stasis_http_resources.c Fri Feb 1 13:35:22 2013
@@ -49,7 +49,8 @@
#include <inttypes.h>
#include <strings.h>
-static void stasis_http_get_asterisk_info_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_get_asterisk_info_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_get_asterisk_info_args args = {};
@@ -61,7 +62,8 @@
stasis_http_get_asterisk_info(headers, &args, response);
}
-static void stasis_http_get_endpoint_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_get_endpoint_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_get_endpoint_args args = {};
@@ -73,7 +75,8 @@
stasis_http_get_endpoint(headers, &args, response);
}
-static void stasis_http_get_endpoints_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_get_endpoints_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_get_endpoints_args args = {};
@@ -85,7 +88,8 @@
stasis_http_get_endpoints(headers, &args, response);
}
-static void stasis_http_dial_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_dial_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_dial_args args = {};
@@ -103,7 +107,8 @@
stasis_http_dial(headers, &args, response);
}
-static void stasis_http_continue_in_dialplan_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_continue_in_dialplan_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_continue_in_dialplan_args args = {};
@@ -115,7 +120,8 @@
stasis_http_continue_in_dialplan(headers, &args, response);
}
-static void stasis_http_reject_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_reject_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_reject_channel_args args = {};
@@ -127,7 +133,8 @@
stasis_http_reject_channel(headers, &args, response);
}
-static void stasis_http_answer_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_answer_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_answer_channel_args args = {};
@@ -139,21 +146,28 @@
stasis_http_answer_channel(headers, &args, response);
}
-static void stasis_http_hangup_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_hangup_channel_args args = {};
+static void stasis_http_mute_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_mute_channel_args args = {};
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "channelId") == 0) {
args.channel_id = i->value;
}
}
- stasis_http_hangup_channel(headers, &args, response);
-}
-
-static void stasis_http_mute_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_mute_channel_args args = {};
+ for (i = get_params; i; i = i->next) {
+ if (strcmp(i->name, "direction") == 0) {
+ args.direction = i->value;
+ }
+ }
+ stasis_http_mute_channel(headers, &args, response);
+}
+
+static void stasis_http_unmute_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_unmute_channel_args args = {};
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "channelId") == 0) {
@@ -165,12 +179,13 @@
args.direction = i->value;
}
}
- stasis_http_mute_channel(headers, &args, response);
-}
-
-static void stasis_http_unmute_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_unmute_channel_args args = {};
+ stasis_http_unmute_channel(headers, &args, response);
+}
+
+static void stasis_http_record_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_record_channel_args args = {};
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "channelId") == 0) {
@@ -178,22 +193,126 @@
}
}
for (i = get_params; i; i = i->next) {
- if (strcmp(i->name, "direction") == 0) {
- args.direction = i->value;
- }
- }
- stasis_http_unmute_channel(headers, &args, response);
-}
-
-static void stasis_http_record_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_record_channel_args args = {};
+ if (strcmp(i->name, "name") == 0) {
+ args.name = i->value;
+ }
+ if (strcmp(i->name, "maxDurationSeconds") == 0) {
+ args.max_duration_seconds = strtol(i->value, NULL, 0);
+ }
+ if (strcmp(i->name, "maxSilenceSeconds") == 0) {
+ args.max_silence_seconds = strtol(i->value, NULL, 0);
+ }
+ if (strcmp(i->name, "append") == 0) {
+ args.append = ast_true(i->value);
+ }
+ if (strcmp(i->name, "beep") == 0) {
+ args.beep = ast_true(i->value);
+ }
+ if (strcmp(i->name, "terminateOn") == 0) {
+ args.terminate_on = i->value;
+ }
+ }
+ stasis_http_record_channel(headers, &args, response);
+}
+
+static void stasis_http_get_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_get_channel_args args = {};
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "channelId") == 0) {
args.channel_id = i->value;
}
}
+ stasis_http_get_channel(headers, &args, response);
+}
+
+static void stasis_http_delete_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_delete_channel_args args = {};
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = i->value;
+ }
+ }
+ stasis_http_delete_channel(headers, &args, response);
+}
+
+static void stasis_http_get_channels_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_get_channels_args args = {};
+
+ stasis_http_get_channels(headers, &args, response);
+}
+
+static void stasis_http_originate_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_originate_args args = {};
+
+ for (i = get_params; i; i = i->next) {
+ if (strcmp(i->name, "endpoint") == 0) {
+ args.endpoint = i->value;
+ }
+ if (strcmp(i->name, "extension") == 0) {
+ args.extension = i->value;
+ }
+ if (strcmp(i->name, "context") == 0) {
+ args.context = i->value;
+ }
+ }
+ stasis_http_originate(headers, &args, response);
+}
+
+static void stasis_http_add_channel_to_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_add_channel_to_bridge_args args = {};
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = i->value;
+ }
+ }
+ for (i = get_params; i; i = i->next) {
+ if (strcmp(i->name, "channel") == 0) {
+ args.channel = i->value;
+ }
+ }
+ stasis_http_add_channel_to_bridge(headers, &args, response);
+}
+
+static void stasis_http_remove_channel_from_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_remove_channel_from_bridge_args args = {};
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = i->value;
+ }
+ }
+ for (i = get_params; i; i = i->next) {
+ if (strcmp(i->name, "channel") == 0) {
+ args.channel = i->value;
+ }
+ }
+ stasis_http_remove_channel_from_bridge(headers, &args, response);
+}
+
+static void stasis_http_record_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_record_bridge_args args = {};
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = i->value;
+ }
+ }
for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "name") == 0) {
args.name = i->value;
@@ -214,160 +333,51 @@
args.terminate_on = i->value;
}
}
- stasis_http_record_channel(headers, &args, response);
-}
-
-static void stasis_http_get_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_get_channel_args args = {};
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = i->value;
- }
- }
- stasis_http_get_channel(headers, &args, response);
-}
-
-static void stasis_http_delete_channel_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_delete_channel_args args = {};
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = i->value;
- }
- }
- stasis_http_delete_channel(headers, &args, response);
-}
-
-static void stasis_http_get_channels_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_get_channels_args args = {};
-
- stasis_http_get_channels(headers, &args, response);
-}
-
-static void stasis_http_originate_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_originate_args args = {};
-
- for (i = get_params; i; i = i->next) {
- if (strcmp(i->name, "endpoint") == 0) {
- args.endpoint = i->value;
- }
- if (strcmp(i->name, "extension") == 0) {
- args.extension = i->value;
- }
- if (strcmp(i->name, "context") == 0) {
- args.context = i->value;
- }
- }
- stasis_http_originate(headers, &args, response);
-}
-
-static void stasis_http_add_channel_to_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_add_channel_to_bridge_args args = {};
+ stasis_http_record_bridge(headers, &args, response);
+}
+
+static void stasis_http_get_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_get_bridge_args args = {};
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "bridgeId") == 0) {
args.bridge_id = i->value;
}
}
- for (i = get_params; i; i = i->next) {
- if (strcmp(i->name, "channel") == 0) {
- args.channel = i->value;
- }
- }
- stasis_http_add_channel_to_bridge(headers, &args, response);
-}
-
-static void stasis_http_remove_channel_from_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_remove_channel_from_bridge_args args = {};
+ stasis_http_get_bridge(headers, &args, response);
+}
+
+static void stasis_http_delete_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
+ struct ast_variable *i;
+ struct ast_delete_bridge_args args = {};
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "bridgeId") == 0) {
args.bridge_id = i->value;
}
}
- for (i = get_params; i; i = i->next) {
- if (strcmp(i->name, "channel") == 0) {
- args.channel = i->value;
- }
- }
- stasis_http_remove_channel_from_bridge(headers, &args, response);
-}
-
-static void stasis_http_record_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_record_bridge_args args = {};
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = i->value;
- }
- }
- for (i = get_params; i; i = i->next) {
- if (strcmp(i->name, "name") == 0) {
- args.name = i->value;
- }
- if (strcmp(i->name, "maxDurationSeconds") == 0) {
- args.max_duration_seconds = strtol(i->value, NULL, 0);
- }
- if (strcmp(i->name, "maxSilenceSeconds") == 0) {
- args.max_silence_seconds = strtol(i->value, NULL, 0);
- }
- if (strcmp(i->name, "append") == 0) {
- args.append = ast_true(i->value);
- }
- if (strcmp(i->name, "beep") == 0) {
- args.beep = ast_true(i->value);
- }
- if (strcmp(i->name, "terminateOn") == 0) {
- args.terminate_on = i->value;
- }
- }
- stasis_http_record_bridge(headers, &args, response);
-}
-
-static void stasis_http_get_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_get_bridge_args args = {};
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = i->value;
- }
- }
- stasis_http_get_bridge(headers, &args, response);
-}
-
-static void stasis_http_delete_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
- struct ast_variable *i;
- struct ast_delete_bridge_args args = {};
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = i->value;
- }
- }
stasis_http_delete_bridge(headers, &args, response);
}
-static void stasis_http_get_bridges_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_get_bridges_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_get_bridges_args args = {};
stasis_http_get_bridges(headers, &args, response);
}
-static void stasis_http_new_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_new_bridge_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_new_bridge_args args = {};
stasis_http_new_bridge(headers, &args, response);
}
-static void stasis_http_stop_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_stop_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_stop_recording_args args = {};
@@ -379,7 +389,8 @@
stasis_http_stop_recording(headers, &args, response);
}
-static void stasis_http_pause_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_pause_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_pause_recording_args args = {};
@@ -391,7 +402,8 @@
stasis_http_pause_recording(headers, &args, response);
}
-static void stasis_http_unpause_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_unpause_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_unpause_recording_args args = {};
@@ -403,7 +415,8 @@
stasis_http_unpause_recording(headers, &args, response);
}
-static void stasis_http_mute_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_mute_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_mute_recording_args args = {};
@@ -415,7 +428,8 @@
stasis_http_mute_recording(headers, &args, response);
}
-static void stasis_http_unmute_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_unmute_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_unmute_recording_args args = {};
@@ -427,7 +441,8 @@
stasis_http_unmute_recording(headers, &args, response);
}
-static void stasis_http_get_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_get_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_get_recording_args args = {};
@@ -439,7 +454,8 @@
stasis_http_get_recording(headers, &args, response);
}
-static void stasis_http_delete_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_delete_recording_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_variable *i;
struct ast_delete_recording_args args = {};
@@ -451,7 +467,8 @@
stasis_http_delete_recording(headers, &args, response);
}
-static void stasis_http_get_recordings_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response) {
+static void stasis_http_get_recordings_cb(struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct stasis_http_response *response)
+{
struct ast_get_recordings_args args = {};
stasis_http_get_recordings(headers, &args, response);
@@ -529,15 +546,6 @@
.children = { },
};
-static struct stasis_rest_handlers stasis_api_channels_channelId_hangup = {
- .path_segment = "hangup",
- .callbacks = {
- [AST_HTTP_POST] = stasis_http_hangup_channel_cb,
- },
- .num_children = 0,
- .children = { },
-};
-
static struct stasis_rest_handlers stasis_api_channels_channelId_mute = {
.path_segment = "mute",
.callbacks = {
@@ -572,8 +580,8 @@
[AST_HTTP_GET] = stasis_http_get_channel_cb,
[AST_HTTP_DELETE] = stasis_http_delete_channel_cb,
},
- .num_children = 8,
- .children = { &stasis_api_channels_channelId_dial, &stasis_api_channels_channelId_continue, &stasis_api_channels_channelId_reject, &stasis_api_channels_channelId_answer, &stasis_api_channels_channelId_hangup, &stasis_api_channels_channelId_mute, &stasis_api_channels_channelId_unmute, &stasis_api_channels_channelId_record, },
+ .num_children = 7,
+ .children = { &stasis_api_channels_channelId_dial, &stasis_api_channels_channelId_continue, &stasis_api_channels_channelId_reject, &stasis_api_channels_channelId_answer, &stasis_api_channels_channelId_mute, &stasis_api_channels_channelId_unmute, &stasis_api_channels_channelId_record, },
};
static struct stasis_rest_handlers stasis_api_channels = {
More information about the asterisk-commits
mailing list