Severity
Major
Versions
20.0.1 (really all versions, ever)
Components/Modules
config.c
Operating Environment
N/A
Frequency of Occurrence
Constant
Issue Description
Imported from JIRA: https://issues.asterisk.org/jira/browse/ASTERISK-30370
If values are specified in a template and then overridden, behavior is currently wrong when explicitly retrieving a variable, as reading a config line by line will result in the overriden value being used (correct), but explicitly asking for it will return the earliest set value, which is that provided by the template.
As a result, modules can pick up the wrong values when loading config items in this manner, and users can get very confused.
This fixes this by adjusting ast_variable_retrieve to return the last match instead of the first (the equivalent of -1 to the AST_CONFIG function), so that the most recently specified/overridden value is returned and behavior is consistent.
Relevant log output
No response
Asterisk Issue Guidelines
Severity
Major
Versions
20.0.1 (really all versions, ever)
Components/Modules
config.c
Operating Environment
N/A
Frequency of Occurrence
Constant
Issue Description
Imported from JIRA: https://issues.asterisk.org/jira/browse/ASTERISK-30370
If values are specified in a template and then overridden, behavior is currently wrong when explicitly retrieving a variable, as reading a config line by line will result in the overriden value being used (correct), but explicitly asking for it will return the earliest set value, which is that provided by the template.
As a result, modules can pick up the wrong values when loading config items in this manner, and users can get very confused.
This fixes this by adjusting ast_variable_retrieve to return the last match instead of the first (the equivalent of -1 to the AST_CONFIG function), so that the most recently specified/overridden value is returned and behavior is consistent.
Relevant log output
No response
Asterisk Issue Guidelines