mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Add a shutdown function fax send
This commit is contained in:
@@ -65,6 +65,21 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//shutdown call back function
|
||||
function shutdown() {
|
||||
//when the fax status is still sending
|
||||
//then set the fax status to trying
|
||||
$sql = "update v_fax_queue ";
|
||||
$sql .= "set fax_status = 'trying' ";
|
||||
$sql .= "where fax_queue_uuid = :fax_queue_uuid ";
|
||||
$sql .= "and fax_status = 'sending' ";
|
||||
$database = new database;
|
||||
$parameters['fax_queue_uuid'] = $fax_queue_uuid;
|
||||
$database->execute($sql, $parameters);
|
||||
unset($sql);
|
||||
}
|
||||
register_shutdown_function('shutdown');
|
||||
|
||||
//define the process id file
|
||||
$pid_file = "/var/run/fusionpbx/fax_send".".".$fax_queue_uuid.".pid";
|
||||
//echo "pid_file: ".$pid_file."\n";
|
||||
@@ -637,14 +652,14 @@
|
||||
//}
|
||||
}
|
||||
|
||||
//wait for a few seconds
|
||||
sleep(1);
|
||||
|
||||
//remove the old pid file
|
||||
if (file_exists($pid_file)) {
|
||||
unlink($pid_file);
|
||||
}
|
||||
|
||||
//wait for a few seconds
|
||||
//sleep(1);
|
||||
|
||||
//move the generated tif (and pdf) files to the sent directory
|
||||
//if (file_exists($dir_fax_temp.'/'.$fax_instance_id.".tif")) {
|
||||
// copy($dir_fax_temp.'/'.$fax_instance_id.".tif", $dir_fax_sent.'/'.$fax_instance_id.".tif");
|
||||
|
||||
Reference in New Issue
Block a user