sub search_sql {
my( $class, $string ) = @_;
+
+ if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
+ $string =~ s/\W//g;
+ } else {
+ $string =~ s/\D//g;
+ }
+
+ my $conf = new FS::Conf;
+ my $ccode = ( $conf->exists('default_phone_countrycode')
+ && $conf->config('default_phone_countrycode')
+ )
+ ? $conf->config('default_phone_countrycode')
+ : '1';
+
+ $string =~ s/^$ccode//;
+
$class->search_sql_field('phonenum', $string );
}