TT#141802 Add MAC to default SNOM 'bootstrap' URL on SRAPS

By default NGCP created bootstrap URL on SRAPS as:
> http://ngcp.server.com:1445/device/autoprov/bootstrap/
while we need to append it with MAC at the end, as SNOM has
device specific firmwares and NGCP need to know MAC to find
the device model and return proper firmware to upgrade.

The proper bootstrap URL is:
> http://ngcp.server.com:1445/device/autoprov/bootstrap/{mac}

After firmware upgrade SNOM device will connect to secure URL:
> https://ngcp.server.com:1444/device/autoprov/config/{mac}

P.S. re-using Panasonic approach for SNOM devices with a
difference: Panasonic uses label '{MAC}' and SNOM uses '{mac}'.

Change-Id: Ib1530f1adf1154deb5a8fb8a7d856810885f4736
mr10.1
Alexander Lutay 5 years ago
parent 725cbfb741
commit b106891f68

@ -55,7 +55,7 @@ EOS_XML
around 'process_bootstrap_uri' => sub {
my($orig_method, $self, $uri) = @_;
$uri = $self->$orig_method($uri);
$uri = $self->bootstrap_uri_mac($uri);
$uri = $self->bootstrap_uri_mac($uri, "{MAC}");
$self->content_params->{uri} = $uri;
return $self->content_params->{uri};
};

@ -293,4 +293,12 @@ sub generate_normalized_string {
return $normalized;
}
around 'process_bootstrap_uri' => sub {
my($orig_method, $self, $uri) = @_;
$uri = $self->$orig_method($uri);
$uri = $self->bootstrap_uri_mac($uri, "{mac}");
$self->content_params->{uri} = $uri;
return $self->content_params->{uri};
};
1;

@ -215,12 +215,12 @@ sub bootstrap_uri_protocol{
return $uri;
}
sub bootstrap_uri_mac{
my($self, $uri) = @_;
if ($uri !~/\{MAC\}$/){
if ($uri !~/\/$/){
$uri .= '/' ;
my($self, $uri, $label) = @_;
if ($uri !~ /\Q$label\E$/) {
if ($uri !~ /\/$/) {
$uri .= '/';
}
$uri .= '{MAC}' ;
$uri .= $label;
}
return $uri;
}

Loading…
Cancel
Save