Home Add-ons PTT Timeout Override
PTT Timeout Override PDF Print
Wednesday, 15 July 2009 10:14

This script can be used to override the PTT timeout (or lock detect) that is hard-coded in the IRLP software.  It provides a configurable break in incoming audio, at configurable intervals, which allows the ptt lock detect timer to reset.  It can be configured to use either dynamic packet filtering, or the manipulation of ispeaker/sfswrapper to accomplish the task.  Download my nopttimeout script here:
http://irlp.kk7av.com/scripts/nopttimeout

Put the nopttimeout script in your /home/irlp/custom/ directory and make sure it's set executable (do, 'chmod 750 /home/irlp/custom/nopttimeout' at the command prompt).  There are several user configurable settings at the top of the script which allow you to adjust the timing and method to suit your needs.  nopttimeout has the ability to dynamically block and unblock the inbound packets that carry the audio payload by manipulating the kernel's packet filtering tables.  By handling it at the packet level, it becomes transparent to the IRLP software, and is treated exactly the same as a genuine break in received audio (thus resetting the ptt lock detect timer).  Because the manipulation of the kernel's packet filtering tables requires privileged access, you will need to add the following line to your /etc/sudoers file via the, "visudo" command:
repeater ALL= NOPASSWD: /sbin/iptables
Although not the recommended way, nopttimeout can also be configured to manipulate ispeaker and sfswrapper in order to accomplish the break in incoming audio.  This causes the ispeaker binary to be killed off and then restarted each and every time the break interval is reached.  It's not as seamless, but it works.  If this method is used, there is no need to modify your /etc/sudoers file as mentioned above.  After configuring nopttimeout to your liking, it can be run right from the command line or called from another script (like /home/irlp/custom/custom_decode).

To be able to activate and deactivate it from a DTMF command sequence, simply place the following code into your /home/irlp/custom/custom_decode file:

# starts the nopttimeout timer
if [ "$1" = "SP1" ]; then
if [ -f "$LOCAL/active" ]; then
killall ispeaker > /dev/null 2>&1
fi
$BIN/key
sleep 1
play $AUDIO/1.wav
$BIN/unkey
if [ -f "$LOCAL/active" ]; then
$SCRIPT/sfswrapper > /dev/null 2>&1
fi
$CUSTOM/nopttimeout & > /dev/null 2>&1
exit 1
fi
# stops the nopttimeout timer
if [ "$1" = "SP0" ]; then
if [ -f "$LOCAL/active" ]; then
killall ispeaker > /dev/null 2>&1
fi
$BIN/key
sleep 1
play $AUDIO/0.wav
$BIN/unkey
if [ -f "$LOCAL/active" ]; then
$SCRIPT/sfswrapper > /dev/null 2>&1
fi
if [ -f /tmp/nopttimeout.lock ]; then
touch $LOCAL/.nopttimeout
fi
exit 1
fi

That would cause the DTMF sequence, "*#1" (star-pound-one) to activate, and, "*#0" (star-pound-zero) to deactivate nopttimeout.  As can be seen, the nopttimeout script can easily be stopped by creating a, 'flag' file in /home/irlp/local/ called, '.nopttimeout' (don't overlook the dot at the beginning).  When nopttimeout encounters this file, it immediately removes it and then exits.  This makes it very easy to background the nopttimeout script and still be able to signal it.  Enjoy!   Wink

Last Updated on Friday, 20 August 2010 10:13
 
 

Advertisements