$ext = '.vmsg';
$fname = SPOOL_DIR . '/' . $dir . '/' . $call . $ext;
+ $aufile = SPOOL_DIR . '/' . $dir . '/' . $call . '.au';
if (!is_file($fname)) {
printf("<html><body><h3>Anruf %s in %s nicht gefunden!</h3></body></html>", $call, $dir);
return;
}
- if (($p = popen('vboxtoau < ' . $fname, 'r')) === false) {
+ system('vboxtoau < ' . $fname . ' > ' . $aufile);
+
+ if (($f = fopen($aufile, 'r')) === false) {
printf("<html><body><h3>Anruf %s in %s konnte geoeffnet werden!</h3></body></html>", $call, $dir);
return;
}
header(sprintf('Content-disposition: inline; filename="%s.au"', $call));
header('Content-Type: audio/basic');
- header("Cache-Control: ");
- header("Pragma: ");
+ header("Content-Length: " . filesize($aufile));
+ header("Cache-Control: no-cache" );
+ header("Pragma: no-cache" );
sleep(1);
- fpassthru($p);
-
- pclose($p);
+ fpassthru($f);
+ fclose($f);
+ unlink($aufile);
}
function archive_call($call)