Summary:ASTERISK-18966: Consistent AMI error causing Channel variable setting to create global variables
Reporter:Red (redwolf890)Labels:
Date Opened:2011-12-05 09:39:44.000-0600Date Closed:2011-12-05 10:51:29.000-0600
Versions: Frequency of
duplicatesASTERISK-18958 Asterisk Manager incorrectly sets a ChannelID to be global in highly repeatable circumstances
Environment:CentOS 5.5 Final. Kernel 2.6.18-274.7.1.el5 x64. Attachments:
Description:Asterisk Manager "Action: SetVar" command is broken when it is applied to a Channel. If a user executes the following AMI command (the Channel header is blank):

Action: SetVar

the variable "TEST_VARIABLE" becomes globally set to "TEST_VALUE". The reason this is an error is that all other AMI commands that use a ChannelID header send the error reply "Response: Error\r\nMessage: Channel not specified" when no value is supplied for the Channel.

This is also not intended global var setting behavior because the Channel header is optional.  To set a global variable, one should _omit_ the Channel header (you _omit_ it to set globals because it's an optional header).  No other AMI command treats a blank Channel header value to be carte blanche for doing something globally.

This is not intuitive behavior for any user who uses other commands that use the Channel header, and the documentation does not indicate that setting a blank channel creates a global variable -- it only says _omitting_ the channel header will create a global variable.

This will severely breaks things if you are setting things like CallerID variables on a channel and get some text parsing failure that causes Channel header to be set to blank (as in the AMI command above). Every single person on your system gets broken CallerID details.

EDIT: This is a more detailed and corrected update of a very similar report that was quickly and summarily closed without being considered because of a few typos.
Comments:By: Matt Jordan (mjordan) 2011-12-05 10:51:29.183-0600

Closing this as a duplicate of ASTERISK-18958.  Reopened Asterisk-18958.

By: Red (redwolf890) 2011-12-05 11:03:28.037-0600

I'm new to the Asterisk issue reporting system.  Was there a less circuitous way I could have done this, i.e. how could I have reopened it myself?  Thanks.