1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
-- Code to create MySQL table for Asterisk CDR data
-- Field descriptions from:
-- https://wiki.asterisk.org/wiki/display/AST/CDR+Fields
CREATE TABLE cdr (
accountcode VARCHAR(256) COMMENT 'What account number to use, (string, 20 characters)',
src VARCHAR(80) COMMENT 'CallerID number',
dst VARCHAR(80) COMMENT 'Destination extension',
dcontext VARCHAR(80) COMMENT 'Destination context',
clid VARCHAR(80) COMMENT 'CallerID with text',
channel VARCHAR(80) COMMENT 'Channel used',
dstchannel VARCHAR(80) COMMENT 'Destination channel if appropriate',
lastapp VARCHAR(80) COMMENT 'Last application if appropriate',
lastdata VARCHAR(80) COMMENT 'Last application data (arguments)',
tsstart DATETIME COMMENT 'Start of call (date/time)',
tsanswer DATETIME COMMENT 'Answer of call (date/time)',
tsend DATETIME COMMENT 'End of call (date/time)',
duration INT(11) COMMENT 'Total time in system, in seconds (integer), from dial to hangup',
billsec INT(11) COMMENT 'Total time call is up, in seconds (integer), from answer to hangup',
disposition ENUM('ANSWERED', 'NO ANSWER', 'BUSY') COMMENT 'What happened to the call',
amaflags ENUM('DOCUMENTATION', 'BILL', 'IGNORE') COMMENT 'What flags to use, specified on a per channel basis like accountcode.',
uniqueid VARCHAR(32) COMMENT 'Unique Channel Identifier',
userfield VARCHAR(256) COMMENT 'user field: A user-defined field, maximum 255 characters'
) ;
|