2006-11-29 18:09:25 +01:00
|
|
|
|
<?PHP
|
|
|
|
|
|
|
|
|
|
include ("./inc/config.php");
|
|
|
|
|
include ("./inc/config_IAX.php");
|
|
|
|
|
include ("./inc/config_db.php");
|
|
|
|
|
include ("./inc/error_handler.php");
|
|
|
|
|
include ("./inc/funktion_modem.php");
|
|
|
|
|
include ("./inc/funktion_cron.php");
|
|
|
|
|
|
2006-12-29 21:33:54 +01:00
|
|
|
|
|
2006-11-29 18:09:25 +01:00
|
|
|
|
//ausfuerungs Ruetmuss (in s)
|
|
|
|
|
$StartTimeBeforEvent = (60/4)*60;
|
|
|
|
|
$AnrufDelay = -5;
|
2006-11-29 19:09:48 +01:00
|
|
|
|
$DebugDECT = FALSE;
|
2007-08-09 18:33:38 +02:00
|
|
|
|
#$DebugDECT = TRUE;
|
2006-11-29 18:09:25 +01:00
|
|
|
|
|
|
|
|
|
//Timeout erh<72>hen;
|
|
|
|
|
set_time_limit(50000);
|
|
|
|
|
|
|
|
|
|
//SQL zusammensetzen
|
|
|
|
|
$SQL = "SELECT Shifts.DateS, Shifts.RID, ShiftEntry.UID, ShiftEntry.TID ".
|
|
|
|
|
"FROM `Shifts` INNER JOIN `ShiftEntry` ON `Shifts`.`SID` = `ShiftEntry`.`SID` ";
|
|
|
|
|
if( $DebugDECT)
|
2007-08-09 18:33:38 +02:00
|
|
|
|
$SQL .= "WHERE (Shifts.DateS>'2007-07-09 09:45:00' AND ".
|
|
|
|
|
"Shifts.DateS<='2007-07-09 11:00:00');";
|
2006-11-29 18:09:25 +01:00
|
|
|
|
else
|
2007-12-28 13:38:18 +01:00
|
|
|
|
$SQL .= "WHERE ((`Shifts`.`DateS`>'". gmdate("Y-m-d H:i:s", time()+120+$gmdateOffset). "') AND ".
|
|
|
|
|
"(`Shifts`.`DateS`<='". gmdate("Y-m-d H:i:s", time()+120+$gmdateOffset+$StartTimeBeforEvent). "') );";
|
2006-11-29 18:09:25 +01:00
|
|
|
|
|
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
echo mysql_error($con);
|
|
|
|
|
|
2006-12-29 21:33:54 +01:00
|
|
|
|
$Z=0;
|
2006-11-29 18:09:25 +01:00
|
|
|
|
for( $i=0; $i<mysql_num_rows($Erg); $i++)
|
|
|
|
|
{
|
|
|
|
|
if( mysql_result($Erg, $i, "UID")>0)
|
|
|
|
|
{
|
|
|
|
|
$DECTnumber = UID2DECT(mysql_result($Erg, $i, "UID"));
|
|
|
|
|
if( $DECTnumber!="")
|
|
|
|
|
{
|
2006-12-29 21:33:54 +01:00
|
|
|
|
echo "dial $DECTnumber\n";
|
2006-11-29 18:09:25 +01:00
|
|
|
|
DialNumberIAX( $DECTnumber,
|
|
|
|
|
mysql_result($Erg, $i, "DateS"),
|
|
|
|
|
mysql_result($Erg, $i, "RID"),
|
|
|
|
|
mysql_result($Erg, $i, "TID"));
|
|
|
|
|
DialNumberModem( $DECTnumber,
|
|
|
|
|
mysql_result($Erg, $i, "DateS"));
|
2006-12-29 21:33:54 +01:00
|
|
|
|
if( $Z++>10)
|
|
|
|
|
{
|
|
|
|
|
$Z=0;
|
|
|
|
|
sleep(30);
|
|
|
|
|
}
|
2006-11-29 18:09:25 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|