Installing and using Playnews script from Hamvoip

This was what I did to install the playnews script on one of my nodes.

Change directory to         cd /etc/asterisk/local     (you may need to create directory is using a different disto)
make a new directory called  playnews     mkdir playnews
            cd /etc/asterisk/local/playnews
Download the script   wget  http://hamvoip.org/downloads/playnews-0.11.tar.gz
unzip it  /  untar it to  /etc/asterisk/local/playnews
tar -zxvf playnews-0.11.tar.gz
make it executable  chmod +x playnews-0.11   (or maybe chmod 750 file name)

next

add lines to cron  to play automatically
Edit cron by using crontab -e

# CRON EXAMPLE   #####################################################
# Prime news for play every Tuesday at 8:30PM - actual playtime set by defined
# comand line TIME parameter. If Playtime is 9PM (2100)
# This would send pre warnings at 8:50 and 8:55 PM.
#
# Start a cron job every Tuesday at 7:30 PM to run at 8 PM the same day
# and play ARRL news on node 41899, globally (G)
#
30 19 * * 2 /etc/asterisk/local/playnews/playnews-0.11  ARRL 20:00 41899 G &> /dev/null 2>&1
#
# Play ARN news on Thursday at 8PM on node 41899, Start playnews at 7 PM, Play locally (L)
#
00 19 * * 4 /etc/asterisk/local/playnews/playnews-0.11  ARN 20:00 41899 L &> /dev/null 2>&1
#################################################################

Save your changes then exit.

Confirm changes by typing    crontab -l
You can also assign a code in rpt.conf to play via touchtone.
Or execute from the command line.   You will need to press any key to continue if from the command line.

Example    (This was displayed on the screen)
From the command line play NEWSLINE immediately Globally

[[email protected] scripts]# /etc/asterisk/local/playnews/playnews-0.11 ARN now 41899                           
Starting Download of ARN Audio News @ 22:12:55
--2017-04-06 22:12:55--  https://www.arnewsline.org/s/news.mp3
Resolving www.arnewsline.org (www.arnewsline.org)... 198.49.23.144, 198.185.159.145,
198.49.23.145, ...
Connecting to www.arnewsline.org (www.arnewsline.org)|198.49.23.144|:443... connected.
HTTP request sent, awaiting response... 302
Cookie coming from www.arnewsline.org attempted to set domain to squarespace.com
Location:
https://static1.squarespace.com/static/58b08985be65947bf171e05e/t/58e6d1a83e00be61768e5f2f/149  
1521969045/news.mp3 [following]
--2017-04-06 22:12:57-- 
https://static1.squarespace.com/static/58b08985be65947bf171e05e/t/58e6d1a83e00b                             
e61768e5f2f/1491521969045/news.mp3
Resolving static1.squarespace.com (static1.squarespace.com)... 151.101.20.238
Connecting to static1.squarespace.com (static1.squarespace.com)|151.101.20.238|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4626169 (4.4M) [audio/mp3]
Saving to: '/tmp/news.mp3'
news.mp3                  100%[=====================================>]   4.41M  6.34MB/s 
in 0.7s
2017-04-06 22:13:02 (6.34 MB/s) - '/tmp/news.mp3' saved [4626169/4626169]
Download complete @ 22:13:02
Converting from MP3 to individual ulaw format files
Creating /tmp/news.part1.wav
Creating /tmp/news.part2.wav
Creating /tmp/news.part3.wav
Creating /tmp/news.part4.wav
Creating /tmp/news.part5.wav
Creating /tmp/news.part6.wav
Creating /tmp/news.part7.wav
Creating /tmp/news.part8.wav
Converting to /tmp/news.part1.ul
Converting to /tmp/news.part2.ul
Converting to /tmp/news.part3.ul
Converting to /tmp/news.part4.ul
Converting to /tmp/news.part5.ul
Converting to /tmp/news.part6.ul
Converting to /tmp/news.part7.ul
Converting to /tmp/news.part8.ul
ARN news will start now and use playback (global) mode on node - 41899
Press any key to start news...
Starting in 10 seconds - Hit Ctrl C to interrupt
10 9 8 7 6 5 4 3 2 1
Playing file /tmp/news.part1.ul
Playing file /tmp/news.part2.ul
Playing file /tmp/news.part3.ul
Playing file /tmp/news.part4.ul
Playing file /tmp/news.part5.ul
Playing file /tmp/news.part6.ul
Playing file /tmp/news.part7.ul
Playing file /tmp/news.part8.ul
[[email protected] scripts]#
###################################################################

To play via DTMF NOW
I added these lines to my rpt.conf file

975=cmd,/etc/asterisk/local/playnews/playnews-0.11  ARRL now 41899 G &> /dev/null 2>&1 ;ARRl Audio News *975
976=cmd,/etc/asterisk/local/playnews/playnews-0.11  ARN now 41899 G &> /dev/null 2>&1  ;Newsline *976

*Note* When using via dtmf, it will not play right away... The script needs to download the file and then convert
it to the proper format... So be patient...

The G in the command will play the file Globally
and changing it to L will play only locally on the node running the script.

Hopefully this helps you out.
The script seems to work fine as long as the ARRL names the file correctly.

Bob W2YMM

I installed a Newsline and ARRL Audio news script from the HAMVOIP page
It plays automatically weekly using cron

The script can be downloaded here  http://hamvoip.org/downloads/playnews-0.11.tar.gz

It has been working great for months and I wanted to pass along how I did the install on my node
for those who also wish to run it also.

ARRL Audio News website  http://www.arrl.org/arrl-audio-news

Amateur Radio Newsline  https://www.arnewsline.org/



I have a copy of the script on my site at
http://www.qsl.net/w/w2ymm//downloads/ALLSTAR/Scripts/news/

.pdf file I made of how I installed the scripts
https://goo.gl/68wKnn
My Allstar Page