Tim Petersen wrote:
>> The question I have is it possible to have acctstop queries that
>> insert data into 2 different tables and will both queries be
>> triggered for each call record.

Thor Spruyt wrote:
>Yes, just append them with ; in between like so:
>INSERT INTO table1 (...) VALUES (...); INSERT INTO table2 (...) VALUES
>(...);

I tried what was suggested. And when I run the query from MySQLCC both the
tables are affected the way that they are suppose to be. But when I run it
inside of radius neither table is affected but my sqltrace tells me that the
queries ran. This is the exact accounting_stop_query from my sql.conf file.

accounting_stop_query = "INSERT INTO ${acct_table2} (RadAcctId,
AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId,
NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic,
ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, DestinationIP,
CalledStationId, CallingStationId, AcctTerminateCause, ServiceType,
FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) values('',
'%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{User-Name}',
'%{NAS-Identifier}', '%{NAS-IP-Address}', '0', '%{NAS-Port-Type}',
DATE_SUB('%S',INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0})
SECOND), '%S', '%{Acct-Session-Time}', '%{h323-gw-id}', '0', '0', '0',
'%{h323-remote-address}', '%{Called-Station-Id}', '%{Calling-Station-Id}',
'%{h323-disconnect-cause}', '%{Service-Type}', '0', '%{Framed-IP-Address}',
'0', '%{Acct-Delay-Time}') ; UPDATE ${acct_table1} SET AcctStopTime = '%S',
AcctSessionTime = '%{Acct-Session-Time}', AcctTerminateCause =
'%{h323-disconnect-cause}' WHERE AcctUniqueId = '%{Acct-Unique-Session-Id}'
AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}' AND
FramedIPAddress = '%{Framed-IP-Address}'"

Can anybody see anything wrong with this?





- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to