[freeside-commits] freeside/bin cdr-netsapiens.import, 1.1.2.1, 1.1.2.2
Ivan,,,
ivan at wavetail.420.am
Tue Oct 20 13:47:59 PDT 2009
Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail.420.am:/tmp/cvs-serv10951
Modified Files:
Tag: FREESIDE_1_9_BRANCH
cdr-netsapiens.import
Log Message:
basic import working, still need better src/dst mapping, RT#5226
Index: cdr-netsapiens.import
===================================================================
RCS file: /home/cvs/cvsroot/freeside/bin/cdr-netsapiens.import,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- cdr-netsapiens.import 12 Oct 2009 14:11:33 -0000 1.1.2.1
+++ cdr-netsapiens.import 20 Oct 2009 20:47:56 -0000 1.1.2.2
@@ -20,6 +20,8 @@
my $part_export = qsearchs('part_export', { 'exportnum' => $exportnum } )
or die "unknown exportnum $exportnum\n";
+my $cdrbatch = 'NetSapiens import '. time2str('%Y-%m-%d %x', $^T);
+
my $cdrs = 0;
do {
@@ -29,14 +31,12 @@
or die dbh->errstr;
$sth->execute or die $sth->errstr;
- my $time_relase = time2str('%Y-%m-%d %x', $sth->fetchrow_arrayref->[0]);
- #2009-02-19 20:17:37
- #my $time_release = '2009-01-01 00:00:00';
+ my $time_release = time2str('%Y-%m-%d %x', $sth->fetchrow_arrayref->[0]);
#retreive CDRs >= this time
my $ns = $part_export->ns_command( 'GET', '/cdr/',
- 'time_release' => '$time_release,',
+ 'time_release' => "$time_release,",
'_sort' => '+time_release',
);
@@ -49,7 +49,7 @@
#<a href="/tac2/cdr/20090219201719000016%40SkyNet360.Com">20090219201719000016 at SkyNet360.Com</a>
# <form method="post" action="/tac2/cdr/20090219201719000016%40SkyNet360.Com">
while ( $content =~
- s/^.*?<form method="post" action="\/tac2\/cdr\/(\d+)\%40[^"]*">//is )
+ s/^.*?<form class="" method="post" action="\/tac2\/cdr\/(\d+)\%40[^"]*">//is )
{
my $accountcode = $1;
@@ -78,8 +78,12 @@
#'disposition' =>
'accountcode' => $accountcode,
#'charged_party'
+ 'cdrbatch' => $cdrbatch,
};
+ my $error = $cdr->insert;
+ die $error if $error;
+
}
} while $cdrs;
More information about the freeside-commits
mailing list