How to setup MySQL for accounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all,

I have tried to setup MySQL for accounting but it doesn't work. Can anybody give me any advice?

This is my configuration in the gnugk.ini

[CallTable]
GenerateNBCDR=1
GenerateUCCDR=0
DefaultCallDurationLimit=3600

[Gatekeeper::Auth]
SimplePasswordAuth=optional;RRQ
SQLPasswordAuth=optional;RRQ
AliasAuth=optional;RRQ,ARQ
SQLAliasAuth=required;RRQ
default=allow

[Gatekeeper::Acct]
SQLAcct=alernative;start,update,stop
FileAcct=suppicient;stop
default=fail;start

[Accounting]
AlwaysUseCLID=1

[SQLAcct]
Driver=MySQL
Host=localhost:3306
Database=billing
Username=gnugk
Password=secret
StartQuery=INSERT INTO call (gkname, callnum, d_cause, sessid, H323id, setup_time, connect_time, disconnect_time, caller_ip, callee_ip, calling_number, caller_number) VALUES ('%g', '%n', '%c', '%s', '%u', '%{setup-time}', '%{connect-time}', '%{disconnect-time}', '%{caller-ip}', '%{callee-ip}', '%{Calling-Station-Id}', '%{Caller-Station-Id}')


StartQueryAlt=INSERT INTO call (gkname, callnum, duration, d_cause, sessid, H323id, setup_time, connect_time, disconnect_time, caller_ip, callee_ip, calling_number, caller_number) VALUES ('%g', '%n', '%d', '%c', '%s', '%u', '%{setup-time}', '%{connect-time}', '%{disconnect-time}', '%{caller-ip}', '%{callee-ip}', '%{Calling-Station-Id}', '%{Caller-Station-Id}')

UpdateQuery=UPDATE call SET duration = %d WHERE gkname = '%g' AND sessid = '%s'

StopQuery=UPDATE call SET duration = %d, disconnect_time = '%{disconnect-time}' WHERE gkname = '%g' AND sessid = '%s'

StopQueryAlt=INSERT INTO call (gkname, callnum, d_cause, sessid, H323id, setup_time, connect_time, disconnect_time, caller_ip, callee_ip, calling_number, caller_number) VALUES ('%g', '%n', '%c', '%s', '%u', '%{setup-time}', '%{connect-time}', '%{disconnect-time}', '%{caller-ip}', '%{callee-ip}', '%{Calling-Station-Id}', '%{Caller-Station-Id}')

[FileAcct]
DetailFile=/var/log/gk/cdr.log
Rotate=monthly
RotateDay=31
RotateTime=23:59

The setting of MySQL is as follows:

-- Host: localhost    Database: billing
-- ------------------------------------------------------
-- Server version       4.0.18

--
-- Table structure for table `call`
--

CREATE TABLE call (
 gkname varchar(16) NOT NULL default '',
 callnum decimal(6,0) NOT NULL default '0',
 duration decimal(5,0) NOT NULL default '0',
 d_cause decimal(16,0) NOT NULL default '0',
 sessid varchar(6) NOT NULL default '',
 H323id varchar(20) NOT NULL default '',
 setup_time varchar(30) NOT NULL default '',
 conect_time varchar(30) NOT NULL default '',
 disconnect_time varchar(100) NOT NULL default '',
 caller_ip varchar(15) NOT NULL default '',
 callee_ip varchar(15) NOT NULL default '',
 calling_number decimal(24,0) NOT NULL default '0',
 called_number decimal(24,0) NOT NULL default '0'
) TYPE=MyISAM;

--
-- Dumping data for table `call`
--
Have I done anything wrong? Please tell me.

Thank you & best Rgds.



T. F. Lau






------------------------------------------------------- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org

_______________________________________________________

List: Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux