diff options
author | Moritz helios Rudert <helios@planetcyborg.de> | 2011-06-01 12:13:39 +0200 |
---|---|---|
committer | Moritz helios Rudert <helios@planetcyborg.de> | 2011-06-01 12:13:39 +0200 |
commit | 75448045cfe70054c8f4bae1bcfaf9bb0f70d330 (patch) | |
tree | 6a4d3d35019cdf933c1816e8522dc5d2557f5238 /services/cron_dect.php | |
parent | 12e0b0d809c29d435a247798d7318cc9835980ea (diff) |
fixes
Diffstat (limited to 'services/cron_dect.php')
-rwxr-xr-x | services/cron_dect.php | 106 |
1 files changed, 48 insertions, 58 deletions
diff --git a/services/cron_dect.php b/services/cron_dect.php index b5e338c6..57d12e0f 100755 --- a/services/cron_dect.php +++ b/services/cron_dect.php @@ -1,61 +1,51 @@ -<?PHP - -include ("../includes/config.php"); -include ("../includes/config_IAX.php"); -include ("../includes/config_db.php"); -include ("../includes/error_handler.php"); -include ("../includes/funktion_modem.php"); -include ("../includes/funktion_cron.php"); - - -//ausfuerungs Ruetmuss (in s) -$StartTimeBeforEvent = (60/4)*60; -$AnrufDelay = -5; -$DebugDECT = FALSE; -#$DebugDECT = TRUE; - -//Timeout erhö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) - $SQL .= "WHERE (Shifts.DateS>'2007-07-09 09:45:00' AND ". - "Shifts.DateS<='2007-07-09 11:00:00');"; -else - $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). "') );"; - -$Erg = mysql_query($SQL, $con); -echo mysql_error($con); - -$Z=0; -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!="") - { - echo "dial $DECTnumber\n"; - DialNumberIAX( $DECTnumber, - mysql_result($Erg, $i, "DateS"), - mysql_result($Erg, $i, "RID"), - mysql_result($Erg, $i, "TID")); - DialNumberModem( $DECTnumber, - mysql_result($Erg, $i, "DateS")); - if( $Z++>10) - { - $Z=0; - sleep(30); - } - } +<?php + include "../includes/config.php"; + include "../includes/config_IAX.php"; + include "../includes/config_db.php"; + include "../includes/error_handler.php"; + include "../includes/funktion_modem.php"; + include "../includes/funktion_cron.php"; + + // ausfuerungs Ruetmuss (in s) + $StartTimeBeforEvent = (60 / 4) * 60; + $AnrufDelay = -5; + $DebugDECT = false; + + // Timeout erhoehen + 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) + $SQL .= "WHERE (Shifts.DateS>'2007-07-09 09:45:00' AND ". + "Shifts.DateS<='2007-07-09 11:00:00');"; + else + $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). "') );"; + + $Erg = mysql_query($SQL, $con); + echo mysql_error($con); + + $Z = 0; + + 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 != "") { + echo "dial $DECTnumber\n"; + DialNumberIAX( $DECTnumber, mysql_result($Erg, $i, "DateS"), mysql_result($Erg, $i, "RID"), mysql_result($Erg, $i, "TID")); + DialNumberModem( $DECTnumber, mysql_result($Erg, $i, "DateS")); + + if($Z++ > 10) { + $Z = 0; + sleep(30); + } + } + } } -} - -return 0; - + return 0; ?> - |