add debugging
[freeside.git] / FS / FS / part_pkg / voip_cdr.pm
index 787f052..64ea20a 100644 (file)
@@ -80,7 +80,7 @@ tie my %temporalities, 'Tie::IxHash',
 #                                    'type' => 'checkbox',
 #                                  },
 
-    'international_prefix' => { 'name'    => 'Destination prefix(es) for international CDR records.  Separate multiple options with commas.',
+    'international_prefix' => { 'name'    => 'Destination prefix for international CDR records',
                                 'default' => '011',
                               },
 
@@ -269,6 +269,8 @@ sub calc_recur {
             $number = $cdr->dst;
           }
 
+          warn "parsing call $to_or_from $number\n" if $DEBUG;
+
           #remove non-phone# stuff and whitespace
           $number =~ s/\s//g;
 #          my $proto = '';
@@ -277,16 +279,10 @@ sub calc_recur {
 #          $dest =~ s/\@(.*)$// and $siphost = $1; # @10.54.32.1, @sip.example.com
 
           my $intl = $self->option('international_prefix') || '011';
-          my @intl = ();
-          if ( $intl =~ /,/ ) {
-            @intl = split(/\s*,\s*/, $intl);
-          } else {
-            @intl = ($intl);
-          }
 
           #determine the country code
           my $countrycode;
-          if ( ( grep { $number =~ /^$_(((\d)(\d))(\d))(\d+)$/ } @intl )
+          if (    $number =~ /^$intl(((\d)(\d))(\d))(\d+)$/
                || $number =~ /^\+(((\d)(\d))(\d))(\d+)$/
              )
           {