You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
778 B

<?php
include("util/util.php");
include("util/funcoesApl.php");
include("bd.php");
include("nocache.php");
$param = array_keys($_REQUEST);
$uid = base64_decode($param[0]);
//
// Verifica se o audios esta disponivel;
//
$query = "select a.userfield, a.billsec, b.prm_path_audio from pbx_bilhetes a, pbx_parametros b where uniqueid = '{$uid}'";
$result = pg_query($query);
if (pg_num_rows($result)) {
$dados = pg_fetch_row($result);
$audio = $dados[0];
$size = $dados[1];
$pathAudio = $dados[2];
$filepath = "/var/spool/asterisk/monitor/{$audio}";
if (file_exists($filepath)) {
DownloadAudio($audio, $filepath, 'mp3');
exit;
}
}
ob_clean();
header("HTTP/1.0 404 Not Found");
header("location: ../notfound.html");
exit();