'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' },
;
%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.
sub check_options {
- my ($self, $options) = @_;
+ my ($self, $options) = @_;
- my $rex = qr/$RE{URI}{HTTP}{-scheme => qr|https?|}/; # match any "http:" or "https:" URL
+ my $rex = qr/$RE{URI}{HTTP}{-scheme => qr|https?|}/; # match any "http:" or "https:" URL
- for my $key (qw/url device_url/) {
- if ($$options{$key} && ($$options{$key} !~ $rex)) {
- return "Invalid (URL): " . $$options{$key};
- }
- }
- return '';
+ for my $key (qw/url device_url/) {
+ if ($$options{$key} && ($$options{$key} !~ $rex)) {
+ return "Invalid (URL): " . $$options{$key};
+ }
+ }
+ return '';
}
###
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',