CREATE TABLE `cdr` (
  `calldate` datetime NOT NULL default '0000-00-00 00:00:00',
  `clid` varchar(80) default NULL,
  `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) default NULL,
  `lastapp` varchar(80) NOT NULL default '',
  `lastdata` varchar(80) NOT NULL default '',
  `duration` int(11) unsigned NOT NULL default '0',
  `billsec` int(11) unsigned NOT NULL default '0',
  `disposition` varchar(45) NOT NULL default '',
  `amaflags` int(2) unsigned NOT NULL default '0',
  `accountcode` varchar(32) default NULL,
  `uniqueid` varchar(32) NOT NULL default '',
  `userfield` varchar(255) default NULL,
  KEY `src` (`src`),
  KEY `dst` (`dst`),
  KEY `dcontext` (`dcontext`),
  KEY `lastapp` (`lastapp`),
  KEY `billsec` (`billsec`),
  KEY `disposition` (`disposition`),
  KEY `accountcode` (`accountcode`)
);
