[freeside-commits] freeside/bin cdr_calltype.import,NONE,1.1
Ivan,,,
ivan at wavetail.420.am
Sat Feb 18 03:14:23 PST 2006
Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail:/tmp/cvs-serv25276/bin
Added Files:
cdr_calltype.import
Log Message:
CDR schema and class
--- NEW FILE: cdr_calltype.import ---
#!/usr/bin/perl -w
#
# bin/cdr_calltype.import ivan ~ivan/convergent/newspecs/fixed_inbound/calltypes.csv
use strict;
use FS::UID qw(dbh adminsuidsetup);
use FS::cdr_calltype;
my $user = shift or die &usage;
adminsuidsetup $user;
while (<>) {
chomp;
my $line = $_;
#$line =~ /^(\d+),"([^"]+)"$/ or do {
$line =~ /^(\d+),"([^"]+)"/ or do {
warn "unparsable line: $line\n";
next;
};
my $cdr_calltype = new FS::cdr_calltype {
'calltypenum' => $1,
'calltypename' => $2,
};
#my $error = $cdr_calltype->check;
my $error = $cdr_calltype->insert;
if ( $error ) {
warn "********** $error FOR LINE: $line\n";
dbh->commit;
#my $wait = scalar(<STDIN>);
}
}
sub usage {
"Usage:\n\ncdr_calltype.import username filename ...\n";
}
More information about the freeside-commits
mailing list