Hi,
My another script, less useful but quite cool 8)
- Set up one of the buttons to service mode in SEPXXXXXXXXXXXX.cnf.xml so it will look like this
<sipLines>
<line button="1">
...
</line>
<line button="2">
<featureID>20</featureID>
<featureLabel>BBC Weather</featureLabel>
<serviceURI>http://192.168.0.1/services/weather.xml</serviceURI>
</line>
</sipLines>
[size=85]192.168.0.1 is the IP of the asterisk server
When we press button 2 it will load weather.xml file which we need to prepare[/size]
- The update_weather.sh script generates that file in a format proper to Cisco 7961
[code]#! /bin/sh
wget -q -N http://newsrss.bbc.co.uk/weather/forecast/2574/Next3DaysRSS.xml
echo "
BBC - Forecast for London City" > /var/www/html/services/weather.xml cat Next3DaysRSS.xml | grep lastBuildDate >> /var/www/html/services/weather.xml sed -i 's/lastBuildDate/Prompt/g' /var/www/html/services/weather.xml sed -n '//,/<\/item>/p' Next3DaysRSS.xml >> /var/www/html/services/weather.xml sed -i '/<link/d' /var/www/html/services/weather.xml sed -i '/<guid/d' /var/www/html/services/weather.xml sed -i '/<geo/d' /var/www/html/services/weather.xml sed -i '/<pub/d' /var/www/html/services/weather.xml sed -i '/<desc/d' /var/www/html/services/weather.xml sed -i 's/title/Name/g' /var/www/html/services/weather.xml sed -i 's/item/MenuItem/g' /var/www/html/services/weather.xml sed -i 's/°//g' /var/www/html/services/weather.xml sed -i 's/Temp/T/g' /var/www/html/services/weather.xml echo "" >> /var/www/html/services/weather.xml [/code] [size=85] Please note: - [b]wget[/b] is required on the server to download RSS from BBC website - to change the city you need to find a 4-didgit code, i.e Chicago is 0107: [newsrss.bbc.co.uk/weather/foreca ... aysRSS.xml](http://newsrss.bbc.co.uk/weather/forecast/0107/Next3DaysRSS.xml) - there is a list here [dracos.co.uk/play/bbc-weather/countries.opml](http://www.dracos.co.uk/play/bbc-weather/countries.opml) [/size]3. weather.xml should be placed in the location accessible for the handset via html (in my case apache is running on the asterisk server and the /var/www/html/services/ is accessible from outside)
- Run the script update_weather.sh every morning at 8am (crontab -e)
### Update weather on CISCO 7961
0 8 * * * /var/www/html/services/update_weather.sh
When you press the weather button, after short while you get this on the handset:
That’s it.