diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap.pm index b282192792..6447089dda 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap.pm @@ -3,8 +3,9 @@ package NGCP::Panel::Utils::DeviceBootstrap; use strict; use Data::Dumper; -use NGCP::Panel::Utils::DeviceBootstrap::RPC; +use NGCP::Panel::Utils::DeviceBootstrap::VendorRPC; use NGCP::Panel::Utils::DeviceBootstrap::Panasonic; +use NGCP::Panel::Utils::DeviceBootstrap::Yealink; #NGCP::Panel::Utils::DeviceBootstrap::RPC params => #$params = { @@ -59,7 +60,7 @@ sub get_redirect_processor{ if('redirect_panasonic' eq $bootstrap_method){ $redirect_processor = NGCP::Panel::Utils::DeviceBootstrap::Panasonic->new( params => $params ); }elsif('redirect_yealink' eq $bootstrap_method){ - $redirect_processor = NGCP::Panel::Utils::DeviceBootstrap::yealink->new( params => $params ); + $redirect_processor = NGCP::Panel::Utils::DeviceBootstrap::Yealink->new( params => $params ); }elsif('http' eq $bootstrap_method){ #$ret = panasonic_bootstrap_register($params); } diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm index 010234e8c2..f982313b5f 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap/Panasonic.pm @@ -3,7 +3,7 @@ package NGCP::Panel::Utils::DeviceBootstrap::Panasonic; use strict; use Moose; use Data::Dumper; -extends 'NGCP::Panel::Utils::DeviceBootstrap::RPC'; +extends 'NGCP::Panel::Utils::DeviceBootstrap::VendorRPC'; has 'rpc_server_params' => ( is => 'rw', diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap/RPC.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap/VendorRPC.pm similarity index 97% rename from lib/NGCP/Panel/Utils/DeviceBootstrap/RPC.pm rename to lib/NGCP/Panel/Utils/DeviceBootstrap/VendorRPC.pm index 05c4040dc1..71b7b508f0 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap/RPC.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap/VendorRPC.pm @@ -1,4 +1,4 @@ -package NGCP::Panel::Utils::DeviceBootstrap::RPC; +package NGCP::Panel::Utils::DeviceBootstrap::VendorRPC; use strict; use URI::Escape; @@ -42,6 +42,7 @@ sub rpc_https_call{ $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}) ); my( $page, $response_code, %reply_headers ) = https_post({ 'host' => $cfg->{host}, 'port' => $cfg->{port}, diff --git a/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm b/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm index d756dba133..ac1be5213a 100644 --- a/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm +++ b/lib/NGCP/Panel/Utils/DeviceBootstrap/Yealink.pm @@ -2,7 +2,7 @@ package NGCP::Panel::Utils::DeviceBootstrap::Yealink; use strict; use Moose; -extends 'NGCP::Panel::Utils::DeviceBootstrap::RPC'; +extends 'NGCP::Panel::Utils::DeviceBootstrap::VendorRPC'; has 'rpc_server_params' => ( is => 'rw', @@ -27,7 +27,7 @@ sub rpc_server_params{ port => '443', path => '/xmlrpc', }; - $cfg->{headers} = { $self->get_basic_authorization($self->params->{credentials}) }; + $cfg->{headers} = { %{$self->get_basic_authorization($self->params->{credentials})} }; $self->{rpc_server_params} = $cfg; return $self->{rpc_server_params}; }