Asterisk

Asterisk in the Trixbox incarnation is being used at home to run a number of phones. It is also linked to the Home Automation system using xAP and the connector created by Gregg Liming.


Weather

The first piece of code added to the system is the ability to retrieve the BBC weather information, using the RSS feed, instead of the US airport ones. The php script currently gets the UK forecasts but could easily be changed to get World ones.

No originality is claimed for it and it is the original nv-weather.php hacked together with some code created for the Nazbag.

Originals at Nerd Vittles and Nazbag.

Since the BBC weather codes are 4 digits you will need to modify the extensions_trixbox.conf using nano or your favourite editor and restart Asterisk - amportal restart

exten => 611,1,Answer
exten => 611,2,Wait(1)
exten => 611,3,DigitTimeout(7)
exten => 611,4,ResponseTimeout(10)
exten => 611,5,Flite("At the beep enter the four character BBC region code for the weather report you wish to retrieve")
exten => 611,6,Read(APCODE,beep,4)
exten => 611,7,Flite("Please hold a moment while we contact the BBC for your report.")
exten => 611,8,AGI(uk-weather.php|${APCODE})
exten => 611,9,Hangup

The code can be downloaded here.

Or follow these instructions on your * box. 


cd /var/lib/asterisk/agi-bin
wget http://www.mm-wave.com/asterisk/uk-weather.zip
unzip uk-weather.zip
rm -f uk-weather.zip
chmod 775 uk-weather.php
chown asterisk:asterisk uk-weather.php


Integration with Four and xAP Floorplan

The second piece of work is the integration with James Traynor's Four application. Four provides a human dialogue interface to xAP Floorplan. Visit James's website for more on these.

Gregg Liming (see above) had created an xAP interface for Asterisk and created an IVR script that asks Four questions and the uses a Text To Speech(TTS) engine to respond. Gregg uses the latest Asterisk and a newer scripting engine. It was relatively easy to change this for the Trixbox and the details are on the xAP Website.

This will be extended to allow dial in control of heating, etc.

Home