not enough sleep to support multiple internal_prefixen, RT#3985
[freeside.git] / FS / FS / part_pkg / voip_cdr.pm
index 6d76f8b..794ae01 100644 (file)
@@ -285,11 +285,15 @@ sub calc_recur {
           }
 
           #determine the country code
+          my $intl_match = 0;
+          foreach my $i (@intl) {
+            if ( $number =~ /^$i(((\d)(\d))(\d))(\d+)$/ ) {
+              $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