1 package FS::part_export::globalpops_voip;
3 use vars qw(@ISA %info);
7 @ISA = qw(FS::part_export);
9 tie my %options, 'Tie::IxHash',
10 'login' => { label=>'GlobalPOPs Media Services API login',
11 'password' => { label=>'GlobalPOPs Media Services API password',
16 'desc' => 'Provision phone numbers to GlobalPOPs VoIP',
17 'options' => \%options,
19 Requires installation of
20 <a href="http://search.cpan.org/dist/Net-GlobalPOPs-MediaServicesAPI">Net::GlobalPOPs::MediaServicesAPI</a>
25 sub rebless { shift; }
28 my( $self, $svc_phone ) = (shift, shift);
29 #we want to provision and catch errors now, not queue
33 my( $self, $new, $old ) = (shift, shift, shift);
34 #hmm, what's to change?
38 my( $self, $svc_phone ) = (shift, shift);
39 #probably okay to queue the deletion...
43 my( $self, $svc_phone ) = (shift, shift);
47 sub _export_unsuspend {
48 my( $self, $svc_phone ) = (shift, shift);
52 #hmm, might forgo queueing entirely for most things, data is too much of a pita
54 sub globalpops_voip_queue {
55 my( $self, $svcnum, $method ) = (shift, shift, shift);
56 my $queue = new FS::queue {
58 'job' => 'FS::part_export::globalpops_voip::globalpops_voip_command',
61 $self->option('login'),
62 $self->option('password'),
68 sub globalpops_voip_command {
69 my($login, $password, $method, @args) = @_;
71 eval "use Net::GlobalPOPs::MediaServicesAPI;";
74 my $gp = new Net::GlobalPOPs
76 'password' => $password,
80 my $return = $gp->$method( @args );
83 #$return->{'statuscode'}
85 die $return->{'status'} if $return->{'statuscode'};