projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b791eaf
)
basic import working, still need better src/dst mapping, RT#5226
author
ivan
<ivan>
Tue, 20 Oct 2009 20:47:55 +0000
(20:47 +0000)
committer
ivan
<ivan>
Tue, 20 Oct 2009 20:47:55 +0000
(20:47 +0000)
bin/cdr-netsapiens.import
patch
|
blob
|
history
diff --git
a/bin/cdr-netsapiens.import
b/bin/cdr-netsapiens.import
index
649ade6
..
b3ad5b2
100755
(executable)
--- a/
bin/cdr-netsapiens.import
+++ b/
bin/cdr-netsapiens.import
@@
-20,6
+20,8
@@
my $exportnum = shift or die &usage;
my $part_export = qsearchs('part_export', { 'exportnum' => $exportnum } )
or die "unknown exportnum $exportnum\n";
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 {
my $cdrs = 0;
do {
@@
-29,14
+31,12
@@
do {
or die dbh->errstr;
$sth->execute or die $sth->errstr;
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/',
#retreive CDRs >= this time
my $ns = $part_export->ns_command( 'GET', '/cdr/',
- 'time_release' =>
'$time_release,'
,
+ 'time_release' =>
"$time_release,"
,
'_sort' => '+time_release',
);
'_sort' => '+time_release',
);
@@
-49,7
+49,7
@@
do {
#<a href="/tac2/cdr/20090219201719000016%40SkyNet360.Com">20090219201719000016@SkyNet360.Com</a>
# <form method="post" action="/tac2/cdr/20090219201719000016%40SkyNet360.Com">
while ( $content =~
#<a href="/tac2/cdr/20090219201719000016%40SkyNet360.Com">20090219201719000016@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;
{
my $accountcode = $1;
@@
-78,8
+78,12
@@
do {
#'disposition' =>
'accountcode' => $accountcode,
#'charged_party'
#'disposition' =>
'accountcode' => $accountcode,
#'charged_party'
+ 'cdrbatch' => $cdrbatch,
};
};
+ my $error = $cdr->insert;
+ die $error if $error;
+
}
} while $cdrs;
}
} while $cdrs;