1 create database gophone;
2 use gophone;
4 create table cdr (
5 calldate datetime NOT NULL default '0000-00-00 00:00:00',
6 clid varchar(80) NOT NULL default '',
7 src varchar(80) NOT NULL default '',
8 dst varchar(80) NOT NULL default '',
9 dcontext varchar(80) NOT NULL default '',
10 channel varchar(80) NOT NULL default '',
11 dstchannel varchar(80) NOT NULL default '',
12 lastapp varchar(80) NOT NULL default '',
13 lastdata varchar(80) NOT NULL default '',
14 duration integer NOT NULL default '0',
15 billsec integer NOT NULL default '0',
16 disposition varchar(45) NOT NULL default '',
17 amaflags integer NOT NULL default '0',
18 accountcode varchar(20) NOT NULL default '',
19 uniqueid varchar(32) NOT NULL default '',
20 userfield varchar(255) NOT NULL default ''
21 );
23 GRANT INSERT,SELECT ON gophone.cdr TO asterisk@localhost IDENTIFIED BY 'somemysqlpass';