From f771d4bb5d19d138b9134ef3ea477616c3672b1e Mon Sep 17 00:00:00 2001 From: kpfleming Date: Tue, 8 Nov 2005 03:35:40 +0000 Subject: issue #5571 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7019 f38db490-d61c-443f-a65b-d21fe96a405b --- manager.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'manager.c') diff --git a/manager.c b/manager.c index 1f38db260..c4bfcec35 100755 --- a/manager.c +++ b/manager.c @@ -664,9 +664,9 @@ static int action_hangup(struct mansession *s, struct message *m) } 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"; @@ -677,25 +677,24 @@ static int action_setvar(struct mansession *s, struct message *m) 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)) { + if (ast_strlen_zero(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 (!ast_strlen_zero(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); ast_mutex_unlock(&c->lock); astman_send_ack(s, m, "Variable Set"); + return 0; } -- cgit v1.2.3