projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8dc7f5f
)
support multiple internal_prefixen
author
ivan
<ivan>
Fri, 12 Sep 2008 21:55:27 +0000
(21:55 +0000)
committer
ivan
<ivan>
Fri, 12 Sep 2008 21:55:27 +0000
(21:55 +0000)
FS/FS/part_pkg/voip_cdr.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/voip_cdr.pm
b/FS/FS/part_pkg/voip_cdr.pm
index
979134a
..
3006d6f
100644
(file)
--- 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',
# },
# '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',
},
'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';
# $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;
#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+)$/
)
{
|| $number =~ /^\+(((\d)(\d))(\d))(\d+)$/
)
{