Make sure the database connection is available
This commit is contained in:
parent
2ae77071e2
commit
67da2f2a3d
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue