Hi,
I am trying to set up using Radius for accounting. As a newbie, I am simply following the standard configuration from the menu.
Here is where I put my flags in openser.cfg:
if(method=="BYE") {
setflag(2);
};
if (method=="INVITE") {
# Account INVITE packets
setflag(2);
# Account Missed calls
setflag(3);
};
The cdr is successfully logged to the database via radius, but the starttime and endtime are incorrect. The starting time and ending time being recorded is the same. Also, I noticed that Openser only sends the message (both INSERT and UPDATE cdr) to radius when the BYE method is received. I was expecting Openser to instruct Radius to create a new record ( INSERT ) during the INVITE method and update the stoptime during the BYE method.
Here is the SQL Query log i extracted from mysql:
80603 4:38:06 6481 Query UPDATE radacct SET acctstoptime = '2008-06-03 04:38:06', acctsessiontime = '', acctinputoctets = '0' << 32 | '0', acctoutputoctets = '0' << 32 | '0', acctterminatecause = '', acctstopdelay = '0', connectinfo_stop = '' WHERE acctsessionid = 'NWQyZGI1ZTkzNGM5ZjMzZTg5ZGQ2OGVmZDY5MjYxMGE.' AND username = '1005' AND nasipaddress = '127.0.0.1'
6481 Query INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress, acctstartdelay, acctstopdelay) VALUES ('NWQyZGI1ZTkzNGM5ZjMzZTg5ZGQ2OGVmZDY5MjYxMGE.', '1412cd5bf3dd4a31', '1005', '192.168.1.104', '127.0.0.1', '5060', '', DATE_SUB('2008-06-03 04:38:06', INTERVAL (0 + 0) SECOND), '2008-06-03 04:38:06', '', '', '', '', '0' << 32 | '0', '0' << 32 | '0', 'sip:1006@192.168.1.104', 'sip:1005@192.168.1.104', '', 'IAPP-Register', '', '', '0', '0')
I would appreciate any help on getting the radius accounting to work.
Thanks alot in advance.
Pete