Storing in SQL, repeat Attributes
Jackie Lau
Jackie at ingenio.com
Mon May 1 18:43:24 CEST 2006
Hi,
I having a problem storing repeated Attributes in to a Microsoft Sql
Database. My Start record gets logged like this:
Acct-Status-Type = Start
NAS-IP-Address = 127.0.0.254
NAS-Port = 5060
Acct-Session-Id =
"D747CE74-A671-4C07-B583-EB44CA534966 at 10.10.1.139"
Session-Ingress-CallId =
"D747CE74-A671-4C07-B583-EB44CA534966 at 10.10.1.139"
Session-Egress-CallId =
"D747CE74-A671-4C07-B583-EB44CA534966 at 10.10.1.139"
Session-Protocol-Type = "SIP"
Calling-Station-Id = "Test"
Called-Station-Id = "<sip:XXXXXXXXXX at 127.102.0.117>"
h323-setup-time = "18:01:42.091 UTC APR 28 2006"
h323-connect-time = "18:01:42.119 UTC APR 28 2006"
Session-Egress-Realm = "b11"
Session-Ingress-Realm = "p11"
FlowID = "localhost:65616"
FlowType = "PCMA"
Flow-In-Realm = "p11"
Flow-In-Src-Addr = 0.0.0.0
Flow-In-Src-Port = 0
Flow-In-Dst-Addr = 10.2.35.117
Flow-In-Dst-Port = 49232
Flow-Out-Realm = "b11"
Flow-Out-Src-Addr = 10.2.19.117
Flow-Out-Src-Port = 49232
Flow-Out-Dst-Addr = 0.0.0.0
Flow-Out-Dst-Port = 0
FlowID = "localhost:65617"
FlowType = "PCMA"
Flow-In-Realm = "b11"
Flow-In-Src-Addr = 0.0.0.0
Flow-In-Src-Port = 0
Flow-In-Dst-Addr = 10.2.19.117
Flow-In-Dst-Port = 49232
Flow-Out-Realm = "p11"
Flow-Out-Src-Addr = 10.2.35.117
Flow-Out-Src-Port = 49232
Flow-Out-Dst-Addr = 10.10.1.139
Flow-Out-Dst-Port = 49228
Client-IP-Address = 10.1.0.33
Acct-Unique-Session-Id = "bfbfead8e14980c1"
Timestamp = 1146246538
Notice how the FlowID attribute is logged twice but have different
values How do I reference the second occurance of FlowID i.e %{FlowID}
in my SQL statement in my mssql.conf? I created two new columns in my
sql database called FlowID1 and FlowID2.
accounting_update_query = "INSERT into ${acct_table1}
(AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId,
NASPortType, AcctSessionTime, AcctAuthentic, ConnectInfo_start,
AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId,
ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, FlowID1,
FlowID2) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',
'%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port-Id}',
'%{NAS-Port-Type}', '%{Acct-Session-Time}', '%{Acct-Authentic}', '',
'%{Acct-Input-Octets}', '%{Acct-Output-Octets}', '%{Called-Station-Id}',
'%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}',
'%{Framed-IP-Address}', '0', '%{FlowID}', '%{FlowID}')"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20060501/ee81af7e/attachment.html>
More information about the Freeradius-Users
mailing list