From 1006eee4444c7aef38e58c6eb73a3efe0ae2e7ec Mon Sep 17 00:00:00 2001 From: Angelo Cuccato Date: Sun, 27 Dec 2009 23:27:32 +0100 Subject: [PATCH] add some asterisk config settings, add room selection --- default-conf/var_www_includes/config_IAX.php | 5 +- includes/funktion_cron.php | 9 ++-- www-ssl/nonpublic/schichtplan.php | 54 ++++++++++++++++++-- 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/default-conf/var_www_includes/config_IAX.php b/default-conf/var_www_includes/config_IAX.php index f5bdeaeb..db08c8b4 100644 --- a/default-conf/var_www_includes/config_IAX.php +++ b/default-conf/var_www_includes/config_IAX.php @@ -4,6 +4,9 @@ $IAXenable = TRUE; //Setting Asterisk $IAXcontent="Engelsystem"; -$IAXserver="Engelsystem:engelengel@10.1.1.1"; +$IAXserver="voip.eventphone.de"; + +//Asterisk output dir +$AsteriskOutputDir="/var/spool/asterisk/outgoing"; ?> diff --git a/includes/funktion_cron.php b/includes/funktion_cron.php index 7f47e346..17ac5a76 100755 --- a/includes/funktion_cron.php +++ b/includes/funktion_cron.php @@ -35,7 +35,7 @@ function TID2Engeltype($TID) function DialNumberIAX( $DECTnumber, $Time, $RID, $TID) { - global $IAXenable, $IAXcontent, $IAXserver, $AnrufDelay, $DebugDECT; + global $IAXenable, $IAXcontent, $IAXserver, $AnrufDelay, $DebugDECT, $Tempdir, $AsteriskOutputDir; //Parameter verarbeiten $TimeH = substr( $Time, 11, 2); @@ -84,7 +84,7 @@ function DialNumberIAX( $DECTnumber, $Time, $RID, $TID) else { // IAX file Schareiebn - $CallFile = "/tmp/call_". date("Ymd_His"). "_$DECTnumber"; + $CallFile = $Tempdir. "/call_". date("Ymd_His"). "_$DECTnumber"; if($DebugDECT) echo "IAX create file for dialing Number $DECTnumber\n"; $file = fopen( $CallFile, 'w' ); @@ -104,8 +104,9 @@ function DialNumberIAX( $DECTnumber, $Time, $RID, $TID) // fputs( $file, "SetVar: Room=". RID2Room( $RID). "\n"); // fputs( $file, "SetVar: Engeltype=". TID2Engeltype( $TID). "\n"); fclose($file); - system( "chmod 777 $CallFile"); - system( "mv $CallFile /var/spool/asterisk/outgoing"); + system( "chmod 777 ". $CallFile); + system( "mv ". $CallFile. " ". $AsteriskOutputDir); + } else echo "error: $CallFile not created"; diff --git a/www-ssl/nonpublic/schichtplan.php b/www-ssl/nonpublic/schichtplan.php index 95e49c59..f4a08308 100755 --- a/www-ssl/nonpublic/schichtplan.php +++ b/www-ssl/nonpublic/schichtplan.php @@ -6,7 +6,20 @@ $submenus = 2; if( isset($_GET["ausdatum"])) $ausdatum = $_GET["ausdatum"]; if( isset($_GET["raum"])) +{ $raum = $_GET["raum"]; + if( $raum==-1 && isset($_GET["show"])) + { + $raum = ""; + foreach ($_GET as $k => $v) + { + if( substr($k, 0, 5) == "raum_") + { + $raum = $raum. ";". $v; + } + } + } +} include ("../../includes/header.php"); include ("../../includes/funktionen.php"); @@ -64,10 +77,21 @@ if ( !isset($raum) ) { // Ausgabe wenn kein Raum Ausgewählt: echo Get_Text("pub_schicht_auswahl_raeume"). "

\n"; - if( isset($Room)) + + if( isset($Room)) + { + echo "
\n"; foreach( $Room as $RoomEntry ) - echo "\t
  • ". - $RoomEntry["Name"]. "
  • \n"; + { + echo "\t
  • "; + echo "". $RoomEntry["Name"]. ""; + echo "
  • \n"; + } + echo ""; + echo ""; + echo "\n"; + echo "
    \n"; + } echo "

    "; echo Get_Text("pub_schicht_alles_1"). " ". @@ -84,6 +108,8 @@ else { // Wenn einraum Ausgewählt ist: if( $raum == -1 ) echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":

    "; + elseif( substr( $raum, 0, 1) == ";" ) + echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":

    "; else echo Get_Text("pub_schicht_Anzeige_1"). $ausdatum. Get_Text("pub_schicht_Anzeige_2"). $RoomID[$raum]. "

    "; @@ -102,6 +128,15 @@ else if (SummRoomShifts($RoomEntry["RID"]) > 0) echo "\t\t". $RoomEntry["Name"]. "\n"; } + elseif( substr( $raum, 0, 1) == ";" ) + { + $words = preg_split("/;/", $raum); + foreach ($words as $word) + { + if( strlen(trim($word)) > 0) + echo "\t\t". $RoomID[trim($word)]. "\n"; + } + } else echo "\t\t". $RoomID[$raum]. "\n"; echo "\t\n"; @@ -136,6 +171,19 @@ else if (SummRoomShifts($RoomEntry["RID"]) > 0) CreateRoomShifts( $RoomEntry["RID"] ); } + elseif( substr( $raum, 0, 1) == ";" ) + { + if( isset($Room)) + { + $words = preg_split("/;/", $raum); + foreach ($words as $word) + { + if( strlen(trim($word)) > 0) + if (SummRoomShifts($word) > 0) + CreateRoomShifts( $word ); + } + } + } else CreateRoomShifts( $raum );