[asterisk-bugs] [JIRA] (ASTERISK-29239) pbx: Using a = in a parameter for Set results in incorrect parsing

Joshua C. Colp (JIRA) noreply at issues.asterisk.org
Sun Jan 10 14:42:16 CST 2021


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

Joshua C. Colp updated ASTERISK-29239:
--------------------------------------

    Summary: pbx: Using a = in a parameter for Set results in incorrect parsing  (was: Using a = in a parameter for func_conf ODBC command skips it from running)

> pbx: Using a = in a parameter for Set results in incorrect parsing
> ------------------------------------------------------------------
>
>                 Key: ASTERISK-29239
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29239
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: PBX/General
>    Affects Versions: 16.15.0
>         Environment: CentOS 6.x, MySQL 5.7, Asterisk 16.15.0
>            Reporter: Leandro Dardini
>            Assignee: Leandro Dardini
>            Severity: Minor
>              Labels: patch
>         Attachments: full.14, pbx_variables.diff
>
>
> If I have a func_odbc function writing in a table and one of the parameters contains a = sign, the command is not executed and no error is reported.
> Let's take a very simple func_odbc entry like:
> {noformat}
> [QUERY_BUG]
> dsn=asteriskcdrdb1,asteriskcdrdb2
> synopsis=Test a query bug
> writesql=insert into cdr(clid,src,dst) values ('${ARG1}','${ARG2}','${VAL1}')
> {noformat}
> And its AEL dialplan usage:
> {noformat}
>         9999 => {
>              Set(ODBC_QUERY_BUG("one","twoequalthree")="four");
>              Set(ODBC_QUERY_BUG("one","two=three")="four");
>              Hangup();
>         }
> {noformat}
> Only the first ODBC_QUERY_BUG command is executed while the second is skipped without any error reported.
> This is the relevant DEBUG. Full DEBUG in attach
> {noformat}
> [2021-01-10 00:50:36] DEBUG[13330][C-00001320] pbx.c: Launching 'Set'
> [2021-01-10 00:50:36] VERBOSE[13330][C-00001320] pbx.c: Executing [9999 at authenticated:1] Set("PJSIP/108-DEVEL-00000017", "ODBC_QUERY_BUG("one","twoequalthree")="four"") in new stack
> [2021-01-10 00:50:36] DEBUG[13330][C-00001320] pbx_variables.c: Evaluating 'ARG1' (from 'ARG1}','${ARG2}','${VAL1}')' len 4)
> [2021-01-10 00:50:36] DEBUG[13330][C-00001320] pbx_variables.c: Result of 'ARG1' is 'one'
> [2021-01-10 00:50:36] DEBUG[13330][C-00001320] pbx_variables.c: Evaluating 'ARG2' (from 'ARG2}','${VAL1}')' len 4)
> [2021-01-10 00:50:36] DEBUG[13330][C-00001320] pbx_variables.c: Result of 'ARG2' is 'twoequalthree'
> [2021-01-10 00:50:36] DEBUG[13330][C-00001320] pbx_variables.c: Evaluating 'VAL1' (from 'VAL1}')' len 4)
> [2021-01-10 00:50:36] DEBUG[13330][C-00001320] pbx_variables.c: Result of 'VAL1' is 'four'
> [2021-01-10 00:50:37] DEBUG[13330][C-00001320] pbx.c: Launching 'Set'
> [2021-01-10 00:50:37] VERBOSE[13330][C-00001320] pbx.c: Executing [9999 at authenticated:2] Set("PJSIP/108-DEVEL-00000017", "ODBC_QUERY_BUG("one","two=three")="four"") in new stack
> [2021-01-10 00:50:37] DEBUG[13330][C-00001320] pbx.c: Launching 'Hangup'
> [2021-01-10 00:50:37] VERBOSE[13330][C-00001320] pbx.c: Executing [9999 at authenticated:3] Hangup("PJSIP/108-DEVEL-00000017", "") in new stack
> {noformat}



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



More information about the asterisk-bugs mailing list