diff --git a/lib/NGCP/Panel/Controller/Device.pm b/lib/NGCP/Panel/Controller/Device.pm index f1693d6709..97f6fccf93 100644 --- a/lib/NGCP/Panel/Controller/Device.pm +++ b/lib/NGCP/Panel/Controller/Device.pm @@ -1379,7 +1379,11 @@ sub dev_static_jitsi_config :Chained('/') :PathPart('device/autoprov/static/jits my $uri = $c->req->params->{user}; my $pass = $c->req->params->{pass}; my $uuid = $c->req->params->{uuid}; - my ($user, $domain) = split /\@/, $uri; + my ($user, $domain, $tmp) = split /\@/, $uri; + if(defined $tmp) { + $user = $user . '@' . $domain; + $domain = $tmp; + } unless($user && $domain) { $c->response->content_type('text/plain'); if($c->config->{features}->{debug}) { @@ -1391,6 +1395,27 @@ sub dev_static_jitsi_config :Chained('/') :PathPart('device/autoprov/static/jits return; } + if($c->config->{deviceprovisioning}->{softphone_webauth}) { + my $sub = $c->model('DB')->resultset('provisioning_voip_subscribers')->find({ + webusername => $user, + 'domain.domain' => $domain, + webpassword => $pass, + },{ + join => 'domain', + }); + unless($sub) { + if($c->config->{features}->{debug}) { + $c->response->body("404 - webuser authentication failed"); + } else { + $c->response->body("404 - invalid user config parameters"); + } + $c->response->status(404); + return; + } + $user = $sub->username; + $pass = $sub->password; + } + my $sipacc = 'accsipngcp'.$user.$domain; my $xmppacc = 'accxmppngcp'.$user.$domain; $sipacc =~ s/[^a-zA-Z0-9]//g; diff --git a/ngcp_panel.conf b/ngcp_panel.conf index 44a6a45550..766a27c01e 100644 --- a/ngcp_panel.conf +++ b/ngcp_panel.conf @@ -129,7 +129,8 @@ log4perl.appender.Default.layout.ConversionPattern=%d{ISO8601} [%p] [%F +%L] %m{ port 4444 server_certfile /path/to/invalid ca_certfile /path/to/invalid - softphone_lockdown 0 + softphone_lockdown 1 + softphone_webauth 1