I wanted to have the feature available to get the weather by zip code, so I tried to install the Weather by zip code module. There is a deplorable lack of documentation on the steps needed to install this. As usual, this article documents my experiences with Elastix, but since Elastix uses FreePBX this should be applicable to most systems.
There are three main steps involved in getting this to work. They are:
- Install Flite
- Install Asterisk-Flite
- Install Weather by ZIP
The following files are needed:
Step 1: Download, compile and install Flite. Log on to the system, and issue the following commands (cut ‘n paste will probably work):
cd /usr/src wget http://cmuflite.org/packed/flite-1.4/flite-1.4-release.tar.gz tar xzf flite-1.4-release.tar.gz cd flite-1.4-release ./configure --enable-shared make make install
If you are on a 64 bit system, then you may need to do the following step:
mv /usr/local/lib/flite* /usr/local/lib64
You now need to update the dynamic linker. Depending on your system, you will need to do one of the following. Replace the “lib64″ with “lib” if you are on a 32 bit system:
Edit the file /etc/ld.so.conf, and add the following line:
Create a file /etc/ld.so.conf.d/local-lib.conf, and have the following line in it:
then issue the command:
Step 2: Download, compile and install Asterisk-Flite
cd /usr/src wget http://cloud.github.com/downloads/zaf/Asterisk-Flite/Asterisk-Flite-1.6-0.1-beta2.tar.gz cd Asterisk-Flite make make install
if you are on a 64 bit system, then you may need to do the following step:
mv /usr/lib/asterisk/modules/app_flite.so /usr/lib64/asterisk/modules
Step 3: Install the weatherzip module in FreePBX
Step 3.1: Download the module to your desktop From here..
Don’t decompress the archive!
Step 3.2: Use a web browser to access FreePBX on your PBX. Choose Tools, Module Admin, Upload Module.
Step 3.3: Now, browse to the weatherzip-1.1.7.tgz file on your Desktop and click the Upload button. Now click local module administration, scroll down and click on Sys Info and then the Install radio button. Now click Process, and complete the usual FreePBX install and reload process.
Step 3.4: I had one problem with the Weather by Zip module. The PHP file references a function xml2array, which isn’t present. Since it is used only to display the module info, it is safe to comment it out. Open up the file:
and add to forward slashes to the beginning of line 23
Step 3.5: Finally, go into the FreePBX admin page for the Weather by Zip module, and make sure that the flite engine is selected.
Finally, restart Asterisk:
You should be able to test by dialing: *947 from any phone and following the prompts.