[asterisk-bugs] [JIRA] (ASTERISK-30236) app_queue.c: Properly escape commas in MONITOR* variables.

Sean Bright (JIRA) noreply at issues.asterisk.org
Mon Sep 19 11:03:08 CDT 2022


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

Sean Bright updated ASTERISK-30236:
-----------------------------------

    Description: 
The contents of the {{MONITOR_FILENAME}} and {{MONITOR_EXEC}} variables are evaluated when a queue member is connected to a caller, allowing information about the member to be included in the filename or post process execution.
    
This is made possible by using {{^\{MEMBERINTERFACE}}} syntax instead of {{$\{MEMBERINTERFACE}}} when assigning a value to {{MONITOR_FILENAME}} so that evaluation does not occur immediately. The {{MONITOR_EXEC}} variable is handled similarly.
    
Because {{MONITOR_FILENAME}} and {{MONITOR_EXEC}} are ultimately passed through the standard dialplan application parsing code, any commas in need to be escaped. This currently happens before variable substitution but should instead be occurring afterwards.

The main consequence of this change is that you can now use dialplan functions with multiple arguments in {{MONITOR_FILENAME}} without the commas being escaped before variable replacement occurs.

  was:
The contents of the {{MONITOR_FILENAME}} variable is evaluated when a queue member is connected to a caller, allowing information about the member to be included in the filename.

This is made possible by using {{^\{MEMBERINTERFACE}}} syntax instead of {{$\{MEMBERINTERFACE}}} when assigning a value to {{MONITOR_FILENAME}} so that evaluation does not occur immediately. The {{MONITOR_EXEC}} variable is handled similarly.

Because of the way that {{MONITOR_EXEC}} works under the hood, the code that performs the variable replacement also escapes commas before doing so. However, this replacement should be taking place _after_ the variable replacement is done so that unescaped commas are not erroneously passed to the MixMonitor start function.

Finally, having a comma in a filename is not problematic so we now only escape commas after variable replacement is performed on {{MONITOR_EXEC}}.

The main consequence of this change is that you can now use dialplan functions with multiple arguments in {{MONITOR_FILENAME}} without the commas being escaped before variable replacement occurs.


> app_queue.c: Properly escape commas in MONITOR* variables.
> ----------------------------------------------------------
>
>                 Key: ASTERISK-30236
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30236
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_queue
>    Affects Versions: GIT, 19.6.0, 16.28.0, 18.14.0
>            Reporter: Sean Bright
>            Assignee: Sean Bright
>
> The contents of the {{MONITOR_FILENAME}} and {{MONITOR_EXEC}} variables are evaluated when a queue member is connected to a caller, allowing information about the member to be included in the filename or post process execution.
>     
> This is made possible by using {{^\{MEMBERINTERFACE}}} syntax instead of {{$\{MEMBERINTERFACE}}} when assigning a value to {{MONITOR_FILENAME}} so that evaluation does not occur immediately. The {{MONITOR_EXEC}} variable is handled similarly.
>     
> Because {{MONITOR_FILENAME}} and {{MONITOR_EXEC}} are ultimately passed through the standard dialplan application parsing code, any commas in need to be escaped. This currently happens before variable substitution but should instead be occurring afterwards.
> The main consequence of this change is that you can now use dialplan functions with multiple arguments in {{MONITOR_FILENAME}} without the commas being escaped before variable replacement occurs.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list