[asterisk-bugs] [Asterisk 0017036]: [patch] Perl script to import CDR text file to ODBC database table

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 6 15:47:39 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17036 
====================================================================== 
Reported By:                precisenetworks
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17036
Category:                   Utilities/NewFeature
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           Addons-1.6.2.0 
JIRA:                       SWP-1100 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-15 22:23 CDT
Last Modified:              2011-05-06 15:47 CDT
====================================================================== 
Summary:                    [patch] Perl script to import CDR text file to ODBC
database table
Description: 
I hope to save others from reinventing the wheel.  The code could be
optimized a little, but it works on the default cdr format quite well.  The
prerequisite table will need to be configured.  Here is the statement I
used to create my cdr table in MySQL:

CREATE TABLE `cdr` (
  `id` int(11) unsigned primary key not null auto_increment,
  `calldate` datetime NOT NULL default '0000-00-00 00:00:00', 
  `clid` varchar(80) NOT NULL default '', 
  `src` varchar(80) NOT NULL default '', 
  `dst` varchar(80) NOT NULL default '', 
  `dcontext` varchar(80) NOT NULL default '',  
  `channel` varchar(80) NOT NULL default '', 
  `dstchannel` varchar(80) NOT NULL default '', 
  `lastapp` varchar(80) NOT NULL default '', 
  `lastdata` varchar(80) NOT NULL default '', 
  `duration` int(11) NOT NULL default '0', 
  `billsec` int(11) NOT NULL default '0', 
  `disposition` varchar(45) NOT NULL default '',  
  `amaflags` int(11) NOT NULL default '0', 
  `accountcode` varchar(20) NOT NULL default '', 
  `uniqueid` VARCHAR(32) NOT NULL default '',
  `userfield` varchar(255) NOT NULL default '' 
); 

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

---------------------------------------------------------------------- 
 (0134605) svnbot (reporter) - 2011-05-06 15:47
 https://issues.asterisk.org/view.php?id=17036#c134605 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 317916

A   trunk/contrib/scripts/import-cdr-csv-mysql.pl

------------------------------------------------------------------------
r317916 | russell | 2011-05-06 15:47:37 -0500 (Fri, 06 May 2011) | 7 lines

Add a cdr_csv to MySQL import script to contrib/scripts.

(closes issue https://issues.asterisk.org/view.php?id=17036)
Reported by: precisenetworks
Patches:
      import-cdr-csv-mysql.pl uploaded by precisenetworks (license 1010)

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-06 15:47 svnbot         Note Added: 0134605                          
======================================================================




More information about the asterisk-bugs mailing list