H
ht81
Guest
Also neustes Freetz (Trunk) mit Callmonitor läuft alles wie geschmiert mit der Rufnummer anzeige. Ich aktualisiere gleich meine Signatur
... aber wenn jemand auf band spricht, dann wird dieser anruf genau 2mal in den missed_calls angezeigt.
Also neustes Freetz (Trunk) mit Callmonitor läuft alles wie geschmiert mit der Rufnummer anzeige. Ich aktualisiere gleich meine Signatur
#!/bin/sh
localpath="/var/media/ftp/uStor01/infoframe"
localpath2="/var/tmp/infoframe"
serverscript="http://192.168.0.5"
LOG="/var/media/ftp/uStor01/infoframe/logs/infoframe.log"
ANRUFBEANTWORTER="/var/media/ftp/uStor01/FRITZ/voicebox/rec"
samsung_ip_address="192.168.0.11"
samsung_rss_id="143560439"
if [ -z $L ]; then
wget "$serverscript?$L" -O $localpath/info.jpg
echo "hier sollte der innhalt von \$1 stehen. Da kein anruf ,also leer. Normaler cron refresh" $1 > $LOG
else
L=$L'&answermachine='
cd $ANRUFBEANTWORTER
if [ `echo $L | grep -c "in:disconnect"` -ge 1 ]; then
if [ `find . -type f -mmin -1` ]; then
L=$L'1'
echo "EVENT in:disconnect und file JUENGER als 1min, also AB BESPROCHEN!!" $L > $LOG
else
echo "EVENT in:disconnect, ABER file AELTER als 1min!!" $L > $LOG
fi
else
echo "KEIN event in:disconnect!!" $L > $LOG
fi
wget "$serverscript?$L" -O $localpath/info.jpg
export $L
echo "nach wget" $L >> $LOG
fi
wget "$serverscript?$L" -O $localpath2/info.jpg
# Samsung SPF-83v specific tasks
# ===============================
# disable and enable picture cache for this rss feed to make immediately refresh possible
wget -s "http://$samsung_ip_address:5050/configuration/storage.htm?CheckRssNameId=$samsung_rss_id&Checked=false"
wget -s "http://$samsung_ip_address:5050/configuration/storage.htm?CheckRssNameId=$samsung_rss_id&Checked=true"
# force samsung picture frame to immediately refresh picture by simulate clicking on "next" in web interface
wget -s "http://$samsung_ip_address:5050/configuration/photo_frame.htm?next"
// destroy the reference pointer to the image in memory to free up resources
ImageDestroy($im);
//********************************************** background switch****************************************
$akt_date = time();
$last_querry = "SELECT * FROM if_background WHERE id=1";
$fetch = mysql_query($last_querry) or die ("nicht moeglich");
$wallpaper_url = 'https://api.desktoppr.co/1/wallpapers/random';
$row = mysql_fetch_assoc($fetch);
$last_update = strtotime($row['last_update']);
if ($akt_date >= $last_update+3600){
// get random picture from url
if ($wallpaper_url) {
$text = file_get_contents($wallpaper_url);
}else {
exit('Webseite nicht erreichbar');
}
$pattern = '#("image":\{"url":")(http://.*?.[jpg,png])(")#';
$muster = array('#^"image":\{"url":"#', '#"$#');
$replace = '';
if (preg_match_all($pattern, $text, $treffer, PREG_SET_ORDER)) {
foreach($treffer as $link){
$url = $link[2];
if (preg_match('#^.*?.png$#', $url)) exit();
}
}else{
exit('regex nicht anwendbar');
}
//download Img from url
$img = 'resources/background.jpg';
file_put_contents($img, file_get_contents($url));
// resize Image with ImageMagick
$background_image = new Imagick($img);
$imageprops = $background_image->getImageGeometry();
if ($imageprops['width'] <= 800 && $imageprops['height'] <= 600) {
// don't upscale
} else {
$background_image->scaleImage(800, 600, true);
$background_image->writeImage($img);
$background_image->clear();
$background_image->destroy();
}
mysql_query("REPLACE INTO if_background SET id=1, last_update = FROM_UNIXTIME('$akt_date')") or die ("Replace funzt noch nicht");
}
//*******************************************************************************************************************************
// Execute shell comand
// close database connection
DbConnection::disconnect();
// table "if_background"
if(mysql_num_rows( mysql_query("SHOW TABLES LIKE 'if_background'", self::$connection) ) != 1) {
$query = "CREATE TABLE `if_background` (
`id` int(11) NOT NULL auto_increment,
`last_update` timestamp DEFAULT current_timestamp,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs; ";
mysql_query($query, self::$connection) or die('Error, insert query failed: '.mysql_error());
}
// extension to display how many calls are on fritzbox internal awnsermachine
// big thanks to Spoon3er
require('plugins/ABplugin.php');
if ($result>0) {
$ab = ImageCreateFromPNG ( 'resources/icons/AB.png' );
ImageCopy($image, $ab, 285, $yoffset-98, 0, 0, imagesx($ab), imagesy($ab));
ImageDestroy($ab);
imagettftextboxopt($image, 28, 0, -5, $yoffset-93, $style['textcolor'], $style['fontb'], $result, $opt);
}
//----------------------------------------------------------------------------