[freeside-commits] freeside/bin cdr-opensips.import,1.2,1.3

Mark Wells mark at wavetail.420.am
Tue Jan 25 00:32:41 PST 2011


Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail.420.am:/tmp/cvs-serv32293

Modified Files:
	cdr-opensips.import 
Log Message:
more cleanup, RT#10992

Index: cdr-opensips.import
===================================================================
RCS file: /home/cvs/cvsroot/freeside/bin/cdr-opensips.import,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- cdr-opensips.import	25 Jan 2011 01:03:24 -0000	1.2
+++ cdr-opensips.import	25 Jan 2011 08:32:39 -0000	1.3
@@ -59,14 +59,12 @@
 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 @@
   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);



More information about the freeside-commits mailing list