diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap.pm index 9c165602f8..f4839bbc75 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap.pm @@ -32,13 +32,13 @@ sub _dispatch{ $c->log->debug( "action=$action;" ); if($redirect_processor->can($action)){ $ret = $redirect_processor->$action(); - $c->log->debug( "ret=$ret;" ); }else{ if( ('register' eq $action) && $params->{mac_old} && ( $params->{mac_old} ne $params->{mac} ) ){ $redirect_processor->redirect_server_call('unregister'); } $ret = $redirect_processor->redirect_server_call($action); } + $c->log->debug( "ret=$ret;" ); } return $ret; } @@ -68,14 +68,12 @@ sub get_devmod_params{ redirect_params => $sync_params, credentials => $vcredentials, }; - $c->log->debug(Dumper($sync_params)); return $params; } sub get_redirect_processor{ my ($params) = @_; my $c = $params->{c}; my $bootstrap_method = $params->{bootstrap_method}; - $c->log->debug( "bootstrap_method AAAAAAAAA =$bootstrap_method;" ); my $redirect_processor; if('redirect_panasonic' eq $bootstrap_method){ $redirect_processor = NGCP::Panel::Utils::DeviceBootstrap::Panasonic->new( params => $params ); @@ -86,7 +84,6 @@ sub get_redirect_processor{ }elsif('http' eq $bootstrap_method){ #$ret = panasonic_bootstrap_register($params); } - $c->log->debug( "redirect_processor=$redirect_processor;" ); return $redirect_processor; } diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm index 59d57510e2..c85c9f6aee 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm @@ -5,21 +5,6 @@ use Moose; use Data::Dumper; extends 'NGCP::Panel::Utils::DeviceBootstrap::VendorRPC'; -has 'rpc_server_params' => ( - is => 'rw', - isa => 'HashRef', - accessor => '_rpc_server_params', -); -has 'register_content' => ( - is => 'rw', - isa => 'Str', - accessor => '_register_content', -); -has 'unregister_content' => ( - is => 'rw', - isa => 'Str', - accessor => '_unregister_content', -); sub rpc_server_params{ my $self = shift; my $cfg = { diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap/Polycom.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap/Polycom.pm index aa72c94965..c972c10a08 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap/Polycom.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap/Polycom.pm @@ -8,21 +8,6 @@ use Moose; extends 'NGCP::Panel::Utils::DeviceBootstrap::VendorRPC'; -has 'rpc_server_params' => ( - is => 'rw', - isa => 'HashRef', - accessor => '_rpc_server_params', -); -has 'register_content' => ( - is => 'rw', - isa => 'Str', - accessor => '_register_content', -); -has 'unregister_content' => ( - is => 'rw', - isa => 'Str', - accessor => '_unregister_content', -); has 'register_subscriber_content' => ( is => 'rw', isa => 'Str', diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap/VendorRPC.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap/VendorRPC.pm index 0095b80ee7..8739e485d0 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap/VendorRPC.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap/VendorRPC.pm @@ -20,13 +20,23 @@ has 'content_params' => ( has 'rpc_server_params' => ( is => 'rw', isa => 'HashRef', + accessor => '_rpc_server_params', +); +has 'register_content' => ( + is => 'rw', + isa => 'Str', + accessor => '_register_content', +); +has 'unregister_content' => ( + is => 'rw', + isa => 'Str', + accessor => '_unregister_content', ); sub redirect_server_call{ my ($self, $action) = @_; my $c = $self->params->{c}; $self->init_content_params(); - $c->log->debug(Dumper ($self->content_params)); my($content,$response_value,$ret); my $method = $action.'_content'; if($self->can($method)){ @@ -36,7 +46,6 @@ sub redirect_server_call{ } if($content){ $response_value = $self->rpc_https_call($content); - $c->log->debug(Dumper $response_value); $ret = $self->extract_response_description($response_value); } return $ret; @@ -46,8 +55,8 @@ sub rpc_https_call{ my($self, $content, $cfg) = @_; $cfg //= $self->rpc_server_params; my $c = $self->params->{c}; - $c->log->debug( "host=$cfg->{host}; port=$cfg->{port}; path=$cfg->{path}; content=$content;" ); - $c->log->debug( Dumper($cfg->{headers}) ); + $c->log->debug( "rpc_https_call: host=$cfg->{host}; port=$cfg->{port}; path=$cfg->{path}; content=$content;" ); + #$c->log->debug( Dumper($cfg->{headers}) ); my( $page, $response_code, %reply_headers ) = https_post({ 'host' => $cfg->{host}, 'port' => $cfg->{port}, @@ -106,7 +115,6 @@ sub get_basic_authorization{ my($self) = @_; my $authorization = encode_base64(join(':',@{$self->params->{credentials}}{qw/user password/})); $authorization =~s/[ \s]//gis; - #$authorization .= '='; return { 'Authorization' => 'Basic '.$authorization }; } sub get_bootstrap_uri{ diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm index a88bb13b9b..f53200a212 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm @@ -5,21 +5,6 @@ use Moose; use Digest::MD5 qw/md5_hex/; extends 'NGCP::Panel::Utils::DeviceBootstrap::VendorRPC'; -has 'rpc_server_params' => ( - is => 'rw', - isa => 'HashRef', - accessor => '_rpc_server_params', -); -has 'register_content' => ( - is => 'rw', - isa => 'Str', - accessor => '_register_content', -); -has 'unregister_content' => ( - is => 'rw', - isa => 'Str', - accessor => '_unregister_content', -); has 'register_model_content' => ( is => 'rw', isa => 'Str', diff --git a/share/templates/device/list.tt b/share/templates/device/list.tt index 493023c95c..ef82ca9c23 100644 --- a/share/templates/device/list.tt +++ b/share/templates/device/list.tt @@ -25,21 +25,14 @@ function vendor2bootstrapMethod(vendorField){ } if(vendorField && vendorField.value){//onchange and on load after error var bootstrapMethod=''; - switch(vendorField.value.toLowerCase()){ + var vendor = vendorField.value.toLowerCase(); + switch(vendor){ case "cisco": bootstrapMethod = 'http'; break; ; - case "panasonic": - bootstrapMethod = 'redirect_panasonic'; - break; - ; - case "yealink": - bootstrapMethod = 'redirect_yealink'; - break; - ; - case "polycom": - bootstrapMethod = 'redirect_polycom'; + default: + bootstrapMethod = 'redirect_'+vendor; break; ; }