From d206257b5dbb4c3b79a2bb61a3801f41d54e5d59 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 May 2010 06:38:26 +0000 Subject: [PATCH] fix ignore_unrateable flag, RT#8149 --- FS/FS/rate.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/FS/FS/rate.pm b/FS/FS/rate.pm index 6430ff081..347bb2743 100644 --- a/FS/FS/rate.pm +++ b/FS/FS/rate.pm @@ -272,9 +272,12 @@ sub check { =item dest_detail REGIONNUM | RATE_REGION_OBJECTD | HASHREF Returns the rate detail (see L) for this rate to the -specificed destination. Destination can be specified as an FS::rate_detail -object or regionnum (see L), or as a hashref with two keys: -I and I. +specificed destination, or the empty string if no rate can be found for +the given destination. + +Destination can be specified as an FS::rate_detail object or regionnum +(see L), or as a hashref with two keys: I +and I. =cut @@ -287,7 +290,7 @@ sub dest_detail { my $countrycode = $_[0]->{'countrycode'}; my $phonenum = $_[0]->{'phonenum'}; - #find a rate prefix, first look at most specific (4 digits) then 3, etc., + #find a rate prefix, first look at most specific, then fewer digits, # finally trying the country code only my $rate_prefix = ''; for my $len ( reverse(1..10) ) { @@ -302,10 +305,7 @@ sub dest_detail { 'npa' => '', }); - # - #die "Can't find rate for call $to_or_from +$countrycode $number\n" - die "Can't find rate for +$countrycode $phonenum\n" - unless $rate_prefix; + return '' unless $rate_prefix; $regionnum = $rate_prefix->regionnum; -- 2.11.0