summaryrefslogtreecommitdiff
path: root/FS/FS/cdr.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-02-25 17:10:46 -0800
committerMark Wells <mark@freeside.biz>2013-02-25 17:10:46 -0800
commitdb5e7f34b1e17ae6ce8909062537cc2fb98ca30d (patch)
treeab15f48e4be51356ec5625e55269ec1b68e37375 /FS/FS/cdr.pm
parent2fc12e6b5a376fef9b5f5bf0301aab8497c6a412 (diff)
display inbound CDRs in selfservice, #18316; Taqua caller ID, #18574
Diffstat (limited to 'FS/FS/cdr.pm')
-rw-r--r--FS/FS/cdr.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm
index fedf28aa6..5e986ab50 100644
--- a/FS/FS/cdr.pm
+++ b/FS/FS/cdr.pm
@@ -1173,6 +1173,8 @@ sub export_formats {
length($price) ? ($opt{money_char} . $price) : '';
};
+ my $src_sub = sub { $_[0]->clid || $_[0]->src };
+
%export_formats = (
'simple' => [
sub { time2str($date_format, shift->calldate_unix ) }, #DATE
@@ -1187,7 +1189,7 @@ sub export_formats {
sub { time2str($date_format, shift->calldate_unix ) }, #DATE
sub { time2str('%r', shift->calldate_unix ) }, #TIME
#'userfield', #USER
- 'src', #called from
+ $src_sub, #called from
'dst', #NUMBER_DIALED
$duration_sub, #DURATION
#sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
@@ -1196,7 +1198,7 @@ sub export_formats {
'accountcode_simple' => [
sub { time2str($date_format, shift->calldate_unix ) }, #DATE
sub { time2str('%r', shift->calldate_unix ) }, #TIME
- 'src', #called from
+ $src_sub, #called from
'accountcode', #NUMBER_DIALED
$duration_sub, #DURATION
$price_sub,
@@ -1204,14 +1206,14 @@ sub export_formats {
'sum_duration' => [
# for summary formats, the CDR is a fictitious object containing the
# total billsec and the phone number of the service
- 'src',
+ $src_sub,
sub { my($cdr, %opt) = @_; $opt{ratename} },
sub { my($cdr, %opt) = @_; $opt{count} },
sub { my($cdr, %opt) = @_; int($opt{seconds}/60).'m' },
$price_sub,
],
'sum_count' => [
- 'src',
+ $src_sub,
sub { my($cdr, %opt) = @_; $opt{ratename} },
sub { my($cdr, %opt) = @_; $opt{count} },
$price_sub,
@@ -1245,7 +1247,7 @@ sub export_formats {
$price_sub,
],
);
- $export_formats{'source_default'} = [ 'src', @{ $export_formats{'default'} }, ];
+ $export_formats{'source_default'} = [ $src_sub, @{ $export_formats{'default'} }, ];
$export_formats{'accountcode_default'} =
[ @{ $export_formats{'default'} }[0,1],
'accountcode',
@@ -1253,7 +1255,7 @@ sub export_formats {
];
my @default = @{ $export_formats{'default'} };
$export_formats{'description_default'} =
- [ 'src', @default[0..2],
+ [ $src_sub, @default[0..2],
sub { my($cdr, %opt) = @_; $cdr->description },
@default[4,5] ];