[RADIATOR] Some information lost during Diameter to Radius conversion

Heikki Vatiainen hvn at open.com.au
Fri Mar 28 15:03:31 CDT 2014


On 03/28/2014 11:50 AM, Arthur wrote:

> dia_to_radius_hook.pl:
> sub
> {
>     my $d=${$_[0]};
>     my $p=${$_[1]};
> 
>     my $subscription = $p->get_attr('Subscription-Id-Data');
>     $subscription =~ s/^sip://g;
>     $p->add_attr('User-Name', $subscription);
>     &main::log($main::LOG_DEBUG,"*****AKO: User-Name: $subscription");
> }
> 
> But in the log file I have an empty 'User-Name'. Where I have did mistake?

I think you would need to do something like this:

my $si = $d->get(873, 10415); # Get 3GPP-Service-Information
my $sub_id = $si->get(443, 0); # This is IANA attr, vendor is 0
my $subscription = $sub_id->get(444, 0); # The Subscription-Id-Data

I used attribute numbers and vendor numbers for brevity. I do not think
there even is a Subcription-Id-Data in $p, the RADIUS converted request?

However, I did not check it myself but not all Diameter attributes can
be converted. The above should work in any case, because it fetches the
value from the Diameter message.

Thanks,
Heikk


> br,
> Arthur
> 
> 
> 
> 27.03.2014 21:04, Heikki Vatiainen kirjutas:
>> On 03/27/2014 04:57 PM, Arthur wrote:
>>> In my incoming Diameter Accounting message I have the following part:
>> ...
>>>       3GPP-Service-Information: VM.,
>>>          Subscription-Id: .M.,
>>>             Subscription-Id-Type: .M., END_USER_SIP_URI
>>>             Subscription-Id-Data: .M., sip:300000000 at xxxx.xx
>>> How to add "Subscription-Id-Data" (and possible "Subscription-Id-Type"
>>> too) to the Radius conversion? Currently it just dropped and I loose
>>> this information for the further analysis.
>> Hello Arthur,
>>
>> please see goodies/diameter-server.cfg and
>> PostDiaToRadiusConversionHook. This Hook is not documented in the
>> current reference manual yet, but exists to help to do any custom work
>> after the default conversion runs. The purpose of the hook is to help
>> with cases such as yours.
>>
>> There's also a respective hook from going to Radius back to Diameter.
>>
>> Thanks,
>> Heikki
>>
> 


-- 
Heikki Vatiainen <hvn at open.com.au>

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
NetWare etc.


More information about the radiator mailing list