# Example CDR tables

**URL:** <https://community.asterisk.org/t/example-cdr-tables/38178>\
**Category:** Asterisk Support\
**Created:** [February 8, 2012, 7:41pm UTC](https://community.asterisk.org/t/example-cdr-tables/38178 "2012-02-08T19:41:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [February 8, 2012, 7:41pm UTC](https://community.asterisk.org/t/example-cdr-tables/38178/1 "2012-02-08T19:41:13Z")

</div>

Does anyone have a mysql dump file of an example CDR table? I have googled and searched the forum and I cant find one. We are setting up a new asterisk pbx at my company and I have been tasked with writing custom PHP CDR reporting. I am writing the code based off the table definitions, but it would be nice to get a large CDR table that has all the data in it so i can test and debug properly. Any advice would be appreciated.

\*\* edit  
in addition, I am looking for a table with like a thousand records so i can have a good testing/example set.

---

<div class="post-metadata">

**Author:** ![rfine](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@rfine](https://community.asterisk.org/u/rfine)\
**Post date:** [February 8, 2012, 8:16pm UTC](https://community.asterisk.org/t/example-cdr-tables/38178/2 "2012-02-08T20:16:47Z")

</div>

Due to company restrictions I cannot show a filled CDR table however once it’s activated just turn it on and it will fill for you quickly.

CREATE TABLE `cdr` (  
`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 ‘’,  
`userfield` varchar(255) NOT NULL DEFAULT ‘’,  
`uniqueid` varchar(32) NOT NULL DEFAULT ‘’,  
KEY `calldate` (`calldate`),  
KEY `dst` (`dst`),  
KEY `accountcode` (`accountcode`)  
) ENGINE=MyISAM DEFAULT CHARSET=latin1

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [February 8, 2012, 10:23pm UTC](https://community.asterisk.org/t/example-cdr-tables/38178/3 "2012-02-08T22:23:56Z")

</div>

I appreciate it, but I have the table definitions. I was just wondering if anyone knew of a sample file with extensions, codes, fake names, and fake numbers. basically a redacted, but populated CDR table.
