diff --git a/lib/NGCP/Panel/Controller/Device.pm b/lib/NGCP/Panel/Controller/Device.pm index a0d425dc5b..50dbdbaf8e 100644 --- a/lib/NGCP/Panel/Controller/Device.pm +++ b/lib/NGCP/Panel/Controller/Device.pm @@ -1045,15 +1045,13 @@ sub dev_field_ajax :Chained('base') :PathPart('device/ajax') :Args(0) :Does(ACL) sub dev_field_config :Chained('/') :PathPart('device/autoprov/config') :Args() { my ($self, $c, $id) = @_; -=pod # this is going to be used if we want to do the cert check on the server, # the format is like this: # /C=US/ST=708105B37234/L=CBT153908BX/O=Cisco Systems, Inc./OU=cisco.com/CN=SPA-525G2, MAC: 708105B37234, Serial: CBT153908BX/emailAddress=linksys-certadmin@cisco.com # however, we should do it on nginx, but we need a proper CA cert # from cisco for checking the client cert? - my $ssl_dn = $c->request->env->{SSL_CLIENT_M_DN} // ""; - say ">>>>>>>>>>>>> ssl_dn=$ssl_dn"; -=cut + $c->log->debug("SSL_CLIENT_M_DN: " . ($c->request->env->{SSL_CLIENT_M_DN} // "")); + $c->log->debug("SSL_CLIENT_CERT: " . ($c->request->env->{SSL_CLIENT_CERT} // "")); unless($id) { $c->response->content_type('text/plain'); @@ -1153,7 +1151,12 @@ sub dev_field_config :Chained('/') :PathPart('device/autoprov/config') :Args() { $display_name = $sub->username; }; # TODO: only push password for private/shared line? + my $aliases = [ $sub->voip_dbaliases->search({ is_primary => 0 })->get_column("username")->all ]; + my $primary = $sub->voip_dbaliases->search({ is_primary => 1 })->get_column("username")->first; + push @{ $range->{lines} }, { + alias_numbers => $aliases, + primary_number => $primary, extension => $sub->pbx_extension, username => $sub->username, domain => $sub->domain->domain,