summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authormark <mark>2011-01-25 08:32:39 +0000
committermark <mark>2011-01-25 08:32:39 +0000
commit82a358b848e8755e3f710a3beb4232b9e59cf18c (patch)
tree67734da2cfd2ddebd54c632fa15993c1a8d14db8 /bin
parent962240fd1b1e43bba505e0d3ba0f6afdae304dbc (diff)
more cleanup, RT#10992
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cdr-opensips.import8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/cdr-opensips.import b/bin/cdr-opensips.import
index fb82c23..2df6eff 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);