diff options
author | mark <mark> | 2011-12-10 01:03:14 +0000 |
---|---|---|
committer | mark <mark> | 2011-12-10 01:03:14 +0000 |
commit | ecb7665dc7dadd32cdfa5a1b98be57f0850c234d (patch) | |
tree | 668adca2223f4363f5cb0ffe1a055e7f24161528 /FS | |
parent | 573139dbd6c37808697bfa72a3a468bb0980d4dd (diff) |
option to keep track of unrateable CDRs, #15502
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/part_pkg/voip_cdr.pm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index 81de0bda0..35b0cac15 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -43,6 +43,13 @@ tie my %temporalities, 'Tie::IxHash', tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities(); +# previously "1" was "ignore +tie my %unrateable_opts, 'Tie::IxHash', + '' => 'Exit with a fatal error', + 1 => 'Flag for later review', + 2 => 'Ignore and continue', +; + %info = ( 'name' => 'VoIP rating by plan of CDR records in an internal (or external) SQL table', 'shortname' => 'VoIP/telco CDR rating (standard)', @@ -105,8 +112,9 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities(); 'select_options' => \%granularity, }, - 'ignore_unrateable' => { 'name' => 'Ignore calls without a rate in the rate tables. By default, the system will throw a fatal error upon encountering unrateable calls.', - 'type' => 'checkbox', + 'ignore_unrateable' => { 'name' => 'Handling of calls without a rate in the rate table', + 'type' => 'select', + 'select_options' => \%unrateable_opts, }, 'default_prefix' => { 'name' => 'Default prefix optionally prepended to customer DID numbers when searching for CDR records', @@ -637,8 +645,20 @@ sub calc_usage { #if ( ! $rate_detail && ! scalar(@call_details) ) {} if ( ! $rate_detail && $charge eq '' ) { - warn "no rate_detail found for CDR.acctid: ". $cdr->acctid. - "; skipping\n" + if ( $ignore_unrateable == 2 ) { + # throw a warning--not recommended + warn "no rate_detail found for CDR.acctid: ". $cdr->acctid. + "; skipping\n" + } + else { + # mark the CDR as unrateable + my $error = $cdr->set_status_and_rated_price( + 'failed', + '', + $cust_svc->svcnum + ); + die $error if $error; + }#if $ignore_unrateable } else { # there *is* a rate_detail (or call_details), proceed... # About this section: |