Index: manager.c =================================================================== RCS file: /usr/cvsroot/asterisk/manager.c,v retrieving revision 1.131 diff -u -p -r1.131 manager.c --- manager.c 26 Oct 2005 23:11:36 -0000 1.131 +++ manager.c 2 Nov 2005 11:51:14 -0000 @@ -656,9 +656,9 @@ static int action_hangup(struct mansessi } static char mandescr_setvar[] = -"Description: Set a local channel variable.\n" +"Description: Set a global or local channel variable.\n" "Variables: (Names marked with * are required)\n" -" *Channel: Channel to set variable for\n" +" Channel: Channel to set variable for\n" " *Variable: Variable name\n" " *Value: Value\n"; @@ -669,19 +669,17 @@ static int action_setvar(struct mansessi char *varname = astman_get_header(m, "Variable"); char *varval = astman_get_header(m, "Value"); - if (!strlen(name)) { - astman_send_error(s, m, "No channel specified"); - return 0; - } if (!strlen(varname)) { astman_send_error(s, m, "No variable specified"); return 0; } - c = ast_get_channel_by_name_locked(name); - if (!c) { - astman_send_error(s, m, "No such channel"); - return 0; + if (strlen(name)) { + c = ast_get_channel_by_name_locked(name); + if (!c) { + astman_send_error(s, m, "No such channel"); + return 0; + } } pbx_builtin_setvar_helper(c,varname,varval);