[Asterisk-Users] CDR ??

James Golovich james at wwnet.net
Fri Mar 28 08:59:37 MST 2003



On Fri, 28 Mar 2003, WipeOut . wrote:

> Hi,
> 
> I see in /ect/asterisk there is a cdr_mysql.conf to configure the CDR logging to a MySQL DB..
> 
> I have a couple of questions..
> 
> 1. Where do I find the DB schema to create the DB? (may be a good idea to add this to the top of the .conf file in the cvs so that it is easy to find for amyone wanting to set it up.. Just a thought.)

The DB schema is in doc/cdr_mysql.txt but to make it easy I'll include it
here:

CREATE TABLE cdr (
  calldate datetime NOT NULL default '0000-00-00 00:00:00',
  clid varchar(45) NOT NULL default '',
  src varchar(45) NOT NULL default '',
  dst varchar(45) NOT NULL default '',
  dcontext varchar(45) NOT NULL default '',
  channel varchar(45) NOT NULL default '',
  dstchannel varchar(45) NOT NULL default '',
  lastapp varchar(45) NOT NULL default '',
  lastdata varchar(45) NOT NULL default '',
  duration int(11) NOT NULL default '0',
  billsec int(11) NOT NULL default '0',
  disposition int(11) NOT NULL default '0',
  amaflags int(11) NOT NULL default '0',
  accountcode varchar(45) NOT NULL default ''
);


> 
> 2. Are there any req's to making this work? (apart from, I assume, having the mysql client installed on the * box..)

I don't think you need the mysqlclient installed on the box, you just need
the client libs.  I haven't used the mysql cdr stuff so I can't really
help here.

> 
> I also read in the archives that CDR logging could be done to a CSV file, How and where is this setup and configured?

by default CSV logging is enabled.  You can find the logs (on a default
install) in /var/log/asterisk/cdr-csv

James




More information about the asterisk-users mailing list