projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c79c1bc
)
add some debugging to voip_sqlradacct
author
ivan
<ivan>
Wed, 5 Jan 2005 10:01:41 +0000
(10:01 +0000)
committer
ivan
<ivan>
Wed, 5 Jan 2005 10:01:41 +0000
(10:01 +0000)
FS/FS/part_pkg/voip_sqlradacct.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/voip_sqlradacct.pm
b/FS/FS/part_pkg/voip_sqlradacct.pm
index
7364fad
..
3f044eb
100644
(file)
--- a/
FS/FS/part_pkg/voip_sqlradacct.pm
+++ b/
FS/FS/part_pkg/voip_sqlradacct.pm
@@
-9,7
+9,7
@@
use FS::rate_prefix;
@ISA = qw(FS::part_pkg);
@ISA = qw(FS::part_pkg);
-$DEBUG =
0
;
+$DEBUG =
1
;
%info = (
'name' => 'VoIP rating by plan of CDR records in an SQL RADIUS radacct table',
%info = (
'name' => 'VoIP rating by plan of CDR records in an SQL RADIUS radacct table',
@@
-90,6
+90,8
@@
sub calc_recur {
$countrycode = '1';
}
$countrycode = '1';
}
+ warn "rating call to +$countrycode $dest" if $DEBUG;
+
#find a rate prefix, first look at most specific (4 digits) then 3, etc.,
# finally trying the country code only
my $rate_prefix = '';
#find a rate prefix, first look at most specific (4 digits) then 3, etc.,
# finally trying the country code only
my $rate_prefix = '';
@@
-106,6
+108,7
@@
sub calc_recur {
unless ( $rate_prefix ) {
if ( $self->option('ignore_unrateable') ) {
unless ( $rate_prefix ) {
if ( $self->option('ignore_unrateable') ) {
+ warn " skipping unrateable call to +$countrycode $dest";
next;
} else {
die "Can't find rate for call to +$countrycode $dest\n"
next;
} else {
die "Can't find rate for call to +$countrycode $dest\n"
@@
-119,6
+122,10
@@
sub calc_recur {
'dest_regionnum' => $regionnum,
} );
'dest_regionnum' => $regionnum,
} );
+ warn " found rate for regionnum $regionnum ".
+ "and rate detail $rate_detail"
+ if $DEBUG;
+
###
# find the price and add detail to the invoice
###
###
# find the price and add detail to the invoice
###
@@
-142,6
+149,15
@@
sub calc_recur {
$charges += $charge;
}
$charges += $charge;
}
+ warn " adding details on charge to invoice: ".
+ join(' - ',
+ "+$countrycode $dest",
+ $rate_prefix->rate_region->regionname,
+ $minutes.'m',
+ '$'.$charge,
+ )
+ if $DEBUG;
+
push @$details,
#[
join(' - ',
push @$details,
#[
join(' - ',