random1.jpg

Login Form






Passwort verloren?

Meteohub

Lentföhrden
Germany

Vorhersage
Icons by Roman Attinger

Temperatur: 9.3°C
Luftdruck: 999.2hPa
Wind: km/h
Richtung:
Gefühlte Temp.: °C

powered by Meteohub

Squeezebox Drucken E-Mail
Geschrieben von Administrator   
14.03.2006

ImageThe Squeezebox is Slim Devices latest development based on the initial SliMP3. It has better DACs, digital out, a graphical display of superior quality and supports 802.11g wireless networks as well as 100 mbit ethernet. I use the Squeezebox as a replacement for the Audiotron in my living room. The server software that comes along with the unit runs great on linux, wich makes it an ideal fit to my media network infrastructure.

1. Expansions


Apart from streaming music the Squeezebox can make use of the plugins I wrote for the SliMP3 in the kitchen. Have a look here to learn more about my individual plugins.

Beside the plugins, which mainly enables the squeezebox to pull information on the user's demand onto it's display, there is another thing you can do with this babies. You can use them as displays to inform about sudden events. The events I choose to test how usefull such an imformation push device might be are... phone calls.

The story is as follows.

  • The linux server (SuSE 8.2) where the slimserver software runs on is connected to the ISDN bus of my telephone network. Settings in /etc/isdn/callerid.conf tell the server to start a script /usr/local/bin/caller-ident each time a phone call goes to one of my public MSNs. Here are the corresponding lines in the configuration file:     
[MSN]Image
NUMBER = 819355,819356,819357 <- insert your MSNs here
ALIAS = caller-ident
ZONE = 1
START={
[FLAG]
PROGRAM=/usr/local/bin/caller-ident $2
FLAGS=I|R|U
INTERVAL=600
USER=root
}
  • The script /usr/local/bin/caller-ident, which is called with the number of the caller as a paramter, passes the caller id to the script /usr/local/bin/caller to find a name for this phone number. If there is a name, this name is displayed to the squeezebox, otherwise just the phone number of the caller will be displayed. Actually, the scripts just work with German phone numbers. This is the content of the script /usr/local/bin/caller-ident:
#! /bin/sh
#
# define the following variables according to your setup
playerip=
slimuser=
slimpassword=
host=
number=`echo $1 | replace -s "+49" "0"`
ident=`/usr/local/bin/caller $number`
if [ "$ident" = "" ]; then
name=`echo $1 | replace-symbols`
number=""
else
name=`echo $ident | /usr/local/bin/replace-symbols`
number=`echo $1 | replace-symbols`
fi
wget -O /dev/null -T 300 "http://$slimuser:$slimpassword@$host:9000/status.txt?p0=display&p1=$number
        &p2=$name&p3=30&player=$playerip" 2>/dev/null
  • The script /usr/local/bin/caller converts a phone number into the name of the owner of the phone number. This is done by a telephone number reverse lookup through the internet. The web page "www.dasoertliche.de" is doing the lookup. The script just fires a wget with the number to the website and collects the name from the returning html code. Some gawk commands do that for me. Here is the script /usr/local/bin/caller:
#! /bin/sh
#      url1="http://www.dasoertliche.de/DB4Web/es/oetb2suche/home.htm?kw_invers="      url2="&main=Antwort&AKTION=START_INVERS_SUCHE&SEITE=INVERSSUCHE_V
         &Suchen.x=31&Suchen.y=5&s=2&rg=1&taoid=&SKN=0
         &SEITE=INVERSSUCHE_V&AKTION=START_SUCHE"      url=$url1$1$url2
#
wget -O /dev/stdout -T 300 $url 2>/dev/null | grep Detailansicht |
         gawk 'BEGIN {FS=">"}; {printf "%s\n", $3}' | gawk 'BEGIN {FS="<"};
         {printf "%s\n", $1}' | gawk 'BEGIN {FS=" "};
         {printf "%s, %s %s %s %s %s %s %s\n", $1, $2, $3, $4, $5, $6, $7, $8}'

 

  • The script /usr/local/bin/caller-ident makes use of /usr/local/bin/replace-symbols, which simply converts strings with special characters to strings that go well when posted in an url statement. /usr/local/bin/replace-symbols looks like this:
#! /bin/sh
#
replace -s "+" "%2B" "°" "%B0" "\\" "%5C" "<" "%3C" ">" "%3E" "\"" "%22"
                 "?" "%3F" " " "%20" "ä" "%E4" "Ä" "%C4" "ö" "%F6" "Ö" "%D6"
                 "ü" "%FC" "Ü" "%DC" "ß" "%DF"

2. Squeezebox Tells Me Who Is Calling

Having the above mentioned scripts up an running allows me to see on the display of the Squeezebox who is calling. According to the selected display size it looks like this, if I do call myself:

Image

Image

Image 

3. Download

The files can be downloaded right here:


Letzte Aktualisierung ( 14.03.2006 )
 
< Zurück   Weiter >
© 2008 Pasternak Homepage
Joomla! is Free Software released under the GNU/GPL License.