[Home]

Summary:ASTERISK-25883: In the func_odbc doesn't work the option "escapecommas"
Reporter:Vadim (cron333)Labels:
Date Opened:2016-03-30 17:39:26Date Closed:2016-05-09 05:41:54
Priority:MajorRegression?
Status:Closed/CompleteComponents:Functions/func_odbc
Versions:11.21.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 6.7Attachments:( 0) add_func_odbc.conf
( 1) Dump_ODBC.txt
( 2) func_odbc.conf
( 3) func_odbc.conf.txt
Description:In the func_odbc doesn't work the option "escapecommas"
Comments:By: Asterisk Team (asteriskteam) 2016-03-30 17:39:26.689-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Vadim (cron333) 2016-03-30 17:59:03.478-0500

The problem is visible after evaluating VAL9 (in the file Dump_ODBC.txt)

By: Rusty Newton (rnewton) 2016-03-31 09:48:47.517-0500

Does func_odbc.conf.txt represent the complete contents of your func_odbc.conf file?

Can you attach the complete config file and simply sanitize any private values?

By: Vadim (cron333) 2016-03-31 10:48:35.282-0500

>Can you attach the complete config file and simply sanitize any private values?

Ttwo files are attached (this is the whole config)

By: Rusty Newton (rnewton) 2016-04-06 16:05:35.510-0500

[~cron333] I've looked at the documentation for escapecommas and looked at your debug output. I can't find a problem. Can you help me understand what you expect to happen during the evaluation of VAL9?

As far as I can tell it is appropriate based on your configuration and the default behavior of the "escapecommas" option.



By: Vadim (cron333) 2016-04-06 16:42:20.331-0500

"medbooking,m,,,300,,user_field"  - this is the one field! It's the arguements of the command "Queue" ....

By: Rusty Newton (rnewton) 2016-04-06 18:28:13.662-0500

Can you provide the relevant dialplan that executes:

{noformat}
   -- Executing [s@macro-end:12] Set("SIP/westcall-00008160", "ODBC_CDR()=westcall,79991233443,74952223333,wescall-in,"WestCall" <79991233443>,SIP/westcall-00008160,,Queue,medbooking,m,,,300,,user_field,2016-03-31 01:13:31,2016-03-31 01:13:31,2016-03-31 01:13:50,18,18,ANSWERED,NOANSWER,,,DOCUMENTATION,,1459376011.34038,1459376011.34038,office,IN,46175") in new stack
{noformat}


By: Vadim (cron333) 2016-04-07 01:07:54.574-0500

{noformat}
same => n,Set(ODBC_CDR()=${CDR(accountcode)},${IF($["${REDIR_CID}" != ""]?${REDIR_CID}:${CALLERID(num)})},${FIRST_NUMBER},${CDR(dcontext)},${CALLERID(all)},${CDR(channel)},${CDR(dstchannel)},${CDR(lastapp)},${CDR(lastdata)},${CDR(start)},${CDR(answer)},${STRFTIME(,,%Y-%m-%d %H:%M:%S)},${IF($["${DIALEDTIME}" = ""]?${CDR(duration)}:${DIALEDTIME})},${IF($["${ANSWREDTIME}" = ""]?${CDR(billsec)}:${ANSWREDTIME})},${CDR(disposition)},${DIAL_STAT_QUERY},${OPERATOR},${ANS_DURATION},${CDR(amaflags)},${CDR(userfield)},${UNIQUEID},${CDR(linkedid)},${CDR(peeraccount)},${DIRECT},${CDR(sequence)})
{noformat}

By: Rusty Newton (rnewton) 2016-04-12 07:42:35.508-0500

The documentation for escapecommas says:

{quote}
;              If commas are
;              escaped (the default behavior), then fields containing commas
;              will be treated as a single value when assigning to ARRAY() or
;              HASH().  If commas are not escaped, then values will be separated
;              at the comma within fields.
{quote}

You are not assigning to ARRAY() or HASH() as far as I can tell - so I would expect that commas would not be escaped.

Can you try quoting your call to CDR(lastdata) ?

{noformat}
,"${CDR(lastdata)}",
{noformat}

By: Vadim (cron333) 2016-04-12 11:30:33.503-0500

i tried quoting with ' and, seems with " signs. But i didn't have success.  Now it's working with " (while). I'll monitor ...

P. S. It's even working whithout quoting (But not always) ))

By: Rusty Newton (rnewton) 2016-05-04 17:39:05.751-0500

Vadim, do you have any updates ? Has the issue proven to be intermittent? Or is it working now with " ?

By: Vadim (cron333) 2016-05-05 02:14:17.634-0500

Yes, It's seems working with " ... )