From 82a358b848e8755e3f710a3beb4232b9e59cf18c Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 25 Jan 2011 08:32:39 +0000 Subject: [PATCH] more cleanup, RT#10992 --- bin/cdr-opensips.import | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/cdr-opensips.import b/bin/cdr-opensips.import index fb82c23bd..2df6effc6 100755 --- a/bin/cdr-opensips.import +++ b/bin/cdr-opensips.import @@ -59,14 +59,12 @@ my %cdrs; my $row; while ( $row = $sth->fetchrow_hashref ) { my ($callid) = $row->{'callid'} =~ /(.*)@/; - my ($src) = $row->{'caller_id'} =~ /^sip(\d+)@/; - my ($dst) = $row->{'callee_id'} =~ /^sip(\d+)@/; + my ($src) = $row->{'caller_id'} =~ /^sip:(\d+)@/; + my ($dst) = $row->{'callee_id'} =~ /^sip:(\d+)@/; my $cdr = $cdrs{$callid}; if ( !$cdr ) { $cdr = $cdrs{$callid} = FS::cdr->new ({ - src => $src, - dst => $dst, uniqueid => $callid, cdrbatchnum => $cdrbatchnum, }); @@ -74,6 +72,8 @@ while ( $row = $sth->fetchrow_hashref ) { my $date = str2time($row->{'time'}); if ( $row->{'method'} eq 'INVITE' ) { $cdr->startdate($date); + $cdr->src($src); + $cdr->dst($dst); } elsif ( $row->{'method'} eq 'ACK' ) { $cdr->answerdate($date); -- 2.11.0