initial version appears to be hooked up and working against dev sandbox
authorIvan Kohler <ivan@freeside.biz>
Sun, 26 Jan 2014 01:05:57 +0000 (17:05 -0800)
committerIvan Kohler <ivan@freeside.biz>
Sun, 26 Jan 2014 01:05:57 +0000 (17:05 -0800)
lib/Net/VoIP_Innovations.pm

index b24f590..b3380ee 100644 (file)
@@ -23,13 +23,16 @@ our $errstr = '';
 
     use Net::VoIP_Innovations 3;
 
-    my $handle = Net::VoIP_Innovations->new(
+    my $voip_innovations = Net::VoIP_Innovations->new(
         'login'    => 'tofu',
-        'password' => 'beast',
-        'debug'    => 1,
+        'password' => 'beast', #secret
     );
 
-    #DID functions
+
+    ##
+    # DID functions
+    ##
+
     #auditDIDs
     #queryDID
     #reserveDID
@@ -37,12 +40,53 @@ our $errstr = '';
     #configDID
     #releaseDID
 
-    #911 Functions
+
+    ###
+    # 911 Functions
+    ###
+
     #insert911
+    my $response = $voip_innovations->insert911(
+      'did'        => '4155551212',
+      'address1'   => '1234 Test Lane',
+      'address2'   => '',
+      'city'       => 'Testington',
+      'state'      => 'CA',
+      'zip'        => '95454',
+      'plusFour'   => '',
+      'callerName' => 'Joe Caller',
+    );
+    if ( $response->{'responseCode'} != 100 ) {
+      die $response->{'responseMessage'};
+    }
+
     #update911
+    my $response = $voip_innovations->update911(
+      'did'        => '4155551212',
+      'address1'   => '1234 Test Lane',
+      'address2'   => '',
+      'city'       => 'Testington',
+      'state'      => 'CA',
+      'zip'        => '95454',
+      'plusFour'   => '',
+      'callerName' => 'Joe Caller',
+    );
+    if ( $response->{'responseCode'} != 100 ) {
+      die $response->{'responseMessage'};
+    }
+
     #remove911
+    my $response = $voip_innovations->remove911(
+      'did'        => '4155551212',
+    );
+    if ( $response->{'responseCode'} != 100 ) {
+      die $response->{'responseMessage'};
+    }
+
 
-    #Locator Functions
+    ###
+    # Locator Functions
+    ###
 
     ...
 
@@ -59,8 +103,6 @@ as a hash reference or a flat list of names and values.
 
 =item password (secret) (required)
 
-=item debug
-
 =back
 
 =cut
@@ -73,7 +115,6 @@ sub new {
   my $proto = shift;
   my $class = ref($proto) || $proto;
   my $self = ref($_[0]) ? shift : { @_ };
-  $self->{'debug'} ||= 0;
   bless($self, $class);
 }
 
@@ -126,8 +167,6 @@ the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-VoIP_I
 automatically be notified of progress on your bug as I make changes.
 
 
-
-
 =head1 SUPPORT
 
 You can find documentation for this module with the perldoc command.
@@ -158,9 +197,6 @@ L<http://search.cpan.org/dist/Net-VoIP_Innovations>
 =back
 
 
-=head1 ACKNOWLEDGEMENTS
-
-
 =head1 COPYRIGHT & LICENSE
 
 Copyright 2008-2014 Freeside Internet Services, Inc. (http://freeside.biz/)
@@ -176,7 +212,7 @@ The Freeside software includes support for VoIP Innovations integration, CDR
 rating, invoicing, credit card and electronic check processing, integrated
 trouble ticketing, and customer signup and self-service web interfaces.
 
-http://freeside.biz/freeside/
+L<http://freeside.biz/freeside/>
 
 =cut