[Home]

Summary:ASTERISK-15783: [patch] sqlite module does bad parsing of values in config file
Reporter:snuffy (snuffy)Labels:
Date Opened:2010-03-09 16:48:39.000-0600Date Closed:2010-04-13 11:38:42
Priority:MinorRegression?No
Status:Closed/CompleteComponents:CDR/cdr_sqlite3_custom
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20100412__issue17001.diff.txt
Description:If you try to use an option to a CDR() function  or any function it will fail to input records, because it separates on the ',' which can be mid-string like CDR(blah,f) would become 'CDR(blah' and 'f)' causing error

Offending code:

133     while ((val = strsep(&vals, ","))) {
134         /* Strip the single quotes off if they are there */
135         val = ast_strip_quoted(val, "'", "'");

****** ADDITIONAL INFORMATION ******

[Mar  9 21:16:28] WARNING[3200]: pbx.c:3830 pbx_substitute_variables_helper_full: Error in extension logic (missing '}')
[Mar  9 21:16:28] WARNING[3200]: pbx.c:3460 func_args: Can't find trailing parenthesis for function 'CDR(billse'?
[Mar  9 21:16:28] WARNING[3200]: pbx.c:3830 pbx_substitute_variables_helper_full: Error in extension logic (missing '}')
[Mar  9 21:16:28] WARNING[3200]: pbx.c:3460 func_args: Can't find trailing parenthesis for function 'CDR(duratio'?
[Mar  9 21:16:28] ERROR[3200]: cdr_sqlite3_custom.c:274 sqlite3_log: 21 values for 19 columns. SQL: INSERT INTO cdr (calldate,clid,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield,test,src,dst,hrbillsec,hrdur) VALUES ('2010-03-09 21:16:21','"test" <test>','default','SIP/test-00000001','','Milliwatt','','7','4','ANSWERED','DOCUMENTATION','','1268129781.1','','','test','333','''','f)}''','''','f)}''').






[master] ; currently, only file "master.db" is supported, with only one table at a time.
table   => cdr
columns => calldate, clid, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, test, src, dst, hrbillsec, hrdur
values  => '${CDR(start)}','${CDR(clid)}','${CDR(dcontext)}','${CDR(channel)}','${CDR(dstchannel)}','${CDR(lastapp)}','${CDR(lastdata)}','${CDR(duration)}','${CDR(billsec)}','${CDR(disposition)}','${CDR(amaflags)}','${CDR(accountcode)}','${CDR(uniqueid)}','${CDR(userfield)}','${CDR(test)}','${CDR(src)}','${CDR(dst)}','${CDR(billsec,f)}','${CDR(duration,f)}'
Comments:By: snuffy (snuffy) 2010-04-12 23:02:25

Works perfect,

thanks

By: Digium Subversion (svnbot) 2010-04-13 11:33:21

Repository: asterisk
Revision: 257065

U   trunk/cdr/cdr_sqlite3_custom.c

------------------------------------------------------------------------
r257065 | tilghman | 2010-04-13 11:33:21 -0500 (Tue, 13 Apr 2010) | 8 lines

Ensure that we can have commas within cdr values.

(closes issue ASTERISK-15783)
Reported by: snuffy
Patches:
      20100412__issue17001.diff.txt uploaded by tilghman (license 14)
Tested by: snuffy

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257065

By: Digium Subversion (svnbot) 2010-04-13 11:38:25

Repository: asterisk
Revision: 257066

_U  branches/1.6.0/
U   branches/1.6.0/cdr/cdr_sqlite3_custom.c

------------------------------------------------------------------------
r257066 | tilghman | 2010-04-13 11:38:25 -0500 (Tue, 13 Apr 2010) | 15 lines

Merged revisions 257065 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r257065 | tilghman | 2010-04-13 11:33:21 -0500 (Tue, 13 Apr 2010) | 8 lines
 
 Ensure that we can have commas within cdr values.
 
 (closes issue ASTERISK-15783)
  Reported by: snuffy
  Patches:
        20100412__issue17001.diff.txt uploaded by tilghman (license 14)
  Tested by: snuffy
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257066

By: Digium Subversion (svnbot) 2010-04-13 11:38:33

Repository: asterisk
Revision: 257067

_U  branches/1.6.1/
U   branches/1.6.1/cdr/cdr_sqlite3_custom.c

------------------------------------------------------------------------
r257067 | tilghman | 2010-04-13 11:38:33 -0500 (Tue, 13 Apr 2010) | 15 lines

Merged revisions 257065 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r257065 | tilghman | 2010-04-13 11:33:21 -0500 (Tue, 13 Apr 2010) | 8 lines
 
 Ensure that we can have commas within cdr values.
 
 (closes issue ASTERISK-15783)
  Reported by: snuffy
  Patches:
        20100412__issue17001.diff.txt uploaded by tilghman (license 14)
  Tested by: snuffy
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257067

By: Digium Subversion (svnbot) 2010-04-13 11:38:41

Repository: asterisk
Revision: 257068

_U  branches/1.6.2/
U   branches/1.6.2/cdr/cdr_sqlite3_custom.c

------------------------------------------------------------------------
r257068 | tilghman | 2010-04-13 11:38:41 -0500 (Tue, 13 Apr 2010) | 15 lines

Merged revisions 257065 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r257065 | tilghman | 2010-04-13 11:33:21 -0500 (Tue, 13 Apr 2010) | 8 lines
 
 Ensure that we can have commas within cdr values.
 
 (closes issue ASTERISK-15783)
  Reported by: snuffy
  Patches:
        20100412__issue17001.diff.txt uploaded by tilghman (license 14)
  Tested by: snuffy
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=257068