Skip to content

Asterisk Helper Scripts

Ham radio
Shell

Small shell scripts for managing AllStarLink and HamVoIP node connections from the Asterisk command line: connect, disconnect, switch between nodes in one step, and keep your node linked to a favourite hub.

Requirements

  • An AllStarLink 3 (ASL3) or HamVoIP node: Asterisk with app_rpt, at /usr/sbin/asterisk
  • Permission to run asterisk -rx (usually root, or through sudo)
  • /usr/local/etc/allstar.env defining NODE1, your local node number. HamVoIP ships this file; on ASL3, create-allstar-env.sh makes it for you

The scripts

node-connect.sh

Connects your node to the remote node you give it (rpt cmd ilink 3).

node-connect.sh <node_number>

node-disconnect-all.sh

Drops every link from your node (rpt cmd ilink 6).

node-disconnect-all.sh

node-qsy.sh

Disconnects any current links, then connects to the node you give it, so you can QSY from one node to another in a single step.

node-qsy.sh <node_number>

create-allstar-env.sh

Creates /usr/local/etc/allstar.env on AllStarLink 3 systems, which don’t ship it, with your node number filled in.

  • Finds your node number from rpt nodes, falling back to the first node in rpt.conf
  • Does nothing on HamVoIP, which already has the file
  • Leaves an existing allstar.env alone unless you pass -f or --force
  • Needs permission to write to /usr/local/etc (usually root)
create-allstar-env.sh [-f|--force]

node-auto-reconnect.sh

Keeps your node connected to a preferred hub. Run it from cron and it reconnects whenever the node has been left unlinked.

  • Connects to the primary node, and tries the fallback node if that fails (defaults 53573 and 47977)
  • Reads NODE1 from allstar.env, or finds it from rpt nodes or rpt.conf
  • Detects HamVoIP or AllStarLink and uses the right rpt command for each
  • Leaves the node alone if it already has active links, or if NO_RECONNECT_SCRIPT=1 is set on the node
node-auto-reconnect.sh [primary_node] [fallback_node]

Based on a script by Tom Tierney (G5TOM).

Running the auto-reconnect from cron

Add lines like these with crontab -e to run node-auto-reconnect.sh at boot and every 15 minutes after that. To use your own hub nodes, pass them as arguments, for example /root/node-auto-reconnect.sh 53573 47977.

@reboot /root/node-auto-reconnect.sh > /dev/null 2>&1
*/15 * * * * /root/node-auto-reconnect.sh > /dev/null 2>&1

Check the installed jobs with crontab -l.

Before you use them

  • Review the node numbers in the scripts, including the auto-reconnect defaults, and change them for your own setup before use.
  • The scripts are provided as is, without warranty. Test them on your own node first, and make sure your use fits your node configuration, your amateur radio licence and local regulations.

Source code

Download the scripts, read the full README and follow changes on GitHub.

Asterisk Helper Scripts on GitHub