From 6d3fa76e7f4566e307a50d088d2fa230aeb4a31d Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Thu, 28 Nov 2013 15:23:31 +0100 Subject: [PATCH] MT#5173 Very basic support for polycom prov Bootstrap Params: 447=2,445=[% server.uri %],264=2 Bootstrap Method: POST Bootstrap URI: http://[% client.ip %]/form-submit --- assets/polycom-vvx-configtemplate.tt | 46 ++++++++++++++++++++++++++++ lib/NGCP/Panel/Controller/Device.pm | 19 ++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 assets/polycom-vvx-configtemplate.tt diff --git a/assets/polycom-vvx-configtemplate.tt b/assets/polycom-vvx-configtemplate.tt new file mode 100644 index 0000000000..20f281ac2b --- /dev/null +++ b/assets/polycom-vvx-configtemplate.tt @@ -0,0 +1,46 @@ + + + + diff --git a/lib/NGCP/Panel/Controller/Device.pm b/lib/NGCP/Panel/Controller/Device.pm index 7d3acf197f..bc99dd9cd3 100644 --- a/lib/NGCP/Panel/Controller/Device.pm +++ b/lib/NGCP/Panel/Controller/Device.pm @@ -877,8 +877,27 @@ sub dev_field_config :Chained('/') :PathPart('device/autoprov/config') :Args() { $c->response->status(404); return; } + + if($id =~ /^[a-fA-F0-9]{12}\.cfg$/ + && $c->req->user_agent =~ /PolycomVVX/ + ) { + $id =~ s/\.cfg$//; + $c->response->content_type('text/xml'); + $c->response->body( + ''. + '' + ); + return; + } + $id =~ s/^([^\=]+)\=0$/$1/; $id = lc $id; + $id =~ s/\-phone\.cfg$//; # polycoms send a -phone.cfg suffix my $dev = $c->model('DB')->resultset('autoprov_field_devices')->find({ identifier => $id