(Mis)Using Comsat
Recently, my day stood still as I waited for an important email. While I stared at my email client, silently encouraging it to report my long-awaited email, I cursed my immobility. Here I sat, stuck indoors, in front of a screen, when I could instead enjoy the good weather, sip a cold drink and read a book on my deck. How I wished for a portable tool that would notify me audibly when email arrived in my In Basket.
Above, and to the left of my screen sits my IP04 Asterisk server. Circumstances have prevented me from playing with it of late, and (while it sits patiently) I want to get back to it.
Hmmmm......
- I have a portable, wireless telephone that I can take to the deck with me,
- The IP04 can ring my telephone, and play back a voice prompt to me,
- I can automate some IP04 Asterisk activities using the Call Files
- The IP04 runs a trimmed-down Linux environment, including a commandline and inetd, just like a normal Linux system
- The inetd service on a normal Linux system launces the comsat service for email notifications
- The comsat server on a normal Linux system receives email notifications, and notifies the user about the new email
- comsat receives these notifications via UDP packets from the network
- procmail can direct comsat notification packets to specified network addresses
... and a plan is born.
If I can build a special-purpose comsat to run on the IP04, I can have the IP04 call me whenever email arrives. I can keep the phone handset outdoors, and simply listen to a voice prompt telling me that "I have mail".
The plan:
- My procmail script on my mail server directs a comsat packet to the IP04 whenever new mail arrives
- On the IP04, inetd launches a special comsat when it receives the comsat UDP packet
- This special comsat on the IP04 extracts the email addressee from the comsat packet, and builds a special Asterisk Call File to notify that addressee of the arrival
- Asterisk runs the Call File, dials my extension, and plays me a message.
and voila, the deed is done.
Now, all I have to do is implement it. Just the thing to keep me busy at the computer while I await an important email.