[xtradius] Cisco-AVPair

Top Page
Author: Nick Mashchenko
Date:  
To: XTRADIUS Mailing List
CC: Horacio J. Peсa
Subject: [xtradius] Cisco-AVPair
Hello XTRADIUS,

Does anybody here handles Cisco-AVPair attributes in external
accounting script? My problem is that when they comes from NAS,
there are a lot of the same type Cisco-AVPair, but their values
are different. When I'm using the script below, I can catch the
latest Cisco-AVPair value only. However, XTRADIUS writes all of
them into the /var/log/radacct/as5300/detail (see details below).
How to grab them into my perl script?

> My perl script:


[<18:06:31>l9-122@root radius]\> cat acct1

#!/usr/bin/perl
$ENV_FILE = "/usr/local/radius/voip_acct.stop";
use Env;
open(OUT,">>$ENV_FILE");
print OUT "Printing Parameters\n";
for ($i=0;$i<$#ARGV;$i++) {
print OUT "$i:\t[".$ARGV[$i]."]\n";
}
print OUT "Printing Environment Vars\n";
foreach $var (sort keys %ENV) {
print OUT "$var:\t[$ENV{$var}]\n";
}
print OUT "-------------------------------------------------------\n";
close(OUT);

> My "radiusd -sxyz" output:


Printing Parameters
Printing Environment Vars
Acct-Delay-Time:        [0]
Acct-Input-Octets:      [4240]
Acct-Input-Packets:     [106]
Acct-Output-Octets:     [4011]
Acct-Output-Packets:    [102]
Acct-Session-Id:        [000119D3]
Acct-Session-Time:      [0]
Acct-Status-Type:       [Stop]
Called-Station-Id:      [16019495680]
Calling-Station-Id:     [380445739528]
Cisco-AVPair:   [peer-id=1003]
Cisco-VoIP-Call-Origin: [h323-call-origin=originate]
Cisco-VoIP-Call-Type:   [h323-call-type=VoIP]
Cisco-VoIP-Conference-ID:       [h323-conf-id=DAA5B8F0 E49211D8 8E16F396 41ED4A56]
Cisco-VoIP-Connect-Time:        [h323-connect-time=16:47:55.417 GMT Tue Aug 3 2004]
Cisco-VoIP-Disconnect-Cause:    [h323-disconnect-cause=10  ]
Cisco-VoIP-Disconnect-Time:     [h323-disconnect-time=16:47:55.817 GMT Tue Aug 3 2004]
Cisco-VoIP-Gateway-ID:  [h323-gw-id=GU1.VoIP]
Cisco-VoIP-Remote-Gateway:      [h323-remote-address=62.80.1.163]
Cisco-VoIP-Setup-Time:  [h323-setup-time=16:47:46.372 GMT Tue Aug 3 2004]
Cisco-VoIP-Voice-Quality:       [h323-voice-quality=0]
Exec-Program-Account:   [/usr/local/radius/acct1]
NAS-IP-Address: [194.93.191.116]
Service-Type:   [Login-User]
User-Name:      [p813438969263]


> [<18:04:42>l9-122@root radius]\> tail -n 41 /var/log/radacct/as5300/detail


Tue Aug  3 17:47:55 2004
        Acct-Session-Id = "000119D2"
        Cisco-VoIP-Setup-Time = "h323-setup-time=16:47:19.208 GMT Tue Aug 3 2004"
        Cisco-VoIP-Gateway-ID = "h323-gw-id=GU1.VoIP"
        Cisco-VoIP-Conference-ID = "h323-conf-id=DAA5B8F0 E49211D8 8E16F396 41ED4A56"
        Cisco-VoIP-Call-Origin = "h323-call-origin=answer"
        Cisco-VoIP-Call-Type = "h323-call-type=Telephony"
        Cisco-AVPair = "h323-incoming-conf-id=DAA5B8F0 E49211D8 8E16F396 41ED4A56"
        Cisco-AVPair = "subscriber=Unknown"
        Cisco-AVPair = "in-intrfc-desc="Connection to TIK""
        Acct-Input-Octets = 35879
        Acct-Output-Octets = 61360
        Acct-Input-Packets = 308
        Acct-Output-Packets = 344
        Acct-Session-Time = 37
        Cisco-VoIP-Connect-Time = "h323-connect-time=16:47:19.221 GMT Tue Aug 3 2004"
        Cisco-VoIP-Disconnect-Time = "h323-disconnect-time=16:47:55.841 GMT Tue Aug 3 2004"
        Cisco-VoIP-Disconnect-Cause = "h323-disconnect-cause=10  "
        Cisco-AVPair = "h323-ivr-out=Tariff:Unknown"
        Cisco-VoIP-Voice-Quality = "h323-voice-quality=0"
        Cisco-AVPair = "gw-rxd-cdn=1701"
        Cisco-AVPair = "gw-rxd-cgn=445739528"
        Cisco-AVPair = "peer-address=380445739528"
        Cisco-AVPair = "peer-id=1"
        Acct-Authentic = RADIUS
        User-Name = "p813438969263"
        Acct-Status-Type = Stop
        NAS-Port-Type = Async
        Cisco-NAS-Port = "CAS 0:0:25"
        NAS-Port-Id = 0
        Cisco-AVPair = "interface=CAS 0:0:25"
        Calling-Station-Id = "380445739528"
        Called-Station-Id = "016019495680"
        Service-Type = Login-User
        NAS-IP-Address = 194.93.191.116
        Unknown-Attr-55 = "A\017\245\233"
        Acct-Delay-Time = 0
        Timestamp = 1091544475
        Request-Authenticator = Verified
[<18:04:51>l9-122@root radius]\>


--
MNV-UANIC

_______________________________________________
xtradius mailing list
xtradius@???
http://lists.q-linux.com/mailman/listinfo/xtradius