| Audio data sensor |
|
|
| Written by Administrator | |
| Sunday, 24 September 2006 | |
|
Ever had the need for your script to know if/when there is an active audio stream coming into your IRLP node? If so, this may be the solution you've been looking for. My audio data sensor script can be downloaded here: http://rob.pectol.com/irlp/scripts/audiodata_sense If you are trying to have a script manipulate the PTT line for any reason, you've probably found that you need a reliable way to detect the presense of incoming audio data to your node. audiodata_sense is a script which does just that. It reliably senses whether or not your node is receiving audio data from the 'Net. It requires no arguments or switches. Simply run it and it will return a, "1" if there is incoming audio data, else it returns a, "0." This can be very useful for other custom scripts to be able to make decisions based on the result from executing audiodata_sense from those scripts. The way it accomplishes it's task is as follows. First, it uses iptables to establish a rule in the kernel's packet inspection mechanism, which simply marks highly-targeted incoming traffic. This targetd traffic only includes packets which contain the audio data payload, while everything else is excluded. Next, it takes a, 'snapshot' of the kernel packet counters for only that targeted traffic, sleeps for a short period of time, and then takes another snapshot. Finally, it compares the two snapshots for a difference in packet count and returns a, "1" if there is a difference. If the count is the same for both shapshots, then audiodata_sense.sh returns a, "0." This describes the basic functionality of the script although it has some extra things to reduce the chances of false positives, etc. So far, it has proven to be extremely accurate. audiodata_sense may be downloaded here: http://rob.pectol.com/irlp/scripts/audiodata_sense Enjoy!
* NOTE This has been tested using RedHat FC3/5, CentOS 4.5/4.6, and Ubuntu 6.06. It should work with previous versions as long as your kernel supports packet length matching (/etc/iptables/libipt_length.so will be present) in iptables. Most relatively recent installs do by default. |
|
| Last Updated ( Saturday, 09 February 2008 ) |
| < Prev | Next > |
|---|
Connectivity Checker 


