In the rpt.conf file I modified the tail time from 2700000 to 2700001 to make that easy for the script to find. Easier than me dealing with SED and spaces anyway....I then added the DTMF command of *84 to set the tailmessage time to 45 minutes, and *85 to set the tailmessage time to 5 minutes. ALL 3 changes are commented on the file.
The deal breaker: The script from 45 to 5 minutes will only work if it is currently set to 2700001, and the script from 5 minutes to 45 will only work if the variable is currently set to 300001. Basically if someone manually changes the time to anything other than 2700001 & 300001 neither script will work.
First modify your rpt.conf file to match the above changes. Then upload the two additional scripts linked below, these 2 scripts need to be saved to the /usr/local/sbin/ and once there will need to be set to executable and set by typing the following four commands:
sudo -s
chmod u+x /usr/local/sbin/tail45minutes.sh
chmod u+x /usr/local/sbin/tail5minutes.sh
sudo asterisk -rx "rpt reload"
All should be set after that.