MT#3977 Use plain port for linksys provisioning.

Linksys phones need a Cisco-signed server cert, so we have to
stay at plain http for now.
agranig/rest
Andreas Granig 12 years ago
parent 7ea0814bba
commit 5266545dd5

@ -1,4 +1,3 @@
[% barge_in = 0 -%]
<flat-profile>
<Upgrade_Enable>Yes</Upgrade_Enable>
<Upgrade_Rule>[% firmware.url %]</Upgrade_Rule>
@ -9,11 +8,18 @@
<Attendant_Console_Call_Pickup_Code>**#</Attendant_Console_Call_Pickup_Code>
<Attendant_Console_Call_Park_Code>*68</Attendant_Console_Call_Park_Code>
<Attendant_Console_Call_unPark_Code>*88</Attendant_Console_Call_unPark_Code>
<Linksys_Key_System>Yes</Linksys_Key_System>
[% FOR range IN phone.lineranges -%]
[%
used_keys = [];
FOR key IN [1 .. range.num_lines];
used_keys.$key = 0;
END
-%]
[% FOR line IN range.lines -%]
[% key = line.keynum + 1 -%]
[% used_keys.${key} = 1; -%]
[% IF range.name == "Phone Keys" -%]
[% key = line.keynum + 1 -%]
<Extension_[% key %]_>[% key %]</Extension_[% key %]_>
<Short_Name_[% key %]_>[% line.displayname %]</Short_Name_[% key %]_>
<Share_Call_Appearance_[% key %]_>[% line.type == "shared" ? line.type : "private" %]</Share_Call_Appearance_[% key %]_>
[% IF line.type == "blf" -%]
@ -26,6 +32,7 @@
<Share_Ext_[% key %]_>[% line.type == "shared" ? "shared" : "private" %]</Share_Ext_[% key %]_>
<Shared_User_ID_[% key %]_>[% line.type == "shared" ? line.username : "" %]</Shared_User_ID_[% key %]_>
[% IF line.type == "private" || line.type == "shared" -%]
<Extension_[% key %]_>[% key %]</Extension_[% key %]_>
<Register_[% key %]_>Yes</Register_[% key %]_>
<Use_DNS_SRV_[% key %]_>No</Use_DNS_SRV_[% key %]_>
[% IF line.type == "private" -%]
@ -40,12 +47,32 @@
<Outbound_Proxy_[% key %]_></Outbound_Proxy_[% key %]_>
<Use_Auth_ID_[% key %]_></Use_Auth_ID_[% key %]_>
<Auth_ID_[% key %]_></Auth_ID_[% key %]_>
[% ELSE -%]
<Extension_[% key %]_>Disabled</Extension_[% key %]_>
[% END -%]
[% ELSIF range.name == "Attendant Console 1" -%]
<Unit_1_Key_[% line.keynum + 1 %]>fnc=sd+cp+blf;sub=[% line.username %]@[% line.domain %]</Unit_1_Key_[% line.keynum + 1 %]>
<Unit_1_Key_[% key %]>fnc=sd+cp+blf;sub=[% line.username %]@[% line.domain %]</Unit_1_Key_[% key %]>
[% ELSIF range.name == "Attendant Console 2" -%]
<Unit_2_Key_[% line.keynum + 1 %]>fnc=sd+cp+blf;sub=[% line.username %]@[% line.domain %]</Unit_2_Key_[% line.keynum + 1 %]>
<Unit_2_Key_[% key %]>fnc=sd+cp+blf;sub=[% line.username %]@[% line.domain %]</Unit_2_Key_[% key %]>
[% END -%]
[% END -%]
[% END -%]
<!-- [% USE Dumper; Dumper.dump(used_keys) -%] -->
<!-- check [% range.name %] with [% range.num_lines %] keys -->
[% FOR key IN [1 .. range.num_lines] -%]
<!-- checking key [% key %] of [% range.name %] -->
[% IF range.name == "Phone Keys" -%]
[% UNLESS used_keys.$key == 1 -%]
<Extension_[% key %]_>Disabled</Extension_[% key %]_>
[% END -%]
[% ELSIF range.name == "Attendant Console 1" -%]
[% UNLESS used_keys.$key == 1 -%]
<Unit_1_Key_[% key %]></Unit_1_Key_[% key %]>
[% END -%]
[% ELSIF range.name == "Attendant Console 2" -%]
[% UNLESS used_keys.$key == 1 -%]
<Unit_2_Key_[% key %]></Unit_2_Key_[% key %]>
[% END -%]
[% END -%]
[% END -%]
[% END -%]
</flat-profile>

