Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Thu, 6 Feb 2014 06:41:22 +0000 (22:41 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 6 Feb 2014 06:41:22 +0000 (22:41 -0800)
FS/FS/cdr.pm
FS/FS/detail_format/basic_upstream_dst_regionname.pm [new file with mode: 0644]
FS/FS/part_export/voip_innovations3.pm

index 80b31bf..0fdcbdf 100644 (file)
@@ -1151,6 +1151,8 @@ sub calltypename {
 
 =cut
 
+# in the future, load this dynamically from detail_format classes
+
 my %export_names = (
   'simple'  => {
     'name'           => 'Simple',
@@ -1169,6 +1171,10 @@ my %export_names = (
     'name'           => 'Basic',
     'invoice_header' => "Date/Time,Called Number,Min/Sec,Price",
   },
+  'basic_upstream_dst_regionname' => {
+    'name'           => 'Basic with upstream destination name',
+    'invoice_header' => "Date/Time,Called Number,Destination,Min/Sec,Price",
+  },
   'default' => {
     'name'           => 'Default',
     'invoice_header' => 'Date,Time,Number,Destination,Duration,Price',
diff --git a/FS/FS/detail_format/basic_upstream_dst_regionname.pm b/FS/FS/detail_format/basic_upstream_dst_regionname.pm
new file mode 100644 (file)
index 0000000..258fd90
--- /dev/null
@@ -0,0 +1,22 @@
+package FS::detail_format::basic_upstream_dst_regionname;
+
+use strict;
+use base qw(FS::detail_format);
+
+sub name { 'Basic with upstream destination name' }
+
+sub header_detail { 'Date/Time,Called Number,Destination,Min/Sec,Price' }
+
+sub columns {
+  my $self = shift;
+  my $cdr = shift;
+  (
+    $self->time2str_local('%d %b - %I:%M %p', $cdr->startdate),
+    $cdr->dst,
+    $cdr->upstream_dst_regionname,
+    $self->duration($cdr),
+    $self->price($cdr),
+  )
+}
+
+1;
index 3e4a1fe..40acfcb 100644 (file)
@@ -19,8 +19,13 @@ tie my %options, 'Tie::IxHash',
   'no_did_provision' => { label=>'Disable DID provisioning',
                        type=>'checkbox',
                      },
-  'dry_run'       => { label=>"Test mode - don't actually provision",
-                       type=>'checkbox',
+#not particularly useful unless we can_get_dids
+#  'dry_run'       => { label=>"Test mode - don't actually provision",
+#                       type=>'checkbox',
+#                     },
+  'sandbox'       => { label=>'Communicatino with the VoIP Innovations sandbox'.
+                              ' instead of the live server',
+                       type => 'checkbox',
                      },
 ;
 
@@ -52,7 +57,7 @@ sub vi_command {
   my $vi = Net::VoIP_Innovations->new(
     'login'    => $self->option('login'),
     'password' => $self->option('password'),
-    #'debug'    => $debug,
+    'sandbox'  => $self->option('sandbox'),
   );
 
   $vi->$command(@args);