[arm-allstar] Audio Files - Play only when there has not been any traffic

Danny K5CG k5cg at hamoperator.org
Sat Jan 27 13:51:56 EST 2024


Or if you want to make sure that a certain amount of time has passed after the last transmission; 

touch /tmp/tx = s|t|RPT_ETXKEYED

Then, every minute check for the time the /tmp/tx file was touched and if over x minutes, then do something.

if test `find "tx" -mmin +10`
then
    echo asterisk -rx .... play file
fi

This isn't exact, just the idea.

73 
Danny, K5CG 
HH 550-000-0609 
SKCC 14257

----- Original Message -----
From: "ARM Allstar" <arm-allstar at hamvoip.org>
To: "ARM Allstar" <arm-allstar at hamvoip.org>
Cc: "Patrick Perdue" <borrisinabox at gmail.com>
Sent: Friday, January 26, 2024 8:54:12 PM
Subject: Re: [arm-allstar] Audio Files - Play only when there has not been any traffic

This is pretty open-ended, really.

Without actually writing anything (don't have time right now), I can 
think of a few ways to do it.

One way would be to attach a script or command to an event as defined in 
the events stanza of your node, something like:

[events<yournodenumber>

touch /tmp/tx = s|t|RPT_ETXKEYED
rm /tmp/tx = s|f|RPT_ETXKEYED

In this example, a file is created in /tmp when someone is transmitting 
toward the node, and removed when the transmission stops.

Now, you could write a simple script that plays a file only if /tmp/tx 
doesn't exist, then call it with cron, drive it manually or whatever.

/etc/asterisk/local/notx-announcement.sh

#!/bin/bash
if [ -e /tmp/tx ]
then
echo "nothing to do. Exiting."
exit
else
asterisk -rx "rpt playback <yournode> /etc/asterisk/local/some_file
fi


NOTE! THIS IS UNTESTED!


You could do more sophisticated things, like using timers (sleep) such 
that a file is automatically played after <x> seconds of inactivity 
instead of using the temp file method.

Come to think of it, you could probably also do something with 
lnkacttime, lnkactmacro, and remote_inact_timeout, though I've never 
tried using it that way, either.


73

N2DYI


On 1/26/2024 8:58 PM, Josh Hatton via ARM-allstar wrote:
> Evening!
>
> Interested in what the braintrusts think on how I could code some audio to
> play (Messages, etc.) at times when there is no traffic on a node?
> Basically play only when there has been time without any key-ups or
> activity.
>
> Of course *asterisk** -rx "rpt playback nnnn /etc/asterisk/audio/audiofile"*
> from within rpt.conf or a cron job if they had some sort of awareness of
> node activity.
>
> Any ideas from the braintrust of the group?
>
> Thanks a bunch for your time!
> Josh W4ZZK
> _______________________________________________
>
> ARM-allstar mailing list
> ARM-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3/4 web page - http://hamvoip.org
_______________________________________________

ARM-allstar mailing list
ARM-allstar at hamvoip.org
http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar

Visit the BBB and RPi2/3/4 web page - http://hamvoip.org


More information about the ARM-allstar mailing list