diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-08-18 01:11:28 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-08-18 01:11:28 +0000 |
commit | a6cf7b53daea5bb2b601a41a7e0274799c0dd048 (patch) | |
tree | d25a738d73cadd88fec4bf521f3f5fe2b537925f /res/ari | |
parent | b9906d84383371c504213cce5cf067de2c84bcf4 (diff) |
res/ari/resource_channels: Don't return allocation failure on failed function
If a function fails to execute, it is most likely due to one of two reasons:
(1) The function doesn't exist or can't be read from
(2) The function is dangerous and is restricted based on the user's permissions
Currently we return allocation failure, which is incorrect. This updates the
reason code to more accurately reflect why the request failed.
ASTERISK-24215
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@421311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/ari')
-rw-r--r-- | res/ari/resource_channels.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 0ac53dd73..5b63b4822 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -964,7 +964,8 @@ void ast_ari_channels_get_channel_var(struct ast_variable *headers, if (args->variable[strlen(args->variable) - 1] == ')') { if (ast_func_read2(channel, args->variable, &value, 0)) { - ast_ari_response_alloc_failed(response); + ast_ari_response_error( + response, 500, "Unable to read provided function"); return; } } else { |