Using modem for sending voice recording
Linux uses vgetty
for voice data over a modem (mostly as an answering machine). It looks like there's a perl module over at CPAN that comes with an example script like what you want.
Callme script
In the examples subdirectory of the source distribution there is a callme.pl script. This dials the given number and plays the given message. Use the following command to run it:
vm shell -S /usr/bin/perl callme.pl <number> <message>.rmd
I use an external server for running an additional instance of Nagios, which is a last resort notification in case of complete failure.
I wish I had an answer for your modem audio playback question. I want to say it should be simple but my knowledge of that stuff is getting rusty. There used to be Voice Modems sold specifically for playback of audio.
If I were you, I would be trying to redirect audio playback using console software. I'd think this could be very simple. I might research more later when I have a moment.
I found this during a quick search:
- Nobix PageAlert
If you had a dial-up internet account, it could connect to the internet send a text via e-mail then disconnect.
Came across this question whilst Googling, and figured that although I specifically want to capture/replay a voice sample, a simple SMS might be suitable for your situation.
I used a Huawei modem (USB dongle) as an SMS center on my raspberry pi with a free SIM from a CSP, so that I can text it and it responds with basic info about the system. I'd guess it could easily be modified to send an SMS in response to Nagios detecting internet failure!
Note that you need a regular phone SIM (not a data-only/tablet SIM) to be able to send SMS.
I used the blog post here: http://hristoborisov.com/index.php/projects/turning-the-raspberry-pi-into-a-sms-center-using-python/
...which specifically uses this sample code on github.
In the interests of preventing link-rot, the gist is to use the serial
library in python (import serial
) and send regular modem AT commands to the modem. Put the modem in text mode and then send a test message using the following strings:
AT+CMGF=1\r
AT+CMGS="07123456789"\r
some message here.<Ctrl-Z>