Parsing IP and PHONE NUMBER from ACCOUNTING packet

Michael Joyner michaelwjoyner at gmail.com
Mon Dec 28 22:14:23 CET 2009


I am new to RADIUS and have been given the responsibility of managing our
RADIUS server. We use it to process the CDR's that come from our VOIP
switches. I have read the documentation, and googled several search terms
but can find an understandable example.

 

I would like to parse a VSA from the ACCOUNTING and create a variable that I
can use in the SQL statement.

 

>From these fields I need IP and PHONE NUMBER:

 

I would like to parse the attributes: 

 

Calling-Station-Id and Called-Station-Id

 

Here are sample ATTRIBUTE VALUES:

 

Calling-Station-Id =
"<sip:4784711856 at 192.168.32.19;user=phone>;tag=20c013a8+1+99ff0002+fdf42201"

 

                PHONE NUMBER              :  4784711856     ... To a
variable %{orig_number}

                IP                                            :
192.168.32.19 ... To a variable %{orig_ip}

 

                Called-Station-Id =
"<sip:14787458977 at 192.168.35.237;user=phone>"

 

                PHONE NUMBER              :  14787458977   ... To a variable
%{dest_number}

                IP                                            :
192.168.35.237... To a variable %{dest_ip}

 

My goal is to include the new values in the SQL statement :

 

.... the new fields above are in the UPDATE statement

        accounting_start_query_alt  = "UPDATE ${acct_table1} SET orig_ip =
'%{orig_ip}', orig_phone = '%{orig_phone}', dest_ip = '%{dest_ip}',
dest_phone = '%{dest_phone}', AcctStartTime = '%S', AcctStartDelay =
'%{Acct-Delay-Time}', ConnectInfo_start = '%{Connect-Info}' WHERE
AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND
NASIPAddress = '%{NAS-IP-Address}'"

Thanks in advance for your assistance.

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20091228/3bc28b97/attachment.html>


More information about the Freeradius-Users mailing list