My blog related to my Amateur Radio projects. Member of a local club, WA6YBN.

Wednesday, September 1, 2010

ARRL News on Allstar Node

After some review, and testing. I have updated my previous script to download the Amateur Radio Newsline when the ARRL Audio news is unavailable. I also made the script choose which announcement to play, based on which news was downloaded.

If you plan on playing MP3 files, you will need the Asterisk Addon:Do the following:wget -ndhttp://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-addons-1.4.13.tar.gztar xvzf asterisk-addons-1.4.13.tar.gzcd asterisk-addons-1.4.13./configuremakemake installrestart asterisk an you can start using mp3 format. However format_mp3 can cause Asterisk to crash on certain mp3 files (notably 8k files made with lame) due to bugs in mpglib. If you must use this module, use it only with mp3's you know will work with it. This needs to be done every time asterisk is compiled and reinstalled.

My scripts are available to Amateur Radio Operator to use. I only ask that you make a comment here and let me know where it is deployed.

To use this script, you will need to create a "news" directory first by entering "mkdir /var/lib/asterisk/sounds/rpt/news".

You will also need to create 2 audio files for this. These are your precursor announcements, and I include the command to stop automated playback in the announcement, just in case there is emergency or priority traffic.

Here is an example script that I read, and recorded into a ulaw format for the node per support instructions, (http://ohnosec.org/drupal/node/142):
------------------
QST QST QST

Please stand by for a re-transmission of last weeks ARRL Audio News.

When available, the ARRL Audio News is re-transmitted on this WA6YBN Repeater every Monday night at 7 PM Local Time. If the ARRL Audio News is unavailable, the Amateur Radio Newsline will be aired in its place.

If you have Emergency or Priority traffic during an automated playback, use *999 to cancel it.

For more information, e-mail WA6YBN@GMAIL.COM or visit us at qsl.net/wa6ybn

The Re-Transmission of the ARRL Audio News will begin momentarily.
------------------

Next, create the script file, watch out for word wrap if you copy and paste from this site. I will post the script file somewhere and post a link here for download.

After pasting this, you need to save it by hitting the "Esc" key, then typing ":wq". Next we need to make sure the script has permission to run, by entering "sudo chmod o+x /etc/asterisk/news"

I created this script because I needed to download the MP3, but I convert the file because I couldn't get the MP3Player to work in Asterisk. I had everything installed, but couldn't get the syntax to actually play the file. But I was already playing wav files.

*****You will need to install the Add-on for Asterisk using these commands:*****

Now your reasy to test, to run the script manually for testing purposes, enter "/etc/asterisk/news"

To automate this script, I used crontab. I typed "crontab -e" and pasted in the following:
0 7 * * 5 /etc/asterisk/news > /etc/asterisk/news.log
This will run my script on Friday Mornings, so the news will be ready to go for Monday nights.

To make this fully automated, we modify the rpt.conf to add something like this: