[asterisk-bugs] [JIRA] (ASTERISK-29239) Using a = in a parameter for func_conf ODBC command skips it from running

Leandro Dardini (JIRA) noreply at issues.asterisk.org
Sat Jan 9 18:01:16 CST 2021


Leandro Dardini created ASTERISK-29239:
------------------------------------------

             Summary: Using a = in a parameter for func_conf ODBC command skips it from running
                 Key: ASTERISK-29239
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29239
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Functions/func_odbc
    Affects Versions: 16.15.0
         Environment: CentOS 6.x, MySQL 5.7, Asterisk 16.15.0
            Reporter: Leandro Dardini
            Severity: Minor


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