I use event management to manage connections when certain events occur.
To manage connections, scripts are executed that execute a series of commands to the asterisk.
Below is an example of using the event.
[1997001]
events=events
[events]
REMOTEKEYED_VAR = v|e|${RPT_ALINKS} =~ “”,1997002[TRC]K""
sudo -u root /bin/bash /etc/asterisk/Scripts/event_1.sh > /dev/null 2>&1 = s|t|REMOTEKEYED_VAR
SCRIPT: event_1.sh
#!/bin/bash
tempfile=/tmp/hub_conn
/usr/sbin/asterisk -rx “rpt nodes 28554” > $tempfile
grep “1200” $tempfile > /dev/null ||
CONNECTSTATUS=0
grep “1200” $tempfile > /dev/null &&
CONNECTSTATUS=1
if [[ “$CONNECTSTATUS” == “0” ]]
then
exit
fi
if [[ “$CONNECTSTATUS” == “1” ]]
then
/usr/sbin/asterisk -rx “rpt cmd 1200 ilink 1 28554”&&
/usr/sbin/asterisk -rx “rpt cmd 1200 ilink 11 28554”
fi
exit
To restore the previous connection configuration, I use rptinacttimer. Below is an example of its use.
[1200]
rptinacttimer=1
rptinacttime=180
rptinactmacro=*D9901#
macros=macros
[macros]
D9901 = cmd,/etc/asterisk/Scripts/act_timer.sh > /dev/null 2>&1
SCRIPT: act_timer.sh
#!/bin/bash
tempfile=/tmp/hub_conn
/usr/sbin/asterisk -rx “rpt nodes 28554” > $tempfile
grep “1200” $tempfile > /dev/null ||
CONNECTSTATUS=0
grep “1200” $tempfile > /dev/null &&
CONNECTSTATUS=1
if [[ “$CONNECTSTATUS” == “1” ]]
then
exit 0
fi
if [[ “$CONNECTSTATUS” == “0” ]]
then
/usr/sbin/asterisk -rx “rpt cmd 1200 ilink 18 28554”
fi
exit 0
The problem is that after some time, it can be 4-10-20 hours, problems occurs, expressed in crackles and sound distortions or short interruptions of the subtone at the transmitter output.
These problems appear all the time, not just when an event triggers a script, and are fixed by restarting the asterisk.
When this functionality is disabled, the node works as expected.
I had exactly the same problem when I used tonemacro and similar script to manage connections using subtones.
What could be the problem?