On Fri, Apr 15, 2005 at 08:15:14PM -0400, Alex Vishnev wrote:
> Date: Fri, 15 Apr 2005 20:15:14 -0400
> From: Alex Vishnev <[EMAIL PROTECTED]>
> To: [email protected]
> Subject: CISCO-AVPairs
>
> Forgive me if this has been addressed before. I searched the archive and
> only found similar questions, but no answers.... so here it goes again. I
> would like to parse CISCO-AVPairs and insert them into MySql. I am getting
> voip vsa from cisco and would like to append them into my sql table. I
> understand that I have to modify the queries in sql.conf to insert them, but
> how do access the value of them. I am running on FreeRadius1.0.2 on RH
> Linux. Example
>
> Acct-Session-Id = "00128EF0"
> Called-Station-Id = "XXXXXXXXXXX"
> h323-setup-time = "h323-setup-time=18:12:44.192 EST Fri Apr 15 2005"
> h323-gw-id = "ZZZZZZZZ"
> h323-conf-id = "h323-conf-id=5350F4BC AD3211D9 AF4CCC70 FC19EAE4"
> h323-call-origin = "h323-call-origin=answer"
> h323-call-type = "h323-call-type=Telephony"
> Cisco-AVPair = "h323-incoming-conf-id=5350F4BC AD3211D9 AF4CCC70
> FC19EAE4"
> Cisco-AVPair = "subscriber=Unknown"
> Cisco-AVPair = "gw-rxd-cdn=ton:0,npi:1,#:XXXXXXXX"
> h323-connect-time = "h323-connect-time=18:13:00.968 EST Fri Apr 15
> 2005"
h323-disconnect-time = "h323-disconnect-time=18:13:54.186 EST Fri
> Apr 15 2005"
> h323-disconnect-cause = "h323-disconnect-cause=10"
> Cisco-AVPair = "h323-ivr-out=Tariff:Unknown"
> Cisco-AVPair = "release-source=1"
> h323-voice-quality = "h323-voice-quality=0"
> Cisco-AVPair = "charged-units=0"
> Cisco-AVPair = "disconnect-text=normal call clearing (16)"
> Cisco-AVPair = "info-type=speech"
> Cisco-AVPair = "peer-id=900"
>
> So how would I access the value of Cisco-AVPAIR="disconnect-text=DDDDDDDDD".
> I tried just using '%{disconnect-text} in sql query or
> '%{Cisco-AVPAIR-disconnect-text}' but it did not work. Anyone did this
> before? Can you share config files or reference me to the instruction page?
Have you look at preprocess module? it has "cisco_vsa_hack" option
which do the folowing:
1. rewrites attributes like
h323-disconnect-cause = "h323-disconnect-cause=10"
to
h323-disconnect-cause = "10"
2. if it founds Cisco-AVPair attribute like
Cisco-AVPair = "gw-rxd-cdn=ton:0,npi:1,#:XXXXXXXX"
and there's dictionary attribute gw-rxd-cdn, then it adds new attribute
"gw-rxd-cdn" with value "ton:0,npi:1,#:XXXXXXXX".
So if you have Cisco-AVPair attributes which you would like to insert
into SQL, you need to create them in cisco dictionary.
After preprocess module process your request, you may access new
attributes in the form of %{Attribute-Name}.
Best wishes
--
Alexei Chetroi
Smile... Tomorrow will be worse. (c) Murphy's Law
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html