Incoming connection notification for HamVOIP
A couple of scripts here implement monitoring incoming connections (excluding some as desired) that can notify in various ways:
- Announce on-air
- Send email (optionally to an SMS gateway)
- Send a notification to Amazon Alexa
- Via whatever script you care to come up with
Some or all of the above can be triggered by an incoming connection. You can easily modify it to launch other scripts such as an SMS app. For my purposes I just email my cell service provider's SMS gateway, but not all providers have an email>SMS gateway. YMMV.
Both scripts need to be modified before use as to your specific needs. There should be enough comments in each to point to those things.
Notification of incoming connection - base script
watch_incoming.sh waits for incoming connections (by monitoring the connection log).
REQUIREMENTS for configuration in addition to this script:
- ALL: Connection logging must be set up and working per supermon_howto.pdf (but does not require supermon be set up; only the logging)
- For ALEXA: The alexa_notify.sh script setup and working (uses "Notify me" Alexa skill).
- For EMAIL: RPi Email configured per Allstar_email_howto.pdf
I acknowledge that it's kind of cluncky to tail the connection log file to pull the info on the incoming connect, but it has all the information I wanted and some of it I did not know how to access elsewhere. I'm sure there's a better way, but I'm a bit lazy and took the path of least resistance. :)
Notification via Amazon Alexa script (optional)
Follow the directions in the alexa_notify.sh script to set up the "Notify me" Alexa skill by Thomptronics. You won't need alexa_notify.sh if you're not going to use the Alexa notification feature.
Automatically starting
I've been starting it as a cronjob (yeah, I know it's not the preferred way). I ran into difficulties with it when starting it immediately, I had to insert a delay. If you launch it some other way, that may not be the case; I don't know.
@reboot sleep 20 && exec /etc/asterisk/local/lm/watch_incoming.sh > /dev/null 2>&1
Start/stop/status of watch_incoming.sh
watch_incoming_status.sh is a utility for use with watch_incoming.sh. This script should not require any modification. (fixed 2/19/2024) Usage:
- No argument reports status running/not running.
- Argument="v" = Verbose (ps of watch_incoming.sh)
- Argument="k" = Kills watch_incoming.sh
- Argument="s" = Starts watch_incoming.sh in background