X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fglobalpops_voip.pm;h=67b48bb4a76370d237a4bc73f4034176a4275499;hb=2848f5b5675c28051c3ddbc9b9fb302423a43ca4;hp=4213bd1d192a3ebe74f36f25d4beb6c6a773694e;hpb=8a7aeda3fe2c178b0c492401adc6bf6afe47ec67;p=freeside.git diff --git a/FS/FS/part_export/globalpops_voip.pm b/FS/FS/part_export/globalpops_voip.pm index 4213bd1d1..67b48bb4a 100644 --- a/FS/FS/part_export/globalpops_voip.pm +++ b/FS/FS/part_export/globalpops_voip.pm @@ -12,6 +12,7 @@ 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' }, + 'dry_run' => { label=>"Test mode - don't actually provision" }, ; %info = ( @@ -31,7 +32,7 @@ sub get_dids { my $self = shift; my %opt = ref($_[0]) ? %{$_[0]} : @_; - my %search = (); + my %getdids = (); # 'orderby' => 'npa', #but it doesn't seem to work :/ if ( $opt{'areacode'} && $opt{'exchange'} ) { #return numbers @@ -253,6 +254,9 @@ sub gp_command { sub _export_insert { my( $self, $svc_phone ) = (shift, shift); + + return '' if $self->option('dry_run'); + #we want to provision and catch errors now, not queue my $r = $self->gp_command('reserveDID', @@ -295,6 +299,8 @@ sub _export_replace { sub _export_delete { my( $self, $svc_phone ) = (shift, shift); + return '' if $self->option('dry_run'); + #probably okay to queue the deletion...? #but hell, let's do it inline anyway, who wants phone numbers hanging around @@ -325,20 +331,19 @@ sub _export_unsuspend { } #hmm, might forgo queueing entirely for most things, data is too much of a pita - -sub globalpops_voip_queue { - my( $self, $svcnum, $method ) = (shift, shift, shift); - my $queue = new FS::queue { - 'svcnum' => $svcnum, - 'job' => 'FS::part_export::globalpops_voip::globalpops_voip_command', - }; - $queue->insert( - $self->option('login'), - $self->option('password'), - $method, - @_, - ); -} +#sub globalpops_voip_queue { +# my( $self, $svcnum, $method ) = (shift, shift, shift); +# my $queue = new FS::queue { +# 'svcnum' => $svcnum, +# 'job' => 'FS::part_export::globalpops_voip::globalpops_voip_command', +# }; +# $queue->insert( +# $self->option('login'), +# $self->option('password'), +# $method, +# @_, +# ); +#} sub globalpops_voip_command { my($login, $password, $method, @args) = @_;