TT#72163 - Fix 500 error on recorded streams

* Add check wether recording stream actually
	   exists, to prevent throwing error in case
	   there's a DB entry for the stream, but no
	   actual file is saved

Change-Id: Ibd051496f570f05ca7067dcaa9f2f9e85e5d84d6
changes/97/37997/2
Flaviu Mates 5 years ago
parent 52f1024a4e
commit 574857cdec

@ -4189,6 +4189,16 @@ sub play_stream :Chained('recording_stream') :PathPart('play') :Args(0) {
# TODO: fix to be able to select certain stream
my $stream = $c->stash->{stream};
unless (-e $stream->full_filename) {
NGCP::Panel::Utils::Message::error(
c => $c,
log => "no such recording file for stream with id ".$stream->id,
desc => $c->loc('No such recording file'),
);
$c->response->redirect($c->uri_for_action('/subscriber/details', [$c->req->captures->[0]]));
$c->detach;
return;
}
my $data = read_file($stream->full_filename);
my $mime_type;
if($stream->file_format eq "wav") {

Loading…
Cancel
Save