From 577a5a3423d4298dd5fcd3e38934e79205ac2428 Mon Sep 17 00:00:00 2001 From: cookie Date: Sat, 12 May 2007 11:02:27 +0000 Subject: [PATCH] aenderungen vom 23c3 git-svn-id: svn://svn.cccv.de/engel-system@229 29ba0400-6e00-0410-a75a-ca02368028f8 --- www-ssl/admin/dect.php | 7 +++++-- www-ssl/inc/funktion_cron.php | 35 +++++++++++++++++++++++++++++++---- www-ssl/inc/header.php | 2 ++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/www-ssl/admin/dect.php b/www-ssl/admin/dect.php index 1092542d..166803c5 100755 --- a/www-ssl/admin/dect.php +++ b/www-ssl/admin/dect.php @@ -4,7 +4,9 @@ $title = "Engelsystem - DECT"; $header = "DECT send call"; include ("./inc/header.php"); -include ("./inc/funktion_modem.php"); +include ("./inc/config_IAX.php"); +//include ("./inc/funktion_modem.php"); +include ("./inc/funktion_cron.php"); if( !isset($_GET["dial"])) $_GET["dial"] = ""; if( !isset($_GET["custum"])) $_GET["custum"] = ""; @@ -22,7 +24,8 @@ if( $_GET["dial"]=="dial") if( strlen( $_GET["timem"])== 1) $_GET["timem"] = "0". $_GET["timem"]; - SetWackeup( $Number, $_GET["timeh"], $_GET["timem"]); +// SetWackeup( $Number, $_GET["timeh"], $_GET["timem"]); + DialNumberIAX($Number, $_GET["timeh"], $_GET["timem"],0); $_GET["custum"] = $Number; } diff --git a/www-ssl/inc/funktion_cron.php b/www-ssl/inc/funktion_cron.php index 09b627d2..4ff383dc 100755 --- a/www-ssl/inc/funktion_cron.php +++ b/www-ssl/inc/funktion_cron.php @@ -43,11 +43,38 @@ function DialNumberIAX( $DECTnumber, $Time, $RID, $TID) if( strlen( $TimeH) == 1) $TimeH = "0".$TimeH; - // IAX file Schareiebn - $CallFile = "/tmp/call_". date("Ymd_His"). "_$DECTnumber"; - if( $IAXenable) { + $post_data = array(); + $post_data['code'] = "89o8eu9cg4"; + $post_data['callerid'] = "1023"; + $post_data['nr'] = "$DECTnumber"; + //$post_data['message'] = "Deine schicht beginnt in ein paar minuten . . . your shift beginns in a few minutes "; + $post_data['message'] = "die-nee shisht beh-kinned , in where-neegin me-nooten . . . your shift beginns in a few minutes "; + $url = "https://23c3.eventphone.de/~bef/call.php"; + + $o=""; + foreach ($post_data as $k=>$v) + { + $o.= "$k=".urlencode(utf8_encode($v))."&"; + } + $post_data=substr($o,0,-1); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + $result = curl_exec($ch); + echo curl_error($ch); + curl_close($ch); + + + /* + // IAX file Schareiebn + $CallFile = "/tmp/call_". date("Ymd_His"). "_$DECTnumber"; + if($DebugDECT) echo "IAX create file for dialing Number $DECTnumber\n"; $file = fopen( $CallFile, 'w' ); if( $file != FALSE) @@ -66,7 +93,7 @@ function DialNumberIAX( $DECTnumber, $Time, $RID, $TID) fclose($file); system( "chmod 777 $CallFile"); system( "mv $CallFile /var/spool/asterisk/outgoing"); - } + }*/ } else if($DebugDECT) echo "IAX is disable\n"; diff --git a/www-ssl/inc/header.php b/www-ssl/inc/header.php index c6be4957..55459c3a 100755 --- a/www-ssl/inc/header.php +++ b/www-ssl/inc/header.php @@ -1,4 +1,6 @@