Weather report for idle screen on Cisco IP phones

(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.

Download the scripts from repos/phonewx.

Current Conditions screenshotphonewx.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.

Forecast screenshotphonefc.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.

3 thoughts on “Weather report for idle screen on Cisco IP phones”

  1. Not in any way that I am aware of. That line is not customizable with XML IP phone services. Not customizable at all, I don’t believe, except to change the extension in Call Manager. You could rework this idea to use the CiscoIPPhoneStatus info box, which is smaller and can be positioned where you want on the phone screen, instead of the services box, which fills the whole screen. See http://www.cisco.com/en/US/docs/voice_ip_comm/cuipph/all_models/xsi/5_1/english/programming/guide/ip5_1ch2.html#wp1033829

  2. Is it possible to display only the current temperature on the topmost line where we have Date/Time and Extension currently being displayed?

Comments are closed.