TT#52961 Use custom bootstrap uri on http sync if set

In case custom "Bootstrap URI" is set and http sync (like for Cisco) is
used, then use this custom bootstrap uri during manual sync.

Also when using http sync, use the bootstrap URI instead of the config
URI to resync phone, as you don't know at this point whether the phone
has a recent firmware to connect to the server, or has to update
firmwares first.

Change-Id: I90b3393060a91619bb5957ed8ec03fda81411a2e
changes/57/27257/2
Andreas Granig 7 years ago
parent ec2c977e02
commit c56e140341

@ -1916,7 +1916,7 @@ sub pbx_device_sync :Chained('pbx_device_base') :PathPart('sync') :Args(0) {
my $schema = $c->config->{deviceprovisioning}->{secure} ? 'https' : 'http';
my $host = $c->config->{deviceprovisioning}->{host} // $c->req->uri->host;
my $port = $c->config->{deviceprovisioning}->{port} // 1444;
my $port = $c->config->{deviceprovisioning}->{bootstrap_port} // 1445;
my $t = Template->new;
my $conf = {
@ -1925,7 +1925,8 @@ sub pbx_device_sync :Chained('pbx_device_base') :PathPart('sync') :Args(0) {
},
server => {
uri => "$schema://$host:$port/device/autoprov/config",
uri => $dev->profile->config->device->bootstrap_uri //
"$schema://$host:$port/device/autoprov/bootstrap",
},
};
my $sync_params_rs = $dev->profile->config->device->autoprov_sync->search_rs({
@ -1947,6 +1948,9 @@ sub pbx_device_sync :Chained('pbx_device_base') :PathPart('sync') :Args(0) {
$sync_params_field = $sync_params_rs->search({
'autoprov_sync_parameters.parameter_name' => 'sync_params',
});
# TODO: replace server.uri var by custom bootstrap uri if set?
if($sync_params_field && $sync_params_field->first){
$sync_params_field = $sync_params_field->first->parameter_value;
}

Loading…
Cancel
Save