agent-virtualize credit card surcharge percentage, RT#72961
[freeside.git] / FS / FS / part_export / netsapiens.pm
index aa89d47..c72093d 100644 (file)
@@ -43,6 +43,11 @@ my %features = (
   'sim' => 'Simultaneous Ring',
 );
 
+my %feature_param = (
+  'dnd' => 'n/a',
+  'sim' => '$phonenum',
+);
+
 tie my %options, 'Tie::IxHash',
   'login'           => { label=>'NetSapiens tac2 User API username' },
   'password'        => { label=>'NetSapiens tac2 User API password' },
@@ -67,10 +72,11 @@ tie my %options, 'Tie::IxHash',
 ;
 
 %info = (
-  'svc'      => [ 'svc_phone', ], # 'part_device',
-  'desc'     => 'Provision phone numbers to NetSapiens',
-  'options'  => \%options,
-  'notes'    => <<'END'
+  'svc'        => [qw( svc_phone part_device )],
+  'desc'       => 'Provision phone numbers to NetSapiens',
+  'options'    => \%options,
+  'no_machine' => 1,
+  'notes'      => <<'END'
 Requires installation of
 <a href="http://search.cpan.org/dist/REST-Client">REST::Client</a>
 from CPAN.
@@ -262,11 +268,14 @@ sub ns_create_or_update {
   ###
   foreach $feature (split /\s+/, $self->option('features') ) {
 
+    my $param= exists($feature_param{$feature}) ? $feature_param{$feature} : '';
+    $param = $phonenum if $param eq '$phonenum';
+
     my $nsf = $self->ns_command( 'PUT', $self->ns_feature($svc_phone, $feature),
       'control'    => 'd', #User Control, disable
       'expires'    => 'never',
       #'ts'         => '', #?
-      #'parameters' => '',
+      'parameters' => $param,
       'hour_match' => '*',
       'time_frame' => '*',
       'activation' => 'now',