X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2Fbin%2Ffreeside-cdr-a2billing-import;h=aa7fa4a61e22676a8129d8d3bab427e27af45379;hp=a8469e744d40c637d4abc3bba7ceaad14fd7b550;hb=d898ddde102fc1b4ffc1a5e5738d38dbf438eb02;hpb=723174d9277754388b962b3acb17b5915c377911 diff --git a/FS/bin/freeside-cdr-a2billing-import b/FS/bin/freeside-cdr-a2billing-import index a8469e744..aa7fa4a61 100755 --- 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 ) { - $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}, @@ -129,8 +135,10 @@ while ( $row = $sth->fetchrow_hashref ) { enddate => time2str($row->{stoptime}), duration => $row->{sessiontime}, billsec => $row->{real_sessiontime}, - dst => $row->{calledstation}, + dst => $dst, 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?