> 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 > It seems that some tuning needed. I've the following hook code: sub { my $d=${$_[0]}; my $r=${$_[1]}; my $si = $d->get(873, 10415); my $sub_id = $si->get(443, 0); my $subscription = $sub_id->get(444, 0); $subscription =~ s/^sip://g; $r->add_attr('User-Name', $subscription); &main::log($main::LOG_DEBUG,"*****AKO: $subscription"); }
It produced an error: ERR: Error in PostDiaToRadiusConversionHook(): Can't call method "get" without a package or object reference at (eval 44) line 6. Any glue, please. br, Arthur _______________________________________________ radiator mailing list radiator@open.com.au http://www.open.com.au/mailman/listinfo/radiator