# I placed the following in my rpt.conf

**URL:** <https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755>\
**Category:** AllStarLink\
**Created:** [July 18, 2021, 6:33pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755 "2021-07-18T18:33:03Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [July 18, 2021, 6:33pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/1 "2021-07-18T18:33:04Z")

</div>

and restarted asterisk. But it doesn’t play the message (the command works from the command line) when RX goes active

[events]  
/usr/sbin/asterisk -rx “rpt playback 1100 /etc/asterisk/audio/newsfiles/newsline\_10” = s|e|${RPT\_RXKEYED}

I also tried this but COS isn’t set as a global variable either

COS = g|e|${RPT\_RXKEYED}

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [July 19, 2021, 3:10am UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/2 "2021-07-19T03:10:52Z")

</div>

What duplex mode are you using for this node ? (rpt.conf) duplex= ?

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [July 19, 2021, 2:50pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/3 "2021-07-19T14:50:33Z")

</div>

Duplex =0 with linktolink = yes

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [July 19, 2021, 6:11pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/4 "2021-07-19T18:11:51Z")

</div>

I think I see what the (my) problem is - I expected a global variable to be accessible by the shell, but apparently it is only accessible by the Asterisk AMI or AGI. But I can see it in the Asterisk CLI

Maybe Event Management isn’t what I want but I am after a way to have a bash script I’m running know if RX is active or not

---

<div class="post-metadata">

**Author:** ![WD6AWP](https://community.allstarlink.org/user_avatar/community.allstarlink.org/wd6awp/32/5_2.png) [@WD6AWP](https://community.allstarlink.org/u/WD6AWP)\
**Post date:** [July 20, 2021, 4:14am UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/5 "2021-07-20T04:14:54Z")

</div>

Take a look at [https://www.qsl.net/k0kn/swissarmy](https://www.qsl.net/k0kn/swissarmy) there might be some hints in there to do what you want to do.

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [July 20, 2021, 3:52pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/6 "2021-07-20T15:52:03Z")

</div>

Thanks for the link. However, as a test I tried one other thing

Under the node stanza:

events = events1234

Then the new stanza:

[events1234]  
COS = g|e|${RPT\_RXKEYED}  
touch /home/test/test = s|t|COS

/home/test is writable to the world

This does not create a file “text” in said directory, though the CLI shows:

Setting global variable ‘COS’ to ‘1’

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [July 20, 2021, 5:47pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/7 "2021-07-20T17:47:05Z")

</div>

I found the solution.

This does NOT work:

[events1234]  
COS = g|e|${RPT\_RXKEYED}  
touch /home/test/test = s|t|COS

THIS does work:

[events1234]  
touch /home/test/test = s|t|RPT\_RXKEYED

This doesn’t seem to be in line with the Wiki

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [July 31, 2021, 9:24pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/8 "2021-07-31T21:24:55Z")

</div>

I see your text of what works for you, but as far as I can see, you are creating a file ‘test’ on RPT\_RXUNKEYED

But to know why or how that worked, I would need to see the rest of the judgement you are making when the statement is not true, for the file still exists from 'touch’ing it.  
You are not removing it as well when the statement is untrue.

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [August 1, 2021, 7:08pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/9 "2021-08-01T19:08:53Z")

</div>

Well… I was just touching a file to verify the feature was working. (I certainly wouldn’t touch and delete a file every time RX went active/inactive on an SD card).

What I ultimately wish to do is set a variable that can be read by a bash script to determine RX activity. But from my above test, it seems that variables don’t work as the Wiki says they should. At least not for me

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [August 2, 2021, 2:52am UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/10 "2021-08-02T02:52:14Z")

</div>

I kinda got the idea.

Here is a method I used, writing to a file so I could tail it for live evaluations.  
It’s kinda old but should work as well.

while read -r line  
do  
asterisk -rx “rpt showvars 1000” \> livestat.txt  
stat="$line"  
if $stat = “RPT\_TXKEYED=0”; then  
exit 1  
fi  
done \< “$statname”

You would have to convert it a bit to fit your shell purpose. But you get the idea.  
Perhaps it would keep you from fiddling with onevent.

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [August 2, 2021, 2:59am UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/11 "2021-08-02T02:59:24Z")

</div>

I should mention that there is a method to carry a var back into asterisk from a shell.  
But I would use a global declaration for it.  
I’m sure that gets additional wheels turning.

---

<div class="post-metadata">

**Author:** ![VK3JED](https://community.allstarlink.org/letter_avatar_proxy/v4/letter/v/c2a13f/32.png) [@VK3JED](https://community.allstarlink.org/u/VK3JED)\
**Post date:** [August 2, 2021, 6:57am UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/12 "2021-08-02T06:57:11Z")

</div>

@AH6LE you can always put the file on a RAMdisk. That’s very easy to do on Linux, especially if you have ramfs available (certainly seen it on anything Debian based). Software such as Pi-Star makes extensive use of RAMdisks for logging and other frequently written directories.

Can touch and delete to your heart’s content. 🙂

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [August 2, 2021, 7:33pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/13 "2021-08-02T19:33:17Z")

</div>

Great idea guys, thanks for the idea

I created ramdisk at /etc/ramdisk and allocated it 1 meg. In my rpt.conf file:

touch /etc/ramdisk/cor = s|t|RPT\_RXKEYED  
rm /etc/ramdisk/cor = s|f|RPT\_RXKEYED

I just check for the existence of /etc/ramdisk/cor in my script and voila!

---

<div class="post-metadata">

**Author:** ![VK3JED](https://community.allstarlink.org/letter_avatar_proxy/v4/letter/v/c2a13f/32.png) [@VK3JED](https://community.allstarlink.org/u/VK3JED)\
**Post date:** [October 25, 2021, 8:23pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/14 "2021-10-25T20:23:09Z")

</div>

Glad to see it worked out. I may be interested in your idea, where and how are those lines inserted into rpt.conf?

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [October 25, 2021, 11:02pm UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/15 "2021-10-25T23:02:50Z")

</div>

Sure! Here are the entries in my rpt.conf

[events1234]

;the following lines create/erase file cor for either Allstar RX or TX  
touch /etc/ramdisk/cor = s|t|RPT\_RXKEYED  
touch /etc/ramdisk/cor = s|t|RPT\_TXKEYED  
rm /etc/ramdisk/cor = s|f|RPT\_RXKEYED  
rm /etc/ramdisk/cor = s|f|RPT\_TXKEYED

The reason for using both RX and TX is to make sure ASL sees activity locally or coming from another connected node

---

<div class="post-metadata">

**Author:** ![VK3JED](https://community.allstarlink.org/letter_avatar_proxy/v4/letter/v/c2a13f/32.png) [@VK3JED](https://community.allstarlink.org/u/VK3JED)\
**Post date:** [October 26, 2021, 10:17am UTC](https://community.allstarlink.org/t/i-placed-the-following-in-my-rpt-conf/18755/16 "2021-10-26T10:17:24Z")

</div>

Thanks, I’m looking to rebuild my IRLP node and upgrade my ASL node to ASL2.0, and this functionality could be useful to support IRLP’s busy channel lockout.
