-sub get_mac_address {
- my $p = shift;
-
-## access radius exports acct tables to get mac
- my @part_export = ();
- @part_export = (
- qsearch( 'part_export', { 'exporttype' => 'sqlradius' } ),
- qsearch( 'part_export', { 'exporttype' => 'sqlradius_withdomain' } ),
- qsearch( 'part_export', { 'exporttype' => 'broadband_sqlradius' } ),
- );
-
- my @sessions;
- foreach my $part_export (@part_export) {
- push @sessions, ( @{ $part_export->usage_sessions( {
- 'ip' => $p->{'ip'},
- } ) } );
- }
-
- my $mac = $sessions[0]->{'callingstationid'};
-
- return { 'mac_address' => $mac, };
-}
-