diff options
author | ivan <ivan> | 2008-09-12 21:56:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-09-12 21:56:50 +0000 |
commit | 66173deb130e87d029799f391317e9d378cb7f3a (patch) | |
tree | 9c8b08fe5e8499d4e1520bdd35a356b96af51026 | |
parent | f2f92e37e95cd9349d57c57f672e4aae7dc1be6b (diff) |
support multiple internal_prefixen, RT#3985
-rw-r--r-- | FS/FS/part_pkg/voip_cdr.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index 3ff791c06..af09274d7 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -79,7 +79,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', }, @@ -219,10 +219,16 @@ 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+)$/ ) { |