[Asterisk-Users] A2billing with Mysql-5.0.15
Rafael R. GV
rafael.risco at gmail.com
Sun Nov 13 10:19:21 MST 2005
thanks Vahan
you are right, I have changed 'call t1' for 'calls t1' in balance.php and
invoices.php files and then tried to create a new table named 'calls' but
mysql 5 has changed syntax for 'TIMESTAMP DEFAULT' and this is the error:
mysql> CREATE TABLE calls (
-> id BIGINT NOT NULL AUTO_INCREMENT,
-> sessionid CHAR(40) NOT NULL,
-> uniqueid CHAR(30) NOT NULL,
-> username CHAR(40) NOT NULL,
-> nasipaddress CHAR(30),
-> starttime TIMESTAMP DEFAULT 'now()' NOT NULL,
-> stoptime TIMESTAMP,
-> sessiontime INT,
-> calledstation CHAR(30),
-> startdelay INT,
-> stopdelay INT,
-> terminatecause CHAR(20),
-> usertariff CHAR(20),
-> calledprovider CHAR(20),
-> calledcountry CHAR(30),
-> calledsub CHAR(20),
-> calledrate float,
-> sessionbill float,
-> destination CHAR(40),
-> id_tariffgroup INT,
-> id_tariffplan INT,
-> id_ratecard INT,
-> id_trunk INT,
-> sipiax INT DEFAULT '0',
-> src CHAR(40),
-> PRIMARY KEY (id)
-> );
ERROR 1067 (42000): Invalid default value for 'starttime'
I have to do some research in mysql 5 manual but I prefer to use PostgreSQL
:-)
rafael
On 11/13/05, Vahan Yerkanian <vahan at arminco.com> wrote:
>
> Rafael R. GV wrote:
> > Hi
> > I was using a2billing with mysql-4.1.12 and php-5.0.4 very successfully
> > (thanks to areski for this great project and its invaluable assistance
> > to solve some issues in my last installation...) now I´ve upgraded mysql
> > to last release 5.0.15 and, without changes in 'mya2billing' database I
> > am able to make calls, create and see created cards, etc, but I get
> > this errors when invoke CDR´s in both admin or user interfase:
> >
> > *Database error:* Invalid SQL: SELECT t1.starttime, t1.src,
> > t1.calledstation, t1.destination, t1.sessiontime, t1.username,
> > t1.terminatecause, t1.sipiax, t1.calledrate, t1.sessionbill FROM call t1
> > WHERE UNIX_TIMESTAMP(t1.starttime) >= UNIX_TIMESTAMP('2005-11-12') ORDER
> > BY t1.starttime DESC LIMIT 0,25
>
> MySQL 5.0.15 introduces stored functions and procedures that are invoked
> by 'call()'. A2Billing uses 'call' for the name of the cdr table. Find
> all occurencies of 'call t1' or ' call ' in A2Billing's sql queries and
> replace them to 'calls t1' and ' calls '. Don't forget to rename 'call'
> table to 'calls'. In short, latest A2Billing doesn't work on mysql
> 5.0.15 / PHP5 out of box.
>
> On the side note, MySQL doesn't support more than 1 entry with default
> value of "DEFAULT now() NOT NULL" in one table.
>
> regards,
> Vahan
> _______________________________________________
> --Bandwidth and Colocation sponsored by Easynews.com <http://Easynews.com>--
>
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
--
rrgv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051113/ad31761f/attachment.htm
More information about the asterisk-users
mailing list