All that being said, my install uses a mysql database already for CDR data (I don’t know if this is the “norm” or not, since I’m using Xorcom on top of Asterisk)
BUT… if you do:
asterisk -rx 'cdr show status'
And you see “Adaptive ODBC” then yours should be in mysql as well.
Fire up mysql
mysql
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| asterisk |
| asteriskcdrdb |
| mysql |
| qstatslite |
| test |
+--------------------+
6 rows in set (0.00 sec)
Ahhh… there’s my CDR data…
mysql> use asteriskcdrdb;
mysql> show tables;
+-------------------------+
| Tables_in_asteriskcdrdb |
+-------------------------+
| cdr |
| cel |
+-------------------------+
2 rows in set (0.00 sec)
Then, doing a simple “describe cdr;” shows me the schema
mysql> describe cdr;
+---------------+--------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------------------+-------+
| calldate | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| clid | varchar(80) | NO | | | |
| src | varchar(80) | NO | | | |
| dst | varchar(80) | NO | MUL | | |
| dcontext | varchar(80) | NO | | | |
| channel | varchar(80) | NO | | | |
| dstchannel | varchar(80) | NO | | | |
| lastapp | varchar(80) | NO | | | |
| lastdata | varchar(80) | NO | | | |
| duration | int(11) | NO | | 0 | |
| billsec | int(11) | NO | | 0 | |
| disposition | varchar(45) | NO | | | |
| amaflags | int(11) | NO | | 0 | |
| accountcode | varchar(20) | NO | MUL | | |
| uniqueid | varchar(32) | NO | | | |
| userfield | varchar(255) | NO | | | |
| did | varchar(50) | NO | | | |
| recordingfile | varchar(255) | NO | | | |
| cnum | varchar(40) | NO | | | |
| cnam | varchar(40) | NO | | | |
| outbound_cnum | varchar(40) | NO | | | |
| outbound_cnam | varchar(40) | NO | | | |
| dst_cnam | varchar(40) | NO | | | |
+---------------+--------------+------+-----+---------------------+-------+
23 rows in set (0.00 sec)
So, while digging through a little, it looks as if “CDR” is the “Header”, and “CEL” is the “Body” (or the events). So, once you find the main information and the uniqueid from the CDR, you select from the CEL where uniqueid=(uniqueid from the CDR) to get all of the details.
Hope this helps… the details don’t look nearly as hairy as on the Zetron system (that goes down to 1000ths of a second, and records EVERYTHING including bridging, etc, etc, etc that I had to sift through). So, writing a CDR reporting system wouldn’t be as daunting a task.