Exit fax_send immediately if no fax_queue_uuid is found (#7479)
* Exit fax_send immediately if no fax_queue_uuid is found * Add removing the PID file in to the registered shutdown function
This commit is contained in:
@@ -75,6 +75,12 @@
|
|||||||
$parameters['fax_queue_uuid'] = $fax_queue_uuid;
|
$parameters['fax_queue_uuid'] = $fax_queue_uuid;
|
||||||
$database->execute($sql, $parameters);
|
$database->execute($sql, $parameters);
|
||||||
unset($sql);
|
unset($sql);
|
||||||
|
|
||||||
|
//remove the old pid file
|
||||||
|
global $pid_file;
|
||||||
|
if (file_exists($pid_file)) {
|
||||||
|
unlink($pid_file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
register_shutdown_function('shutdown');
|
register_shutdown_function('shutdown');
|
||||||
|
|
||||||
@@ -159,7 +165,7 @@
|
|||||||
$sql .= "and q.domain_uuid = d.domain_uuid and f.fax_uuid = q.fax_uuid";
|
$sql .= "and q.domain_uuid = d.domain_uuid and f.fax_uuid = q.fax_uuid";
|
||||||
$parameters['fax_queue_uuid'] = $fax_queue_uuid;
|
$parameters['fax_queue_uuid'] = $fax_queue_uuid;
|
||||||
$row = $database->select($sql, $parameters, 'row');
|
$row = $database->select($sql, $parameters, 'row');
|
||||||
if (is_array($row)) {
|
if (!empty($row)) {
|
||||||
$fax_queue_uuid = $row['fax_queue_uuid'];
|
$fax_queue_uuid = $row['fax_queue_uuid'];
|
||||||
$domain_uuid = $row['domain_uuid'];
|
$domain_uuid = $row['domain_uuid'];
|
||||||
$domain_name = $row['domain_name'];
|
$domain_name = $row['domain_name'];
|
||||||
@@ -180,6 +186,12 @@
|
|||||||
$fax_accountcode = $row["fax_accountcode"];
|
$fax_accountcode = $row["fax_accountcode"];
|
||||||
$fax_command = $row["fax_command"];
|
$fax_command = $row["fax_command"];
|
||||||
$fax_toll_allow = $row["fax_toll_allow"];
|
$fax_toll_allow = $row["fax_toll_allow"];
|
||||||
|
} else {
|
||||||
|
// Notify user using the system logs
|
||||||
|
syslog(E_WARNING, "Fax Send: UUID {$fax_queue_uuid} not found in fax queue");
|
||||||
|
|
||||||
|
// Exit with non-zero exit code to indicate an error in the program execution
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
unset($parameters);
|
unset($parameters);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user