summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-08-21 00:35:26 -0700
committerIvan Kohler <ivan@freeside.biz>2014-08-21 00:35:26 -0700
commitb95256aad16c4bdafd089d26c0f9147f3ec7755e (patch)
tree2b03b89dd2d4f6954bfdca996271607eec1075cc
parentdbf543b4433ed8dc96211fe1f18fd2f95db3ca7e (diff)
how Calling-Station-Id on RADIUS reports (as a MAC address w/vendor), RT#29154
-rw-r--r--FS/FS/part_export/sqlradius.pm2
-rw-r--r--httemplate/search/sqlradius.cgi42
2 files changed, 32 insertions, 12 deletions
diff --git a/FS/FS/part_export/sqlradius.pm b/FS/FS/part_export/sqlradius.pm
index 5d84f37ec..7ec869cb2 100644
--- a/FS/FS/part_export/sqlradius.pm
+++ b/FS/FS/part_export/sqlradius.pm
@@ -48,7 +48,7 @@ tie %options, 'Tie::IxHash',
},
'show_called_station' => {
type => 'checkbox',
- label => 'Show the Called-Station-ID on session reports',
+ label => 'Show the Called-Station-ID on session reports', #as a phone number
},
'overlimit_groups' => {
label => 'Radius groups to assign to svc_acct which has exceeded its bandwidth or time limit (if not overridden by overlimit_groups global or per-agent config)',
diff --git a/httemplate/search/sqlradius.cgi b/httemplate/search/sqlradius.cgi
index f7873e72f..604f44ea0 100644
--- a/httemplate/search/sqlradius.cgi
+++ b/httemplate/search/sqlradius.cgi
@@ -13,17 +13,6 @@
% if ( $part_export->option('hide_data') ) {
% delete $efields{$_} foreach qw(acctinputoctets acctoutputoctets);
% }
-% if ( $part_export->option('show_called_station') ) {
-% $efields->Splice(1, 0,
-% 'calledstationid' => {
-% 'name' => 'Destination',
-% 'attrib' => 'Called-Station-ID',
-% 'fmt' =>
-% sub { length($_[0]) ? shift : '&nbsp'; },
-% 'align' => 'left',
-% },
-% );
-% }
<FONT CLASS="fsinnerbox-title">
<% $part_export->exportname || $part_export->exporttype |h %>
@@ -384,6 +373,37 @@ tie %fields, 'Tie::IxHash',
},
align => 'right',
},
+ 'callingstationid' => {
+ name => 'Source&nbsp;or&nbsp;MAC',
+ attrib => 'Calling-Station-Id',
+ fmt => sub {
+ my $src = shift;
+ if ( $src =~
+ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
+ return $src. ' ('.
+ (Net::MAC::Vendor::lookup($1))->[0].
+ ')';
+
+ }
+ length($src) ? $src : '&nbsp';
+ },
+ align => 'right',
+ },
+ 'calledstationid' => {
+ name => 'Destination',
+ attrib => 'Called-Station-ID',
+ fmt => sub {
+ my $dst = shift;
+ if ( $dst =~
+ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
+ return $dst. ' ('.
+ (Net::MAC::Vendor::lookup($1))->[0].
+ ')';
+ }
+ length($dst) ? $dst : '&nbsp';
+ },
+ align => 'left',
+ },
'acctstarttime' => {
name => 'Start&nbsp;time',
attrib => 'Acct-Start-Time',