HAMVoIP AllStar Node – Scripts Available

This is my attempt to document the scripts that are available in the AllStream node software ( HAMVoIP version 1.7-01 ). There are a lot of useful scripts, some of them are already documented very well, other are not.

reboot.sh <node>

Script location: /usr/local/sbin

This script is used to reboot your node. This script will play a message announcing the reboot to let anyone listening know that your node is getting rebooted. After it plays the message, it waits 10 second and then reboots the whole system.

You can also define a DTMF function for this (useful for a remote node). This is not on by default and you should be very careful if you add this function as anyone with the right DTMF sequence would be able to reboot your node. If you wish to add this function then add the following line into /etc/asterisk/rpt.conf under your nodes function section (Replace the A1 at the beginning with the DTMF sequence you would want to use).

A1=cmd,/usr/local/sbin/reboot.sh <node>

halt.sh <node>

Script location: /usr/local/sbin

This script will shutdown you node. It will play a message announcing that the node is getting shutdown, wait 10 seconds, and then shutdown (halt) the system. You will have to power cycle the node in order to get it back up after running this script so be very careful when running it remotely.

You can also define a DTMF function for this (useful for a remote node). This is not on by default and you should be very careful if you add this function then anyone with the right DTMF sequence would be able to shutdown your node and it will take a power cycle to bring it back up again. I do not recommend adding this as a function for a live node. If you wish to add this function then add the following line into /etc/asterisk/rpt.conf under your nodes function section (Replace the A1 at the beginning with the DTMF sequence you would want to use).

A1=cmd,/usr/local/sbin/halt.sh <node>

saytime.pl <node>

Script location: /usr/local/sbin

This script will announce the current time (local to the node) so everyone on that node can hear it. The time is in 12 hour format.

You can also define a DTMF function for this. This is turned on by default as *81. If you wish to add/change this function then add or change it in /etc/asterisk/rpt.conf under your nodes function section (Replace the 81 at the beginning with the DTMF sequence you would want to use). If you don’t want users to be able ot ask for the time, then add a ‘ (semi-colon) in front of the line to comment it out.

81=cmd,/usr/local/sbin/saytime.pl <node>

This script is usually called from a cron job that will say the time at a given interval. By default this script is enabled with the following line in the cron file:

00 0-23 * * * (source /usr/local/etc/allstar.env ; /usr/bin/nice -19 /usr/bin/perl /usr/local/sbin/saytime.pl $NODE1 > /dev/null)

This will announce the time every hour (on the hour).

If you don’t like the time announcements, you can turn them off by commenting out this line with the command: crontab -e

say24time.pl <node>

Script location: /usr/local/sbin

See the saytime.pl file above, the only difference is that this file announces the time in 24 hour format (local to the node).

You can also define a DTMF function for this. This is turned on by default as *82. If you wish to add/change this function then add or change it in /etc/asterisk/rpt.conf under your nodes function section (Replace the 82 at the beginning with the DTMF sequence you would want to use). If you don’t want users to be able ot ask for the time, then add a ; (semi-colon) in front of the line to comment it out.

82=cmd,/usr/local/sbin/say24time.pl <node>

myip.sh

Script location: /usr/local/sbin

This will print out (to the CLI) the local IP address for your node. This is the IP address on the local interface (not the public one).

sayip.sh <node>

Script location: /usr/local/sbin

This will announce your IP address to everyone connected directly to your node <node>. This is the script that is used when your node starts up and announces the IP address.

You can also define a DTMF function for this (useful for a remote node or testing). This is turned on by default but with a DTMF sequence of A1. If you are like me and don’t have the letter A on your DTMF keypad, then you can change the A1 to any other DTMF sequence. If you wish to add/change this function then add or change it in /etc/asterisk/rpt.conf under your nodes function section (Replace the A1 at the beginning with the DTMF sequence you would want to use).

A1=cmd,/usr/local/sbin/sayip.sh <node>

mypublicip.sh

Script location: /usr/local/sbin

This will print out the public IP (to the CLI) of the node you are logged into. This is usually the IP address of your router and is the IP address that devices on the internet would connect to you on.

saypublicip.sh <node> <interface>

Script location: /usr/local/sbin

This will announce your public IP to everyone directly connected to your node <node>. This script is usually run as a DTMF function so it can be requested by the operator.

You can also define a DTMF function for this (useful for a remote node or testing). This is turned on by default but with a DTMF sequence of A3. If you are like me and don’t have the letter A on your DTMF keypad, then you can change the A3 to any other DTMF sequence. If you wish to add/change this function then add or change it in /etc/asterisk/rpt.conf under your nodes function section (Replace the A3 at the beginning with the DTMF sequence you would want to use).

A3=cmd,/usr/local/sbin/saypublicip.sh <node>

tts_audio.sh <-s> textfile.txt

Script location: /usr/local/bin

This creates a audio file from the text in the text file. You have to have a file created with the text in it for what you would like to say. If there is more than 100 characters in the text file, then use the -s on the command line. Currently this script uses the Google online Text to Speech engine but will be changing to use voicerss.org once version 2.0 is released. See the Text to Speech how-to on Hamvoip.org for more information.


change_vol.sh <inputfile> <outputfile> <volume change>

Script location: /usr/local/sbin

This can change the volume of your existing announcement/recording on your node. Why would you want to do this? A lot of node ops thing would like the announcements or node ID to play at a lower volume. This script allows that. You give the script the recoding (in a file) as the input <inputfile> and also an <outputfile> to write the new recoding to. The last argument is the volume express as a decimal value. A value of 1 would be 100% (the volume would not change) but a value of .5 would be a 50% reduction in the volume.


speaktext.sh “text string” <node>

Script location: /usr/local/sbin

This will speak the text to the specified node. Note: This does not change the text and speak words, it spells out the letters and says the number one at a time.


More script descriptions to come. Stay tuned. You can also check the HAMVoIP script document here.

Leave a Comment

Your email address will not be published. Required fields are marked *