projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
723174d
)
in a2billing CDR import, parse destination number out of calledstation string, #71205
author
Mark Wells
<mark@freeside.biz>
Tue, 14 Jun 2016 23:45:38 +0000
(16:45 -0700)
committer
Mark Wells
<mark@freeside.biz>
Tue, 14 Jun 2016 23:45:46 +0000
(16:45 -0700)
FS/bin/freeside-cdr-a2billing-import
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-cdr-a2billing-import
b/FS/bin/freeside-cdr-a2billing-import
index
a8469e7
..
aa7fa4a
100755
(executable)
--- a/
FS/bin/freeside-cdr-a2billing-import
+++ b/
FS/bin/freeside-cdr-a2billing-import
@@
-120,7
+120,13
@@
my $updates = 0;
my $row;
while ( $row = $sth->fetchrow_hashref ) {
my $row;
while ( $row = $sth->fetchrow_hashref ) {
- $row->{calledstation} =~ s/^1//;
+ my $dst = $row->{calledstation};
+ my $dst_ip_addr = '';
+ if ($dst =~ m[^SIP/(\d+)@(.*)$] ) {
+ $dst = $1;
+ $dst_ip_addr = $2;
+ }
+ $dst =~ s/^1//;
$row->{src} =~ s/^1//;
my $cdr = FS::cdr->new ({
uniqueid => $row->{sessionid},
$row->{src} =~ s/^1//;
my $cdr = FS::cdr->new ({
uniqueid => $row->{sessionid},
@@
-129,8
+135,10
@@
while ( $row = $sth->fetchrow_hashref ) {
enddate => time2str($row->{stoptime}),
duration => $row->{sessiontime},
billsec => $row->{real_sessiontime},
enddate => time2str($row->{stoptime}),
duration => $row->{sessiontime},
billsec => $row->{real_sessiontime},
- dst => $
row->{calledstation}
,
+ dst => $
dst
,
src => $row->{src},
src => $row->{src},
+ dst_ip_addr => $dst_ip_addr,
+ dstchannel => $row->{calledstation},
charged_party => $row->{username},
upstream_rateplanid => $row->{id_tariffplan},
upstream_rateid => $row->{id_ratecard}, # I think?
charged_party => $row->{username},
upstream_rateplanid => $row->{id_tariffplan},
upstream_rateid => $row->{id_ratecard}, # I think?