[freeside-commits] branch master updated. 0cce02317f73de9a0711c6d3523820b2d0d972f5

Ivan ivan at 420.am
Mon Mar 31 16:52:27 PDT 2014


The branch, master has been updated
       via  0cce02317f73de9a0711c6d3523820b2d0d972f5 (commit)
       via  55f470de060424b123c0689d22caa26b5f4035e5 (commit)
      from  033abcada74d8b0abb19276b7fec2a03ec9b289c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0cce02317f73de9a0711c6d3523820b2d0d972f5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Mar 31 16:52:24 2014 -0700

    fix no_provision_did option, RT#

diff --git a/FS/FS/part_export/voip_innovations3.pm b/FS/FS/part_export/voip_innovations3.pm
index 143f869..3c76899 100644
--- a/FS/FS/part_export/voip_innovations3.pm
+++ b/FS/FS/part_export/voip_innovations3.pm
@@ -17,8 +17,8 @@ tie my %options, 'Tie::IxHash',
                        type=>'checkbox',
                      },
   'no_provision_did' => { label=>'Disable DID provisioning',
-                       type=>'checkbox',
-                     },
+                          type=>'checkbox',
+                        },
 #not particularly useful unless we can_get_dids
 #  'dry_run'       => { label=>"Test mode - don't actually provision",
 #                       type=>'checkbox',

commit 55f470de060424b123c0689d22caa26b5f4035e5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Mar 31 16:52:06 2014 -0700

    option to disable DID selection and provisioning, RT#27691

diff --git a/FS/FS/part_export/voip_innovations2.pm b/FS/FS/part_export/voip_innovations2.pm
index af6825c..cca9c15 100644
--- a/FS/FS/part_export/voip_innovations2.pm
+++ b/FS/FS/part_export/voip_innovations2.pm
@@ -16,6 +16,9 @@ tie my %options, 'Tie::IxHash',
   'e911'          => { label=>'Provision E911 data',
                        type=>'checkbox',
                      },
+  'no_provision_did' => { label=>'Disable DID provisioning',
+                          type=>'checkbox',
+                        },
   'dry_run'       => { label=>"Test mode - don't actually provision",
                        type=>'checkbox',
                      },
@@ -35,7 +38,10 @@ END
 
 sub rebless { shift; }
 
-sub can_get_dids { 1; }
+sub can_get_dids {
+  my $self = shift;
+  ! $self->option('no_provision_did');
+}
 
 sub get_dids {
   my $self = shift;
@@ -284,39 +290,43 @@ sub _export_insert {
 
   #we want to provision and catch errors now, not queue
 
-  ###
-  # reserveDID
-  ###
+  unless ( $self->option('no_provision_did') ) {
 
-  my $r = $self->gp_command('reserveDID',
-    'did'           => $svc_phone->phonenum,
-    'minutes'       => 1,
-    'endpointgroup' => $self->option('endpointgroup'),
-  );
+    ###
+    # reserveDID
+    ###
 
-  my $rdid = $r->{did};
+    my $r = $self->gp_command('reserveDID',
+      'did'           => $svc_phone->phonenum,
+      'minutes'       => 1,
+      'endpointgroup' => $self->option('endpointgroup'),
+    );
 
-  if ( $rdid->{'statuscode'} != 100 ) {
-    return "Error running VoIP Innovations reserveDID: ".
-           $rdid->{'statuscode'}. ': '. $rdid->{'status'};
-  }
+    my $rdid = $r->{did};
 
-  ###
-  # assignDID
-  ###
+    if ( $rdid->{'statuscode'} != 100 ) {
+      return "Error running VoIP Innovations reserveDID: ".
+             $rdid->{'statuscode'}. ': '. $rdid->{'status'};
+    }
 
-  my $a = $self->gp_command('assignDID',
-    'did'           => $svc_phone->phonenum,
-    'endpointgroup' => $self->option('endpointgroup'),
-    #'rewrite'
-    #'cnam'
-  );
+    ###
+    # assignDID
+    ###
+
+    my $a = $self->gp_command('assignDID',
+      'did'           => $svc_phone->phonenum,
+      'endpointgroup' => $self->option('endpointgroup'),
+      #'rewrite'
+      #'cnam'
+    );
 
-  my $adid = $a->{did};
+    my $adid = $a->{did};
+
+    if ( $adid->{'statuscode'} != 100 ) {
+      return "Error running VoIP Innovations assignDID: ".
+             $adid->{'statuscode'}. ': '. $adid->{'status'};
+    }
 
-  if ( $adid->{'statuscode'} != 100 ) {
-    return "Error running VoIP Innovations assignDID: ".
-           $adid->{'statuscode'}. ': '. $adid->{'status'};
   }
 
   ###
@@ -398,18 +408,25 @@ sub _export_delete {
   #probably okay to queue the deletion...?
   #but hell, let's do it inline anyway, who wants phone numbers hanging around
 
-  my $r = $self->gp_command('releaseDID',
-    'did'           => $svc_phone->phonenum,
-  );
+  unless ( $self->option('no_provision_did') ) {
+
+    my $r = $self->gp_command('releaseDID',
+      'did'           => $svc_phone->phonenum,
+    );
 
-  my $rdid = $r->{did};
+    my $rdid = $r->{did};
+
+    if ( $rdid->{'statuscode'} != 100 ) {
+      return "Error running VoIP Innovations releaseDID: ".
+             $rdid->{'statuscode'}. ': '. $rdid->{'status'};
+    }
 
-  if ( $rdid->{'statuscode'} != 100 ) {
-    return "Error running VoIP Innovations releaseDID: ".
-           $rdid->{'statuscode'}. ': '. $rdid->{'status'};
   }
 
   #delete e911 information?  assuming release clears all that
+  #if ( $self->option('e911') ) {
+  #  # but need to handle the no_provision_did case
+  #}
 
   '';
 }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_export/voip_innovations2.pm |   85 +++++++++++++++++++-------------
 FS/FS/part_export/voip_innovations3.pm |    4 +-
 2 files changed, 53 insertions(+), 36 deletions(-)




More information about the freeside-commits mailing list