[Asterisk-Users] AMP 1.10.007 problem on cdr_mysql_table.sql

Colin Anderson ColinA at landmarkmasterbuilder.com
Fri Apr 8 07:13:56 MST 2005


Just documenting this issue and how I solved it for future reference on the
list, hope it helps someone:

I blew away my primary Asterisk install just because I felt it wasn't as
clean as it could be. I wanted to put on the latest AMP 1.0.007 (which, by
the way, totally rocks) and everything went fine, except when I opened the
call detail reports page PHP gave me a bunch of errors about no fields in
asteriskcdrdb. Doing a "show tables from asteriskcdrdb" in mySql yielded
nothing. Thinking this was a permissions problem, I fooled around with
permissions and repopulated the database with the procedure documented in
the install guide:

mysql -u root -p asteriskcdrdb < /usr/src/AMP/SQL/cdr_mysql_table.sql

I did this several times and every time it kicked back to the command
prompt, no problem. But every time, no tables! I was starting to get
frustrated, so I put in phpMyAdmin and logged in and browsed the database.
Nothing. WTF?

I had the brainwave of actually looking at the SQL file,
cdr_mysql_table.sql. It was empty! All of the other files were ok. To make
sure it wasn't something to do with my box, I un-tar'd from the source again
- same thing. 

To fix it, I downloaded 1.10.006, untar'd it, got the SQL, and executed the
SQL manually in phpMyAdmin, and it went fine. Here's the SQL:

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 '', 
   uniqueid varchar(32) NOT NULL default '', 
   userfield varchar(255) NOT NULL default '' 
); 

So, AMP 1.10.007 from SourceForge seems to have this problem, anyone
upgrading won't run into this problem but a new install you will.



More information about the asterisk-users mailing list