(Originally posted July 25, 2005)
I got my hands on a copy of Developing Cisco IP Phone Services by Cisco Press some time ago. There’s a lot of functionality available in the Cisco 7960/7940 IP phones (and some limited functionality in the 7905s). (Note: Now we’re using 7961/7941/7906.) Just scratching the surface so far, I’ve written a simple weather reporting app in Perl that provides pages for the Idle URL.
phonewx.txt – (rename to phonewx.pl or extension of your choice for running) Generates formatted output of current conditions for your area. Modify the variables at the top of the script to reference your city’s ICAO identifier (go to www.uswx.com and get the weather for your city — you’ll see the ICAO identifier listed on the page — begins with a K in the United States), name, and the URL that the Frcst button will point to.
phonefc.txt – (rename to phonefc.pl) Generates formatted output of a 7-day forecast. It calls Lynx to grab a text dump of a web site providing the forecast. You can rewrite this to use Perl modules, but I found the Lynx solution to be easiest.
update.sh – sample – Set up a shell script that runs on a 15-minute crontab to call these Perl scripts and place the output of each in your phone-accessible web directory. The information will then be current as phones request it.
Note that this setup uses Perl only to generate the static XML files — phones are not requesting CGI pages. The examples provided by Developing IP Phone Services all assume Windows/IIS/ASP where phones will request dynamically generated pages. In this case, dynamic generation is not necessary, and is in fact far more costly than having a cron job just put out updated XML files every so often.
Once the script is in place and the files are being generated, point your Idle URL to the phonewx output with an idle timer of 60 seconds or whatever is your preference. The output contains a Refresh header that causes the phone to re-fetch the current conditions every 15 minutes, so a phone that sits idle for a long period of time will still have current conditions displayed throughout the day.