[asterisk-commits] dlee: branch dlee/stasis-http r386157 - in /team/dlee/stasis-http: res/ res/s...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Apr 19 16:42:32 CDT 2013
Author: dlee
Date: Fri Apr 19 16:42:29 2013
New Revision: 386157
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386157
Log:
Updates from planning
Modified:
team/dlee/stasis-http/res/res_stasis_http_asterisk.c
team/dlee/stasis-http/res/res_stasis_http_bridges.c
team/dlee/stasis-http/res/res_stasis_http_channels.c
team/dlee/stasis-http/res/res_stasis_http_endpoints.c
team/dlee/stasis-http/res/res_stasis_http_events.c
team/dlee/stasis-http/res/res_stasis_http_playback.c
team/dlee/stasis-http/res/res_stasis_http_recordings.c
team/dlee/stasis-http/res/res_stasis_http_sounds.c
team/dlee/stasis-http/res/stasis_http/resource_bridges.h
team/dlee/stasis-http/res/stasis_http/resource_channels.c
team/dlee/stasis-http/res/stasis_http/resource_channels.h
team/dlee/stasis-http/res/stasis_http/resource_sounds.h
team/dlee/stasis-http/rest-api-templates/res_stasis_http_resource.c.mustache
team/dlee/stasis-http/rest-api-templates/stasis_http_resource.h.mustache
team/dlee/stasis-http/rest-api-templates/swagger_model.py
team/dlee/stasis-http/rest-api/api-docs/bridges.json
team/dlee/stasis-http/rest-api/api-docs/channels.json
team/dlee/stasis-http/rest-api/api-docs/endpoints.json
team/dlee/stasis-http/rest-api/api-docs/recordings.json
team/dlee/stasis-http/rest-api/api-docs/sounds.json
Modified: team/dlee/stasis-http/res/res_stasis_http_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_asterisk.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_asterisk.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_asterisk.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,15 +54,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_asterisk_info_args args = {};
- struct ast_variable *i;
+ struct ast_get_asterisk_info_args args = {};
+ struct ast_variable *i;
- for (i = get_params; i; i = i->next) {
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "only") == 0) {
args.only = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_get_asterisk_info(headers, &args, response);
}
Modified: team/dlee/stasis-http/res/res_stasis_http_bridges.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_bridges.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_bridges.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_bridges.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,7 +54,7 @@
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 = {};
+ struct ast_get_bridges_args args = {};
stasis_http_get_bridges(headers, &args, response);
}
/*!
@@ -68,7 +68,15 @@
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 = {};
+ struct ast_new_bridge_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
+ if (strcmp(i->name, "type") == 0) {
+ args.type = (i->value);
+ } else
+ {}
+ }
stasis_http_new_bridge(headers, &args, response);
}
/*!
@@ -82,15 +90,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_bridge_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = (i->value);
- } else
- {}
- }
+ struct ast_get_bridge_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = (i->value);
+ } else
+ {}
+ }
stasis_http_get_bridge(headers, &args, response);
}
/*!
@@ -104,15 +112,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_delete_bridge_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = (i->value);
- } else
- {}
- }
+ struct ast_delete_bridge_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = (i->value);
+ } else
+ {}
+ }
stasis_http_delete_bridge(headers, &args, response);
}
/*!
@@ -126,21 +134,21 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_add_channel_to_bridge_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_add_channel_to_bridge_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "channel") == 0) {
args.channel = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = (i->value);
+ } else
+ {}
+ }
stasis_http_add_channel_to_bridge(headers, &args, response);
}
/*!
@@ -154,21 +162,21 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_remove_channel_from_bridge_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_remove_channel_from_bridge_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "channel") == 0) {
args.channel = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = (i->value);
+ } else
+ {}
+ }
stasis_http_remove_channel_from_bridge(headers, &args, response);
}
/*!
@@ -182,10 +190,10 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_record_bridge_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_record_bridge_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "name") == 0) {
args.name = (i->value);
} else
@@ -204,14 +212,14 @@
if (strcmp(i->name, "terminateOn") == 0) {
args.terminate_on = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "bridgeId") == 0) {
- args.bridge_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "bridgeId") == 0) {
+ args.bridge_id = (i->value);
+ } else
+ {}
+ }
stasis_http_record_bridge(headers, &args, response);
}
Modified: team/dlee/stasis-http/res/res_stasis_http_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_channels.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_channels.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_channels.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,7 +54,7 @@
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 = {};
+ struct ast_get_channels_args args = {};
stasis_http_get_channels(headers, &args, response);
}
/*!
@@ -68,10 +68,10 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_originate_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_originate_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "endpoint") == 0) {
args.endpoint = (i->value);
} else
@@ -81,8 +81,8 @@
if (strcmp(i->name, "context") == 0) {
args.context = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_originate(headers, &args, response);
}
/*!
@@ -96,15 +96,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_channel_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ struct ast_get_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_get_channel(headers, &args, response);
}
/*!
@@ -118,15 +118,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_delete_channel_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ struct ast_delete_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_delete_channel(headers, &args, response);
}
/*!
@@ -140,10 +140,10 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_dial_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_dial_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "endpoint") == 0) {
args.endpoint = (i->value);
} else
@@ -153,14 +153,14 @@
if (strcmp(i->name, "context") == 0) {
args.context = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_dial(headers, &args, response);
}
/*!
@@ -174,40 +174,18 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_continue_in_dialplan_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ struct ast_continue_in_dialplan_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_continue_in_dialplan(headers, &args, response);
}
/*!
- * \brief Parameter parsing callback for /channels/{channelId}/reject.
- * \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 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_reject_channel_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
- stasis_http_reject_channel(headers, &args, response);
-}
-/*!
* \brief Parameter parsing callback for /channels/{channelId}/answer.
* \param get_params GET parameters in the HTTP request.
* \param path_vars Path variables extracted from the request.
@@ -218,15 +196,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_answer_channel_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ struct ast_answer_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_answer_channel(headers, &args, response);
}
/*!
@@ -240,21 +218,21 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_mute_channel_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_mute_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "direction") == 0) {
args.direction = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_mute_channel(headers, &args, response);
}
/*!
@@ -268,21 +246,21 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_unmute_channel_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_unmute_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "direction") == 0) {
args.direction = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_unmute_channel(headers, &args, response);
}
/*!
@@ -296,15 +274,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_hold_channel_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ struct ast_hold_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_hold_channel(headers, &args, response);
}
/*!
@@ -318,15 +296,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_unhold_channel_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ struct ast_unhold_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_unhold_channel(headers, &args, response);
}
/*!
@@ -340,21 +318,21 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_play_on_channel_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_play_on_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "media") == 0) {
args.media = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_play_on_channel(headers, &args, response);
}
/*!
@@ -368,13 +346,16 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_record_channel_args args = {};
- struct ast_variable *i;
-
- for (i = get_params; i; i = i->next) {
+ struct ast_record_channel_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "name") == 0) {
args.name = (i->value);
} else
+ if (strcmp(i->name, "format") == 0) {
+ args.format = (i->value);
+ } else
if (strcmp(i->name, "maxDurationSeconds") == 0) {
args.max_duration_seconds = atoi(i->value);
} else
@@ -390,14 +371,14 @@
if (strcmp(i->name, "terminateOn") == 0) {
args.terminate_on = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "channelId") == 0) {
- args.channel_id = (i->value);
- } else
- {}
- }
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "channelId") == 0) {
+ args.channel_id = (i->value);
+ } else
+ {}
+ }
stasis_http_record_channel(headers, &args, response);
}
@@ -415,15 +396,6 @@
.path_segment = "continue",
.callbacks = {
[AST_HTTP_POST] = stasis_http_continue_in_dialplan_cb,
- },
- .num_children = 0,
- .children = { }
-};
-/*! \brief REST handler for /api-docs/channels.{format} */
-static struct stasis_rest_handlers channels_channelId_reject = {
- .path_segment = "reject",
- .callbacks = {
- [AST_HTTP_POST] = stasis_http_reject_channel_cb,
},
.num_children = 0,
.children = { }
@@ -499,8 +471,8 @@
[AST_HTTP_GET] = stasis_http_get_channel_cb,
[AST_HTTP_DELETE] = stasis_http_delete_channel_cb,
},
- .num_children = 10,
- .children = { &channels_channelId_dial,&channels_channelId_continue,&channels_channelId_reject,&channels_channelId_answer,&channels_channelId_mute,&channels_channelId_unmute,&channels_channelId_hold,&channels_channelId_unhold,&channels_channelId_play,&channels_channelId_record, }
+ .num_children = 9,
+ .children = { &channels_channelId_dial,&channels_channelId_continue,&channels_channelId_answer,&channels_channelId_mute,&channels_channelId_unmute,&channels_channelId_hold,&channels_channelId_unhold,&channels_channelId_play,&channels_channelId_record, }
};
/*! \brief REST handler for /api-docs/channels.{format} */
static struct stasis_rest_handlers channels = {
Modified: team/dlee/stasis-http/res/res_stasis_http_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_endpoints.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_endpoints.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_endpoints.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,15 +54,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_endpoints_args args = {};
- struct ast_variable *i;
+ struct ast_get_endpoints_args args = {};
+ struct ast_variable *i;
- for (i = get_params; i; i = i->next) {
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "withType") == 0) {
args.with_type = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_get_endpoints(headers, &args, response);
}
/*!
@@ -76,15 +76,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_endpoint_args args = {};
- struct ast_variable *i;
+ struct ast_get_endpoint_args args = {};
+ struct ast_variable *i;
- for (i = path_vars; i; i = i->next) {
+ for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "endpointId") == 0) {
args.endpoint_id = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_get_endpoint(headers, &args, response);
}
Modified: team/dlee/stasis-http/res/res_stasis_http_events.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_events.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_events.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_events.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,15 +54,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_event_websocket_args args = {};
- struct ast_variable *i;
+ struct ast_event_websocket_args args = {};
+ struct ast_variable *i;
- for (i = get_params; i; i = i->next) {
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "app") == 0) {
args.app = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_event_websocket(headers, &args, response);
}
Modified: team/dlee/stasis-http/res/res_stasis_http_playback.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_playback.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_playback.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_playback.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,15 +54,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_playback_args args = {};
- struct ast_variable *i;
+ struct ast_get_playback_args args = {};
+ struct ast_variable *i;
- for (i = path_vars; i; i = i->next) {
+ for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "playbackId") == 0) {
args.playback_id = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_get_playback(headers, &args, response);
}
/*!
@@ -76,15 +76,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_stop_playback_args args = {};
- struct ast_variable *i;
+ struct ast_stop_playback_args args = {};
+ struct ast_variable *i;
- for (i = path_vars; i; i = i->next) {
+ for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "playbackId") == 0) {
args.playback_id = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_stop_playback(headers, &args, response);
}
/*!
@@ -98,21 +98,21 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_control_playback_args args = {};
- struct ast_variable *i;
+ struct ast_control_playback_args args = {};
+ struct ast_variable *i;
- for (i = get_params; i; i = i->next) {
+ for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "operation") == 0) {
args.operation = (i->value);
} else
- {}
- }
- for (i = path_vars; i; i = i->next) {
+ {}
+ }
+ for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "playbackId") == 0) {
args.playback_id = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_control_playback(headers, &args, response);
}
Modified: team/dlee/stasis-http/res/res_stasis_http_recordings.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_recordings.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_recordings.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_recordings.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,7 +54,7 @@
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 = {};
+ struct ast_get_recordings_args args = {};
stasis_http_get_recordings(headers, &args, response);
}
/*!
@@ -68,7 +68,7 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_stored_recordings_args args = {};
+ struct ast_get_stored_recordings_args args = {};
stasis_http_get_stored_recordings(headers, &args, response);
}
/*!
@@ -82,15 +82,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_stored_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_get_stored_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_get_stored_recording(headers, &args, response);
}
/*!
@@ -104,15 +104,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_delete_stored_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_delete_stored_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_delete_stored_recording(headers, &args, response);
}
/*!
@@ -126,7 +126,7 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_live_recordings_args args = {};
+ struct ast_get_live_recordings_args args = {};
stasis_http_get_live_recordings(headers, &args, response);
}
/*!
@@ -140,15 +140,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_live_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_get_live_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_get_live_recording(headers, &args, response);
}
/*!
@@ -162,15 +162,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_cancel_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_cancel_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_cancel_recording(headers, &args, response);
}
/*!
@@ -184,15 +184,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_stop_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_stop_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_stop_recording(headers, &args, response);
}
/*!
@@ -206,15 +206,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_pause_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_pause_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_pause_recording(headers, &args, response);
}
/*!
@@ -228,15 +228,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_unpause_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_unpause_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_unpause_recording(headers, &args, response);
}
/*!
@@ -250,15 +250,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_mute_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_mute_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_mute_recording(headers, &args, response);
}
/*!
@@ -272,15 +272,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_unmute_recording_args args = {};
- struct ast_variable *i;
-
- for (i = path_vars; i; i = i->next) {
- if (strcmp(i->name, "recordingId") == 0) {
- args.recording_id = (i->value);
- } else
- {}
- }
+ struct ast_unmute_recording_args args = {};
+ struct ast_variable *i;
+
+ for (i = path_vars; i; i = i->next) {
+ if (strcmp(i->name, "recordingId") == 0) {
+ args.recording_id = (i->value);
+ } else
+ {}
+ }
stasis_http_unmute_recording(headers, &args, response);
}
Modified: team/dlee/stasis-http/res/res_stasis_http_sounds.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/res_stasis_http_sounds.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/res_stasis_http_sounds.c (original)
+++ team/dlee/stasis-http/res/res_stasis_http_sounds.c Fri Apr 19 16:42:29 2013
@@ -32,8 +32,8 @@
*/
/*** MODULEINFO
- <depend type="module">res_stasis_http</depend>
- <support_level>core</support_level>
+ <depend type="module">res_stasis_http</depend>
+ <support_level>core</support_level>
***/
#include "asterisk.h"
@@ -54,7 +54,18 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_sounds_args args = {};
+ struct ast_get_sounds_args args = {};
+ struct ast_variable *i;
+
+ for (i = get_params; i; i = i->next) {
+ if (strcmp(i->name, "lang") == 0) {
+ args.lang = (i->value);
+ } else
+ if (strcmp(i->name, "format") == 0) {
+ args.format = (i->value);
+ } else
+ {}
+ }
stasis_http_get_sounds(headers, &args, response);
}
/*!
@@ -68,15 +79,15 @@
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct stasis_http_response *response)
{
- struct ast_get_stored_sound_args args = {};
- struct ast_variable *i;
+ struct ast_get_stored_sound_args args = {};
+ struct ast_variable *i;
- for (i = path_vars; i; i = i->next) {
+ for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "soundId") == 0) {
args.sound_id = (i->value);
} else
- {}
- }
+ {}
+ }
stasis_http_get_stored_sound(headers, &args, response);
}
Modified: team/dlee/stasis-http/res/stasis_http/resource_bridges.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http/resource_bridges.h?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/stasis_http/resource_bridges.h (original)
+++ team/dlee/stasis-http/res/stasis_http/resource_bridges.h Fri Apr 19 16:42:29 2013
@@ -52,9 +52,13 @@
void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct stasis_http_response *response);
/*! \brief Argument struct for stasis_http_new_bridge() */
struct ast_new_bridge_args {
+ /*! \brief Type of bridge to create. */
+ const char *type;
};
/*!
* \brief Create a new bridge.
+ *
+ * This bridge persists until it has been shut down, or Asterisk has been shut down.
*
* \param headers HTTP headers
* \param args Swagger parameters
@@ -80,7 +84,9 @@
const char *bridge_id;
};
/*!
- * \brief Delete bridge.
+ * \brief Shut down a bridge bridge.
+ *
+ * If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.
*
* \param headers HTTP headers
* \param args Swagger parameters
@@ -137,6 +143,8 @@
/*!
* \brief Start a recording.
*
+ * This records the mixed audio from all channels participating in this bridge.
+ *
* \param headers HTTP headers
* \param args Swagger parameters
* \param[out] response HTTP response
Modified: team/dlee/stasis-http/res/stasis_http/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/res/stasis_http/resource_channels.c?view=diff&rev=386157&r1=386156&r2=386157
==============================================================================
--- team/dlee/stasis-http/res/stasis_http/resource_channels.c (original)
+++ team/dlee/stasis-http/res/stasis_http/resource_channels.c Fri Apr 19 16:42:29 2013
@@ -94,11 +94,6 @@
stasis_http_response_no_content(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)
@@ -240,4 +235,5 @@
}
ast_log(LOG_DEBUG, "Dialing %s@%s\n", args->extension, args->context);
-}
+ /* ast_pbx_outgoing_app - originates a channel, putting it into an application */
+}
Modified: team/dlee/stasis-http/res/stasis_http/resource_channels.h
[... 573 lines stripped ...]
More information about the asterisk-commits
mailing list