diff options
author | David M. Lee <dlee@digium.com> | 2013-12-20 22:04:15 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-12-20 22:04:15 +0000 |
commit | 40a7f68e4ba631515809b9d838e00ae3fc0b5f08 (patch) | |
tree | 8bf01f9d363bfa2d4bff1239ac657639e2e57a55 /res/ari | |
parent | bd0ef2508021b0040a6439cc9e3e3335b40741aa (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/ari')
-rw-r--r-- | res/ari/resource_channels.c | 42 | ||||
-rw-r--r-- | res/ari/resource_channels.h | 2 |
2 files changed, 0 insertions, 44 deletions
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 667ea73f0..c6900f1b2 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -687,43 +687,6 @@ void ast_ari_channels_list(struct ast_variable *headers, ast_ari_response_ok(response, ast_json_ref(json)); } -static int ari_channels_set_channel_var(struct ast_channel *chan, - const char *variable, const char *value, struct ast_ari_response *response) -{ - if (pbx_builtin_setvar_helper(chan, variable, value)) { - ast_ari_response_error( - response, 400, "Bad Request", - "Unable to set channel variable %s=%s", variable, value); - return -1; - } - - return 0; -} - -static int ari_channels_set_channel_vars(struct ast_channel *chan, - struct ast_json *variables, struct ast_ari_response *response) -{ - struct ast_json_iter *i; - - if (!variables) { - /* nothing to do */ - return 0; - } - - for (i = ast_json_object_iter(variables); i; - i = ast_json_object_iter_next(variables, i)) { - if (ari_channels_set_channel_var( - chan, ast_json_object_iter_key(i), - ast_json_string_get(ast_json_object_iter_value(i)), - response)) { - /* response filled in by called function */ - return -1; - } - } - - return 0; -} - void ast_ari_channels_originate(struct ast_variable *headers, struct ast_ari_channels_originate_args *args, struct ast_ari_response *response) @@ -813,11 +776,6 @@ void ast_ari_channels_originate(struct ast_variable *headers, return; } - if (ari_channels_set_channel_vars(chan, args->variables, response)) { - /* response filled in by called function */ - return; - } - snapshot = ast_channel_snapshot_create(chan); ast_channel_unlock(chan); diff --git a/res/ari/resource_channels.h b/res/ari/resource_channels.h index 36c7339ba..49ab8eb34 100644 --- a/res/ari/resource_channels.h +++ b/res/ari/resource_channels.h @@ -68,8 +68,6 @@ struct ast_ari_channels_originate_args { const char *caller_id; /*! \brief Timeout (in seconds) before giving up dialing, or -1 for no timeout. */ int timeout; - /*! \brief Variables to be set on the channel. */ - struct ast_json *variables; }; /*! * \brief Create a new channel (originate). |