mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	issue #5571
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -1,5 +1,7 @@ | ||||
| 2005-11-07  Kevin P. Fleming  <kpfleming@digium.com> | ||||
|  | ||||
| 	* manager.c (action_setvar): add support for setting global variables (issue #5571) | ||||
|  | ||||
| 	* Makefile: correct cross-compilation issue introduced in Cygwin patches (issue #5572) | ||||
|  | ||||
| 	* apps/app_voicemail.c: upgrade to new arg/option API and implement priority jumping control (issue #5649) | ||||
|   | ||||
							
								
								
									
										21
									
								
								manager.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								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; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user