[asterisk-bugs] [JIRA] Updated: (ASTERISK-20163) Variables evaluated in dialplan are case insensitive, whereas channel variables/system variables are not

Matt Jordan (JIRA) noreply at issues.asterisk.org
Mon Jul 23 14:41:21 CDT 2012


     [ https://issues.asterisk.org/jira/browse/ASTERISK-20163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Jordan updated ASTERISK-20163:
-----------------------------------

    Description: 
We were all a little taken aback by this one.

Variables are documented on wiki.asterisk.org as being case sensitive.  Some ancient documentation on voip-info makes the following note:

"A variable name may be any alphanumeric string beginning with a letter. User-defined variable names are not case sensitive — ${FOO} and ${Foo} refer to the same variable — but Asterisk-defined variables are case-sensitive — ${EXTEN} works, but ${exten} doesn't."

That seems... odd?  And yet, it is somewhat accidentally correct, per the current implementation.  Consider a user defined variable "FOO".  Evaluating ${Foo} will yield the same value as evaluating ${FOO}.  So will ${FoO}.  This works for both channel variables, as well as global variables.

On the other hand, if that variable is something known to an application or is evaluated outside of dialplan execution, then that variable is treated as case sensitive.  So if a user sets variable ${MiXMONITOR_FILENAME}, the MixMonitor application will not receive the intended value, as it evaluates (case sensitive) variable ${MIXMONITOR_FILENAME}.  If a user later checks variable ${MIXMONITOR_FILENAME} in the dialplan, it will evaluate to the same variable name as ${MiXMONITOR_FILENAME}.



More information about the asterisk-bugs mailing list