Make sure the database connection is available

This commit is contained in:
FusionPBX 2025-03-26 11:30:34 -06:00 committed by GitHub
parent 2ae77071e2
commit 67da2f2a3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 13 deletions

View File

@ -110,20 +110,22 @@
file_put_contents($pid_file, getmypid());
}
//import the call detail records from HTTP POST or file system
$cdr = new xml_cdr;
//get the cdr record
$xml_cdr_dir = $settings->get('switch', 'log').'/xml_cdr';
//loop through
//service loop
while (true) {
//import the call detail records from HTTP POST or file system
if (!$cdr) {
$cdr = new xml_cdr;
//make sure the database connection is available
while (!$database->is_connected()) {
//connect to the database
$database->connect();
//sleep for a moment
usleep(100000);
}
//find and process cdr records