not enough sleep to support multiple internal_prefixen, RT#3985
authorivan <ivan>
Fri, 12 Sep 2008 22:38:01 +0000 (22:38 +0000)
committerivan <ivan>
Fri, 12 Sep 2008 22:38:01 +0000 (22:38 +0000)
FS/FS/part_pkg/voip_cdr.pm

index 787f052..cef6540 100644 (file)
@@ -285,11 +285,11 @@ sub calc_recur {
           }
 
           #determine the country code
+          my $intl_match = 0;
+          foreach (@intl) { $number =~ /^$_(((\d)(\d))(\d))(\d+)$/ and do { $intl_match++; last; }; }
+
           my $countrycode;
-          if ( ( grep { $number =~ /^$_(((\d)(\d))(\d))(\d+)$/ } @intl )
-               || $number =~ /^\+(((\d)(\d))(\d))(\d+)$/
-             )
-          {
+          if ( $intl_match || $number =~ /^\+(((\d)(\d))(\d))(\d+)$/ ) {
 
             my( $three, $two, $one, $u1, $u2, $rest ) = ( $1,$2,$3,$4,$5,$6 );
             #first look for 1 digit country code