This is the explanation of the DB problem with ASTCC and CDRs.

CDRs in Ast-cc do not work. Below you will see why this does not function properly.

In astcc.agi:

sub savecdr():

$dbh->do("INSERT INTO cdrs (cardnum,callerid,callednum,trunk,disposition,billseconds,billcost,callstart) VALUES (" .
$dbh->quote($cardnum) . ", " . $dbh->quote($callerid) . ", " . $dbh->quote($callednum) . ", " . $dbh->quote($trunk) . ", " .
$dbh->quote($disposition) . ", " . $dbh->quote($billseconds) . ", " . $dbh->quote($billcost) . ", " . $dbh->quote($callstart) . ")");

The callstart column does NOT exist in the cdrs database. See referenced code below.

In astcc-admin.cgi:

sub create_db():

Table 'cdrs' is created.

sub users_update_db():

Table 'cdrs' is created again, this time with the 'callstart' column.

In the users_update_db() subroutine, there should be an ALTER TABLE rather than just
creating the table again. The way this is now, it will never create the callstart
column and CDRs will not work until this column is created.

Proposed replacement code for users_update_db() subroutine:

sub users_update_db()
return -1 unless $dbh->do(ALTER TABLE cdrs ADD COLUMN callstart CHAR(24) AFTER billcost);
return 0;

I believe this has been fixed in CVS. June 10/2005
rolf(at) Had to add callstart manually even with CVS of June/15 ...
Created by: chilini, Last modification: Wed 15 of Jun, 2005 (13:28 UTC) by rowitech
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+