diff options
author | ivan <ivan> | 2008-09-12 21:55:27 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-09-12 21:55:27 +0000 |
commit | 1fb17d7c4fe99b48d42ae89b1241e9447d4ed699 (patch) | |
tree | c697a007a1ae7769b801ca68c0f409cda554e9bb | |
parent | 8dc7f5fd687d606943ee9c6835402e5c3d024e8f (diff) |
support multiple internal_prefixen
-rw-r--r-- | FS/FS/part_pkg/voip_cdr.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index 979134a5a..3006d6f34 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -80,7 +80,7 @@ tie my %temporalities, 'Tie::IxHash', # 'type' => 'checkbox', # }, - 'international_prefix' => { 'name' => 'Destination prefix for international CDR records', + 'international_prefix' => { 'name' => 'Destination prefix(es) for international CDR records. Separate multiple options with commas.', 'default' => '011', }, @@ -277,10 +277,15 @@ 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 ( $number =~ /^$intl(((\d)(\d))(\d))(\d+)$/ + if ( grep { $number =~ /^$_(((\d)(\d))(\d))(\d+)$/ } @intl || $number =~ /^\+(((\d)(\d))(\d))(\d+)$/ ) { |