use vars qw( %info );
use Tie::IxHash;
use Geo::StreetAddress::US;
+use Net::Vitelity;
use FS::Record qw( qsearch dbh );
use FS::phone_avail;
use FS::svc_phone;
'options' => \%options,
'no_machine' => 1,
'notes' => <<'END'
-Requires installation of
-<a href="http://search.cpan.org/dist/Net-Vitelity">Net::Vitelity</a>
-from CPAN.
-<br><br>
routesip - optional Vitelity sub-account to which newly ordered DIDs will be routed
<br>type - optional DID type (perminute, unlimited, or your-pri)
END
return [] if ( $tollfree[0] eq 'noneavailable' || $tollfree[0] eq 'none');
foreach my $did ( @tollfree ) {
- $did =~ /^(\d{3})(\d{3})(\d{4})/ or die "unparsable did $did\n";
+ $did =~ /^(\d{3})(\d{3})(\d{4})/ or die "unparsable toll-free did $did\n";
push @ret, $did;
}
die "missingdata error running Vitelity API" if $dids[0] eq 'missingdata';
foreach my $did ( @dids ) {
- $did =~ /^(\d{3})(\d{3})(\d{4})/ or die "unparsable did $did\n";
+ $did =~ /^(\d{3})(\d{3})(\d{4})/ or die "unparsable (state and ratecenter) did $did\n";
my($npa, $nxx, $station) = ($1, $2, $3);
my $phone_avail = new FS::phone_avail {
}
foreach my $did ( @dids ) {
- $did =~ /^(\d{3})(\d{3})(\d{4})/ or die "unparsable did $did\n";
+ $did =~ /^(\d{3})(\d{3})(\d{4})/ or die "unparsable (state) did $did\n";
my($npa, $nxx, $station) = ($1, $2, $3);
$npa{$npa}++;
sub vitelity_command {
my( $self, $command, @args ) = @_;
- eval "use Net::Vitelity;";
- die $@ if $@;
-
my $vitelity = Net::Vitelity->new(
'login' => $self->option('login'),
'pass' => $self->option('pass'),
sub vitelity_lnp_command {
my( $self, $command, @args ) = @_;
- eval "use Net::Vitelity 0.04;";
- die $@ if $@;
-
my $vitelity = Net::Vitelity->new(
'login' => $self->option('login'),
'pass' => $self->option('pass'),
sub check_lnp {
my $self = shift;
- my $in_svcpart = 'IN ('. join( ',', map $_->svcpart, $self->export_svc). ')';
+ my @export_svc = $self->export_svc;
+ return unless @export_svc;
+
+ my $in_svcpart = 'IN ('. join( ',', map $_->svcpart, @export_svc). ')';
foreach my $svc_phone (
qsearch({ 'table' => 'svc_phone',