[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.29,1.30
Ivan,,,
ivan at wavetail.420.am
Fri Sep 12 14:55:30 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv17413
Modified Files:
voip_cdr.pm
Log Message:
support multiple internal_prefixen
Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- voip_cdr.pm 12 Sep 2008 07:08:07 -0000 1.29
+++ voip_cdr.pm 12 Sep 2008 21:55:27 -0000 1.30
@@ -80,7 +80,7 @@
# '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 @@
# $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+)$/
)
{
More information about the freeside-commits
mailing list