summaryrefslogtreecommitdiff
path: root/res/res_ari_channels.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-12-20 22:04:15 +0000
committerDavid M. Lee <dlee@digium.com>2013-12-20 22:04:15 +0000
commit40a7f68e4ba631515809b9d838e00ae3fc0b5f08 (patch)
tree8bf01f9d363bfa2d4bff1239ac657639e2e57a55 /res/res_ari_channels.c
parentbd0ef2508021b0040a6439cc9e3e3335b40741aa (diff)
ari: Remove support for specifying channel vars during origination.
When we added support for specifying channel variables for an origination, we didn't consider how that would interact with another feature, namely specifying request parameters in a JSON request body. The method of specifying channel variables (as a flat JSON object passed in the JSON body) interferes with parsing parameters out of the request body. Unfortunately, fixing this would be a backward incompatible change. In the interest of keeping the API sane and keeping our release schedule, we're dropping the feature for specifying channel variables in the origination request. We will bring the feature back soon, as a backward compatible addition to the API. (closes issue ASTERISK-23051) Review: https://reviewboard.asterisk.org/r/3088 ........ Merged revisions 404509 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_ari_channels.c')
-rw-r--r--res/res_ari_channels.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/res/res_ari_channels.c b/res/res_ari_channels.c
index 6b741b04c..40ad32b2b 100644
--- a/res/res_ari_channels.c
+++ b/res/res_ari_channels.c
@@ -117,6 +117,7 @@ static void ast_ari_channels_originate_cb(
struct ast_ari_channels_originate_args args = {};
struct ast_variable *i;
RAII_VAR(struct ast_json *, body, NULL, ast_json_unref);
+ struct ast_json *field;
#if defined(AST_DEVMODE)
int is_valid;
int code;
@@ -164,7 +165,39 @@ static void ast_ari_channels_originate_cb(
goto fin;
}
}
- args.variables = ast_json_ref(body);
+ /* Parse query parameters out of it */
+ field = ast_json_object_get(body, "endpoint");
+ if (field) {
+ args.endpoint = ast_json_string_get(field);
+ }
+ field = ast_json_object_get(body, "extension");
+ if (field) {
+ args.extension = ast_json_string_get(field);
+ }
+ field = ast_json_object_get(body, "context");
+ if (field) {
+ args.context = ast_json_string_get(field);
+ }
+ field = ast_json_object_get(body, "priority");
+ if (field) {
+ args.priority = ast_json_integer_get(field);
+ }
+ field = ast_json_object_get(body, "app");
+ if (field) {
+ args.app = ast_json_string_get(field);
+ }
+ field = ast_json_object_get(body, "appArgs");
+ if (field) {
+ args.app_args = ast_json_string_get(field);
+ }
+ field = ast_json_object_get(body, "callerId");
+ if (field) {
+ args.caller_id = ast_json_string_get(field);
+ }
+ field = ast_json_object_get(body, "timeout");
+ if (field) {
+ args.timeout = ast_json_integer_get(field);
+ }
ast_ari_channels_originate(headers, &args, response);
#if defined(AST_DEVMODE)
code = response->response_code;