[asterisk-commits] mjordan: branch 13 r421311 - /branches/13/res/ari/resource_channels.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 17 20:11:30 CDT 2014


Author: mjordan
Date: Sun Aug 17 20:11:28 2014
New Revision: 421311

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=421311
Log:
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.

Modified:
    branches/13/res/ari/resource_channels.c

Modified: branches/13/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/ari/resource_channels.c?view=diff&rev=421311&r1=421310&r2=421311
==============================================================================
--- branches/13/res/ari/resource_channels.c (original)
+++ branches/13/res/ari/resource_channels.c Sun Aug 17 20:11:28 2014
@@ -964,7 +964,8 @@
 
 	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 {




More information about the asterisk-commits mailing list