Friday, June 17, 2022

Allstar Link - Play net announcement

 This is a quick script to play a net announcement on Allstar Link.  If the repeater is busy, it will wait for 5 minutes for a break.  If there is no break - it will exit without playing.  You will need to create your custom announcement audio file using these procedures.

#!/bin/bash

stat=""

endTime=$(( $(date +%s) + 300))

while [[ $(date +%s) -lt $endTime ]]
do
        stat=$(asterisk -rx "rpt showvars 53431")


        if [[ $stat = *RPT_RXKEYED=0* ]]
        then
                break
        fi

        sleep 5
done

if [[ $stat = *RPT_RXKEYED=1* ]]
then
        exit
fi

/usr/sbin/asterisk -rx "rpt playback 53431 /root/fieldday2022"


This script checks to see if the repeater receiver is active before playing the announcement.  Replace 53812 with your node number.  The file netannounce is the recording that will be played.  It must be stored with the extension .ulaw in the directory of your choice.