[asterisk-bugs] [Asterisk 0015471]: cdr_custom produces incorrect csv format for clid

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 30 15:19:21 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15471 
====================================================================== 
Reported By:                dkerr
Assigned To:                mnick
====================================================================== 
Project:                    Asterisk
Issue ID:                   15471
Category:                   CDR/cdr_custom
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.25.1 
JIRA:                        
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-07-08 20:27 CDT
Last Modified:              2009-09-30 15:19 CDT
====================================================================== 
Summary:                    cdr_custom produces incorrect csv format for clid
Description: 
The csv file produced when cdr_custom is enabled is incorrect and cannot be
parsed by any csv parser (including excel, open office, php, perl, etc.
etc.. The problem occurs in the handling of caller ID strings.

Take this example template for cdr_custom.conf. 

[mappings]
Master.csv => "${CDR(clid)}","${CDR(src)}","${CDR(dst)}"

This specifies quoted CSV. The problem is that the format of a caller ID
is
'"lastname, firstname" <123456>'
Which contains quoted text.  The cdr_custom file produced would look like
this...

""lastname, firstname" <123456>","123456","100"

The correct format (which is produced by Asterisk default logging) is...

"""lastname, firstname"" <123456>","123456","100"

Note that quotes (") are translated into two consecutive quotes (""). 

====================================================================== 

---------------------------------------------------------------------- 
 (0111676) svnbot (reporter) - 2009-09-30 15:19
 https://issues.asterisk.org/view.php?id=15471#c111676 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 221371

_U  branches/1.6.2/
U   branches/1.6.2/configs/cdr_custom.conf.sample
U   branches/1.6.2/funcs/func_strings.c

------------------------------------------------------------------------
r221371 | mnick | 2009-09-30 15:19:21 -0500 (Wed, 30 Sep 2009) | 30 lines

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

................
  r221368 | mnick | 2009-09-30 14:42:36 -0500 (Wed, 30 Sep 2009) | 23
lines
  
  Merged revisions 221153,221157,221303 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r221153 | mnick | 2009-09-30 10:37:39 -0500 (Wed, 30 Sep 2009) | 2
lines
    
    check bounds - prevents for buffer overflow
  ........
    r221157 | mnick | 2009-09-30 10:41:46 -0500 (Wed, 30 Sep 2009) | 8
lines
    
    added a new dialplan function 'CSV_QUOTE' and changed the
cdr_custom.sample.conf
    
    (closes issue https://issues.asterisk.org/view.php?id=15471)
    Reported by: dkerr
    Patches:
          csv_quote_14.txt uploaded by mnick (license )
    Tested by: mnick
  ........
    r221303 | mnick | 2009-09-30 14:02:00 -0500 (Wed, 30 Sep 2009) | 2
lines
    
    changed the prototype definition of csv_quote
  ........
................

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-09-30 15:19 svnbot         Checkin                                      
2009-09-30 15:19 svnbot         Note Added: 0111676                          
======================================================================




More information about the asterisk-bugs mailing list