@ -825,7 +825,7 @@ sub pbx_device_sync :Chained('pbx_device_base') :PathPart('sync') :Args(0) {
},
server => {
uri => $c->uri_for_action('/device/dev_field_config'),
uri => 'http://' . $c->req->uri->host . ':' . ($c->config->{web}->{autoprov_plain_port} // '1444') . '/device/autoprov/config',
},
};
my ($sync_uri, $real_sync_uri) = ("", "");

@ -40,13 +40,20 @@ sub base :Chained('/') :PathPart('device') :CaptureArgs(0) {
]);
my $devfw_rs = $c->model('DB')->resultset('autoprov_firmwares');
unless($c->user->is_superuser) {
if($c->user->roles eq "subscriberadmin" || $c->user->roles eq "subscriber") {
$devfw_rs = $devfw_rs->search({
'device.reseller_id' => $c->user->voip_subscriber->contract->contact->reseller_id,
}, {
join => 'device',
});
} elsif($c->user->roles eq "reseller") {
$devfw_rs = $devfw_rs->search({
'device.reseller_id' => $c->user->reseller_id
}, {
join => 'device',
});
}
$c->stash->{devfw_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
{ name => 'id', search => 1, title => '#' },
{ name => 'device.vendor', search => 1, title => 'Device Vendor' },
@ -56,13 +63,20 @@ sub base :Chained('/') :PathPart('device') :CaptureArgs(0) {
]);
my $devconf_rs = $c->model('DB')->resultset('autoprov_configs');
unless($c->user->is_superuser) {
if($c->user->roles eq "subscriberadmin" || $c->user->roles eq "subscriber") {
$devconf_rs = $devconf_rs->search({
'device.reseller_id' => $c->user->voip_subscriber->contract->contact->reseller_id,
}, {
join => 'device',
});
} elsif($c->user->roles eq "reseller") {
$devconf_rs = $devconf_rs->search({
'device.reseller_id' => $c->user->reseller_id
}, {
join => 'device',
});
}
$c->stash->{devconf_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
{ name => 'id', search => 1, title => '#' },
{ name => 'device.vendor', search => 1, title => 'Device Vendor' },
@ -71,11 +85,17 @@ sub base :Chained('/') :PathPart('device') :CaptureArgs(0) {
]);
my $devprof_rs = $c->model('DB')->resultset('autoprov_profiles');
unless($c->user->is_superuser) {
if($c->user->roles eq "subscriberadmin" || $c->user->roles eq "subscriber") {
$devprof_rs = $devprof_rs->search({
'device.reseller_id' => $c->user->voip_subscriber->contract->contact->reseller_id,
}, {
join => { 'config' => 'device' },
});
} elsif($c->user->roles eq "reseller") {
$devprof_rs = $devprof_rs->search({
'device.reseller_id' => $c->user->reseller_id
}, {
join => 'device',
join => { 'config' => 'device' },
});
}
$c->stash->{devprof_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
@ -896,7 +916,7 @@ sub dev_field_config :Chained('/') :PathPart('device/autoprov/config') :Args() {
$vars->{firmware} = {
filename => $fw->filename,
version => $fw->version,
url => $c->uri_for_action('/device/dev_field_firmware', [ $fw->id ]),
url => 'http://' . $c->req->uri->host . ':' . ($c->config->{web}->{autoprov_plain_port} // '1444') . '/device/autoprov/firmware/' . $fw->id . '/download',
};
}

@ -549,7 +549,7 @@
if(loaded) {
console.log("iframe already loaded, we're fine?");
} else {
$('form#devsyncform .form_messages').prepend('<div class="alert alert-error" style="margin:10px">Failed to push provisioning settings to device. Is the IP Address reachable from your browser? Try to trigger the sync <a target="_blank" href="' + autoprov_uri + '">manually</a></div>');
$('form#devsyncform .form_messages').prepend('<div class="alert alert-error" style="margin:10px">Failed to push provisioning settings to device. Is the IP Address reachable from your browser? Try to trigger the sync <a target="_blank" href="' + autoprov_uri + '?' + full_params + '">manually</a></div>');
}
loaded = 1;
// TODO: get iframe by id

Loading…
Cancel
Save