[Asterisk-Users] A2billing with Mysql-5.0.15

Rafael R. GV rafael.risco at gmail.com
Sun Nov 13 19:29:36 MST 2005


Thank you
this is what I made to solve it:

1.- create table 'calls' using: " starttime TIMESTAMP DEFAULT now() NOT
NULL, " (it can be "starttime TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,"
too) :

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)
);


2.- Change value FG_TABLE_NAME="call t1" for FG_TABLE_NAME="calls t1" in
following files:

A2Billing_UI/Public/call-log-customers.php
A2Billing_UI/Public/invoices.php
A2BCustomer_UI/balance.php
A2BCustomer_UI/invoices.php


3.- Change value "INSERT INTO call" for "INSERT INTO calls" in following
files:

/var/lib/asterisk/agi-bin/libs_a2billing/db_php_lib/Class.RateEngine.php
/var/lib/asterisk/agi-bin/libs_a2billing/Class.A2Billing.php
/wwwroot/A2BCustomer_UI/lib/Class.A2Billing.php
/wwwroot/A2Billing_UI/lib/Class.A2Billing.php

now it works...

rafael

PS: mysql-schema does not work properly in mysql 5.0.x because only one
timestamp with default now() in a table its allowed as you told me and also
I´ve found other issue related to auto_increment value:

ERROR 1064 (42000) at line 87: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'call (
id BIGINT NOT NULL AUTO_INCREMENT,
sessionid CHAR(40) NOT NULL,
' at line 1





On 11/13/05, Vahan Yerkanian <vahan at arminco.com> wrote:
>
> Rafael R. GV wrote:
> > 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:
>
> > -> starttime TIMESTAMP DEFAULT 'now()' NOT NULL,
>
> this should read
>
> starttime TIMESTAMP DEFAULT now() NOT NULL
>
> now() is a builtin MySQL function and doesn't need to be enclosed in 's.
> Also, you can have only one timestamp with default now() in a table...
>
>
> HTH,
> Vahan
>
>
>


--

rrgv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051113/72ceddca/attachment.htm


More information about the asterisk-users mailing list