MT#18977 compatible plaintext error dialogic page

Change-Id: I384a92cbbc4b3497c273fbbaac33f04b604edcb8
changes/75/5575/2
Gerhard Jungwirth 10 years ago
parent 18ae2d2a7a
commit 1e9f832504

@ -409,21 +409,22 @@ sub servers_flash_dialogic :Chained('servers_base') :PathPart('flash/dialogic')
$config->{out_codecs} = \@new_out_codecs;
}
$c->response->header('X-Accel-Buffering' => 'no');
$c->response->body('');
$c->response->headers->content_type('text/plain');
try {
if ($config->{mode} ne 'none') {
my $api = NGCP::Panel::Utils::DialogicImg->new(
server => 'https://' . $config->{ip_config},
);
$c->response->body('');
$c->response->header('X-Accel-Buffering' => 'no');
$c->response->headers->content_type('text/plain');
$c->write("Logging in ...\n");
$api->login( $c->config->{dialogic}{username}, $c->config->{dialogic}{password} );
die "Couldn't log in to dialogic." if ($api->appid == 0);
my $resp = $api->obtain_lock();
die "Couldn't connect to dialogic"
die "Couldn't connect to dialogic to obtain lock."
unless ($resp->code == 200);
if ($config->{mode} eq 'sipsip') {
@ -444,6 +445,8 @@ sub servers_flash_dialogic :Chained('servers_base') :PathPart('flash/dialogic')
$c->write($shortlog);
});
}
} else {
$c->write("Dialogic not enabled. Doing nothing.\n");
}
NGCP::Panel::Utils::Message::info(
c => $c,
@ -456,6 +459,7 @@ sub servers_flash_dialogic :Chained('servers_base') :PathPart('flash/dialogic')
error => $e,
desc => $c->loc('Failed to flash dialogic'),
);
$c->write("Faild to flash dialogic. Probably couldn't log in.");
};
#NGCP::Panel::Utils::Navigation::back_or($c, $c->uri_for_action('/peering/servers_root', [$c->req->captures->[0]]));
return;

@ -395,9 +395,8 @@ sub login {
my $resp = $self->post(
'/oamp/user_management/users/logged_in?appid=0',
{ user => { name => $username, password => $password } } );
my $code = $resp->code;
my $data = $resp->data;
if ( $code == 200 ) {
if ( $resp->code == 200 ) {
my $data = $resp->data;
$self->appid( $data->{appid} );
return $self->appid;
}

Loading…
Cancel
Save