X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fglobalpops_voip.pm;h=e256d6a40904d51ebbf37d2cec0b5f6e7d4dc98d;hb=1e14c5a832bbedde3dafa13fe9bd984b75a424db;hp=67b48bb4a76370d237a4bc73f4034176a4275499;hpb=40a7b3dc653e099f7bd0bd762b649b04c4432db2;p=freeside.git diff --git a/FS/FS/part_export/globalpops_voip.pm b/FS/FS/part_export/globalpops_voip.pm index 67b48bb4a..e256d6a40 100644 --- a/FS/FS/part_export/globalpops_voip.pm +++ b/FS/FS/part_export/globalpops_voip.pm @@ -9,15 +9,15 @@ use FS::phone_avail; @ISA = qw(FS::part_export); tie my %options, 'Tie::IxHash', - 'login' => { label=>'GlobalPOPs Media Services API login' }, - 'password' => { label=>'GlobalPOPs Media Services API password' }, - 'endpointgroup' => { label=>'GlobalPOPs endpoint group number' }, + 'login' => { label=>'VoIP Innovations API login' }, + 'password' => { label=>'VoIP Innovations API password' }, + 'endpointgroup' => { label=>'VoIP Innovations endpoint group number' }, 'dry_run' => { label=>"Test mode - don't actually provision" }, ; %info = ( 'svc' => 'svc_phone', - 'desc' => 'Provision phone numbers to GlobalPOPs VoIP', + 'desc' => 'Provision phone numbers to VoIP Innovations (formerly GlobalPOPs VoIP)', 'options' => \%options, 'notes' => <<'END' Requires installation of @@ -69,7 +69,7 @@ sub get_dids { if ( $search->{'statuscode'} == 302200 ) { return []; } elsif ( $search->{'statuscode'} != 100 ) { - die "Error running globalpop getDIDs: ". + die "Error running VoIP Innovations getDIDs: ". $search->{'statuscode'}. ': '. $search->{'status'}; #die?? } @@ -94,7 +94,7 @@ sub get_dids { my $lata_dids = $self->gp_command('getDIDs', %getdids, 'lata'=>$lata); my $lata_search = $lata_dids->{'search'}; unless ( $lata_search->{'statuscode'} == 100 ) { - die "Error running globalpop getDIDs: ". $lata_search->{'status'}; #die?? + die "Error running VoIP Innovations getDIDs: ". $lata_search->{'status'}; #die?? } my $l = $lata_search->{state}{lata}{'rate_center'}; @@ -141,16 +141,18 @@ sub get_dids { my $tn = $npa->{nxx}{tn} || $npa->{nxx}{$opt{'exchange'}}{tn}; - my @tn = ref($tn) ? @$tn : ($tn); + my @tn = ref($tn) eq 'ARRAY' ? @$tn : ($tn); #push @return, @tn; - push @return, map { - if ( /^\s*(\d{3})(\d{3})(\d{4})\s*$/ ) { - "$1-$2-$3"; - } else { - $_; - } - } - @tn; + push @return, + map { + if ( /^\s*(\d{3})(\d{3})(\d{4})\s*$/ ) { + "$1-$2-$3"; + } else { + $_; + } + } + map { ref($_) eq 'HASH' ? $_->{'content'} : $_ } #tier always 2? + @tn; } elsif ( $opt{'areacode'} ) { #return city (npa-nxx-XXXX) @@ -268,7 +270,7 @@ sub _export_insert { my $rdid = $r->{did}; if ( $rdid->{'statuscode'} != 100 ) { - return "Error running globalpop reserveDID: ". + return "Error running VoIP Innovations reserveDID: ". $rdid->{'statuscode'}. ': '. $rdid->{'status'}; } @@ -282,7 +284,7 @@ sub _export_insert { my $adid = $a->{did}; if ( $adid->{'statuscode'} != 100 ) { - return "Error running globalpop assignDID: ". + return "Error running VoIP Innovations assignDID: ". $adid->{'statuscode'}. ': '. $adid->{'status'}; } @@ -311,7 +313,7 @@ sub _export_delete { my $rdid = $r->{did}; if ( $rdid->{'statuscode'} != 100 ) { - return "Error running globalpop releaseDID: ". + return "Error running VoIP Innovations releaseDID: ". $rdid->{'statuscode'}. ': '. $rdid->{'status'}; }