X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fcdr-voipswitch.import;h=69d0636a7efeeebcc832df1915ca96d74ebc764b;hp=ce5b4539deb2fbce986b8ba2fff26ea3632a232e;hb=HEAD;hpb=3121656a25c75654a3fdfdf8e6036b54720ac73a diff --git a/bin/cdr-voipswitch.import b/bin/cdr-voipswitch.import old mode 100644 new mode 100755 index ce5b4539d..69d0636a7 --- a/bin/cdr-voipswitch.import +++ b/bin/cdr-voipswitch.import @@ -121,11 +121,17 @@ my $imported = 0; my $row; while ( $row = $sth->fetchrow_hashref ) { - my $cdr = FS::cdr->new( + my $ip = $row->{ip_number}; + if ( $ip =~ /^([\d\.]+)\/([\d\.]*)/ ) { + $ip = $1; + #$nat_ip = $2; + } + + my $cdr = FS::cdr->new({ cdrid => $row->{id_call}, charged_party => sprintf('%.2d', $row->{client_type}). $row->{id_client}, - src_ip_addr => $row->{ip_number}, + src_ip_addr => $ip, src => $row->{caller_id}, dst => $row->{called_number}, startdate => str2time($row->{call_start}), @@ -138,7 +144,7 @@ while ( $row = $sth->fetchrow_hashref ) { uniqueid => $row->{id_cc}, orig_call_id => $row->{clid}, billsec => $row->{effective_duration}, - lastdata => $row->{dtmf}, + #lastdata => $row->{dtmf}, disposition => $row->{call_data}, cdrbatchnum => $cdrbatchnum,