summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2010-05-11 06:38:26 +0000
committerivan <ivan>2010-05-11 06:38:26 +0000
commitd206257b5dbb4c3b79a2bb61a3801f41d54e5d59 (patch)
tree6ab3e7f08378e7caa5b8173da2717b30dd9b8c62 /FS
parent3e6d2cb1f1eafdf0cbefc2f930c33dafb4cf7642 (diff)
fix ignore_unrateable flag, RT#8149
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/rate.pm16
1 files 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<FS::rate_detail>) for this rate to the
-specificed destination. Destination can be specified as an FS::rate_detail
-object or regionnum (see L<FS::rate_detail>), or as a hashref with two keys:
-I<countrycode> and I<phonenum>.
+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<FS::rate_detail>), or as a hashref with two keys: I<countrycode>
+and I<phonenum>.
=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;