[asterisk-commits] oej: branch 1.6.2 r242917 - in /branches/1.6.2: ./ main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 25 14:56:16 CST 2010


Author: oej
Date: Mon Jan 25 14:56:13 2010
New Revision: 242917

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242917
Log:
Merged revisions 242904 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r242904 | oej | 2010-01-25 21:27:59 +0100 (Mån, 25 Jan 2010) | 10 lines

Merged revisions 242850 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r242850 | oej | 2010-01-25 21:03:38 +0100 (Mån, 25 Jan 2010) | 2 lines

Report error when writing to functions returns error in AMI setvar action

........

................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/manager.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/manager.c?view=diff&rev=242917&r1=242916&r2=242917
==============================================================================
--- branches/1.6.2/main/manager.c (original)
+++ branches/1.6.2/main/manager.c Mon Jan 25 14:56:13 2010
@@ -1806,7 +1806,8 @@
 	const char *name = astman_get_header(m, "Channel");
 	const char *varname = astman_get_header(m, "Variable");
 	const char *varval = astman_get_header(m, "Value");
-
+	int res = 0;
+	
 	if (ast_strlen_zero(varname)) {
 		astman_send_error(s, m, "No variable specified");
 		return 0;
@@ -1819,14 +1820,20 @@
 			return 0;
 		}
 	}
-
-	pbx_builtin_setvar_helper(c, varname, S_OR(varval, ""));
+	if (varname[strlen(varname)-1] == ')') {
+		char *function = ast_strdupa(varname);
+		res = ast_func_write(c, function, varval);
+	} else {
+		pbx_builtin_setvar_helper(c, varname, S_OR(varval, ""));
+	}
 
 	if (c)
 		ast_channel_unlock(c);
-
-	astman_send_ack(s, m, "Variable Set");
-
+	if (res == 0) {
+		astman_send_ack(s, m, "Variable Set");	
+	} else {
+		astman_send_error(s, m, "Variable not set");
+	}
 	return 0;
 }
 




More information about the asterisk-commits mailing list