From 30876a0a85897125854226112d8de7f19a707dad Mon Sep 17 00:00:00 2001 From: cookie Date: Wed, 29 Nov 2006 17:09:25 +0000 Subject: [PATCH] cron joby aufgereumt git-svn-id: svn://svn.cccv.de/engel-system@181 29ba0400-6e00-0410-a75a-ca02368028f8 --- default-conf/www-ssl/inc/config.php | 3 - default-conf/www-ssl/inc/config_IAX.php | 9 ++ default-conf/www-ssl/inc/config_modem.php | 11 ++ services/cron_dect_asterisk.php | 52 ++++++++++ services/dect_cron.php | 69 ------------- services/dect_cron_asterisk.php | 120 ---------------------- www-ssl/inc/config_modem.php | 11 ++ www-ssl/inc/funktion_cron.php | 100 ++++++++++++++++++ www-ssl/inc/funktion_modem.php | 16 +-- 9 files changed, 187 insertions(+), 204 deletions(-) create mode 100644 default-conf/www-ssl/inc/config_IAX.php create mode 100644 default-conf/www-ssl/inc/config_modem.php create mode 100755 services/cron_dect_asterisk.php delete mode 100755 services/dect_cron.php delete mode 100755 services/dect_cron_asterisk.php create mode 100644 www-ssl/inc/config_modem.php create mode 100755 www-ssl/inc/funktion_cron.php diff --git a/default-conf/www-ssl/inc/config.php b/default-conf/www-ssl/inc/config.php index ccf359c4..3e2c3b51 100755 --- a/default-conf/www-ssl/inc/config.php +++ b/default-conf/www-ssl/inc/config.php @@ -31,9 +31,6 @@ $show_SSLCERT = "MD5:
FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF
\n". //globale const. fuer schischtplan $GlobalZeileProStunde = 4; -//ist ein modem angeschlossen -$ModemEnable = false; - //Tempdir $Tempdir="/tmp"; diff --git a/default-conf/www-ssl/inc/config_IAX.php b/default-conf/www-ssl/inc/config_IAX.php new file mode 100644 index 00000000..f5bdeaeb --- /dev/null +++ b/default-conf/www-ssl/inc/config_IAX.php @@ -0,0 +1,9 @@ + diff --git a/default-conf/www-ssl/inc/config_modem.php b/default-conf/www-ssl/inc/config_modem.php new file mode 100644 index 00000000..0625936d --- /dev/null +++ b/default-conf/www-ssl/inc/config_modem.php @@ -0,0 +1,11 @@ + diff --git a/services/cron_dect_asterisk.php b/services/cron_dect_asterisk.php new file mode 100755 index 00000000..73e1f199 --- /dev/null +++ b/services/cron_dect_asterisk.php @@ -0,0 +1,52 @@ +'2004-12-27 10:45:00' AND ". + "Shifts.DateS<='2004-12-27 11:00:00');"; +else + $SQL .= "WHERE ((`Shifts`.`DateS`>'". gmdate("Y-m-d H:i:s", time()+3600+120). "') AND ". + "(`Shifts`.`DateS`<='". gmdate("Y-m-d H:i:s", time()+3600+120+$StartTimeBeforEvent). "') );"; + +$Erg = mysql_query($SQL, $con); +echo mysql_error($con); + +for( $i=0; $i0) + { + $DECTnumber = UID2DECT(mysql_result($Erg, $i, "UID")); + if( $DECTnumber!="") + { + DialNumberIAX( $DECTnumber, + mysql_result($Erg, $i, "DateS"), + mysql_result($Erg, $i, "RID"), + mysql_result($Erg, $i, "TID")); + DialNumberModem( $DECTnumber, + mysql_result($Erg, $i, "DateS")); + } + } +} + +return 0; + + +?> + diff --git a/services/dect_cron.php b/services/dect_cron.php deleted file mode 100755 index 00119567..00000000 --- a/services/dect_cron.php +++ /dev/null @@ -1,69 +0,0 @@ -'". gmdate("Y-m-d H:i:s", time()+3600+120). "') AND ". - "(`Shifts`.`DateS`<='". gmdate("Y-m-d H:i:s", time()+3600+120+$StartTimeBeforEvent). "') );"; -// "WHERE (Shifts.DateS>'2004-12-27 10:45:00' AND ". -// "Shifts.DateS<='2004-12-27 11:00:00');"; - -$Erg = mysql_query($SQL, $con); - -echo mysql_error($con); - -for( $i=0; $i0) - { - $SQL2 = "SELECT DECT FROM `User` WHERE ( `UID`='". mysql_result($Erg, $i, "UID"). "');"; - $Erg2 = mysql_query($SQL2, $con); - - $Number = mysql_result($Erg2, 0, "DECT"); - if( $Number!="") - { - $TimeH = substr( mysql_result($Erg, $i, "DateS"), 11, 2); - $TimeM = substr( mysql_result($Erg, $i, "DateS"), 14, 2); - $TimeM = substr( mysql_result($Erg, $i, "DateS"), 14, 2) - 5; - if( $TimeM < 0 ) - { - $TimeM += 60; - $TimeH -= 1; - } - if( $TimeH < 0 ) - $TimeH += 24; - - if( strlen( $TimeH) == 1) - $TimeH = "0".$TimeH; - - SetWackeup( $Number, $TimeH, $TimeM); - } - } -} - -return 0; - -?> - diff --git a/services/dect_cron_asterisk.php b/services/dect_cron_asterisk.php deleted file mode 100755 index 06ff2d50..00000000 --- a/services/dect_cron_asterisk.php +++ /dev/null @@ -1,120 +0,0 @@ -\n"; -} - -function UID2DECT($UID) -{ - global $con; - $SQL = "SELECT DECT FROM `User` WHERE UID='$UID'"; - $Erg = mysql_query($SQL, $con); - return mysql_result($Erg, 0); -} -function RID2Room($RID) -{ - global $con; - $SQL = "SELECT Name FROM `Room` WHERE RID='$RID'"; - $Erg = mysql_query($SQL, $con); - return mysql_result($Erg, 0); -} - -function TID2Engeltype($TID) -{ - global $con; - $SQL = "SELECT Name FROM `EngelType` WHERE TID='$TID'"; - $Erg = mysql_query($SQL, $con); - return mysql_result($Erg, 0); -} - - - -$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>'2004-12-27 10:45:00' AND ". - "Shifts.DateS<='2004-12-27 11:00:00');"; -else - $SQL .= "WHERE ((`Shifts`.`DateS`>'". gmdate("Y-m-d H:i:s", time()+3600+120). "') AND ". - "(`Shifts`.`DateS`<='". gmdate("Y-m-d H:i:s", time()+3600+120+$StartTimeBeforEvent). "') );"; - -$Erg = mysql_query($SQL, $con); - -echo mysql_error($con); - -for( $i=0; $i0) - { - $SQL2 = "SELECT DECT FROM `User` WHERE ( `UID`='". mysql_result($Erg, $i, "UID"). "');"; - $Erg2 = mysql_query($SQL2, $con); - - $Number = mysql_result($Erg2, 0, "DECT"); - if( $Number!="") - { - $TimeH = substr( mysql_result($Erg, $i, "DateS"), 11, 2); - $TimeM = substr( mysql_result($Erg, $i, "DateS"), 14, 2); - $TimeM = substr( mysql_result($Erg, $i, "DateS"), 14, 2) - 5; - if( $TimeM < 0 ) - { - $TimeM += 60; - $TimeH -= 1; - } - if( $TimeH < 0 ) - $TimeH += 24; - - if( strlen( $TimeH) == 1) - $TimeH = "0".$TimeH; - - $Room = RID2Room( mysql_result($Erg, $i, "RID")); - $EngelType = TID2Engeltype( mysql_result($Erg, $i, "TID")); - DialNumber( $Number, $TimeH, $TimeM, $Room, $EngelType); - } - } -} - -return 0; - - -?> - diff --git a/www-ssl/inc/config_modem.php b/www-ssl/inc/config_modem.php new file mode 100644 index 00000000..0625936d --- /dev/null +++ b/www-ssl/inc/config_modem.php @@ -0,0 +1,11 @@ + diff --git a/www-ssl/inc/funktion_cron.php b/www-ssl/inc/funktion_cron.php new file mode 100755 index 00000000..d2afa70b --- /dev/null +++ b/www-ssl/inc/funktion_cron.php @@ -0,0 +1,100 @@ + + diff --git a/www-ssl/inc/funktion_modem.php b/www-ssl/inc/funktion_modem.php index a8ae010d..6cbbb49b 100755 --- a/www-ssl/inc/funktion_modem.php +++ b/www-ssl/inc/funktion_modem.php @@ -1,20 +1,14 @@ $Number' was called
\n"; + $fp = fopen( $ModemDev, "w"); sleep(1); fwrite( $fp, "+++"); sleep(1); @@ -28,9 +22,7 @@ echo $Number; sleep(1); } else - { - echo "Modem is Disable, number: '$Number' was called
\n"; - } + echo "Modem is Disable, number: '$Number' was not called
\n"; }