Remember when I wanted to get my Asterisk phone system monitoring my home alarm panel? I did it today! It was surprisingly easy, too. Took about a half-hour of geeking to get it done.
Why monitor my alarm with Asterisk? Because the house has no land line and I don’t see the wisdom of paying some company $240 a year to do what I can do much better myself. Plus there’s something cool about having your computer do things when something physical happens – and Asterisk can do just that.
The best part about all of this is that Asterisk can do this right out of the box. The applet that does it, called AlarmReceiver, has been included with Asterisk for four years. All that needs to be done is to set up extensions.conf to use the AlarmReceiver module whenever a certain extension is dialed.
While I could explain the process step by step, there is already a great guide on the Internet which shows how its done. Check out Matt Watson’s great HOWTO and follow the simple steps. Its as easy as that.
The real trick was finally deciding to call the company that installed my alarm and asking them to program the dial-out phone number for me. Once that was done Asterisk handled the rest.
Now whenever an alarm is triggered, I get a cool text file created that looks like this one:
TIMESTAMP=Wed Aug 27, 2008 @ 21:42:02 EDT
The good stuff is the last line, of course.
- The CCCC is my subscriber ID (CCCC is the default because I don’t subscribe to anything. Heh).
- 18 is the message type (can be 18 or 98)
- 1 indicates a new event
- 406 indicates a CANCEL event
- 01 is the partition (not important in a residential setup)
- 002 is the zone, in this case the keypad
- # is the checksum for the string
The Ademco event codes are available on the Internet and provide a wealth of status information.
The other big trick to getting this to work has to do with the VoIP setup inside my house. I’ve got my alarm panel plugged into a Linksys VoIP terminal adapter (TA), which in turn transmits the DTMF tones into bits to cross my network, where the Asterisk system decodes them again to send to AlarmReceiver. To do this reliably in VoIP, one must set the Linksys TA to do in-band DTMF signalling and use the G.711 ulaw codec. This should ensure the DTMF tones don’t get garbled on the way to Asterisk. This can be done in about 30 seconds.
Got an alarm panel currently being monitored by a commercial service that you’d like to turn over to Asterisk? No problem! Simply connect its phone line to a VoIP terminal adapter, cause an event, and watch your Asterisk logs to see which number the panel calls. Then create that extension in Asterisk, and redirect the call to the AlarmReceiver app. Once you get all your settings right you can cancel your monitoring service.
Asterisk can alert you to practically any event you’d like. If someone breaks into your house Asterisk could call your mobile phone, play a message saying “your intrusion alarm has been triggered. Press 1 to ring your home phone.” You could then choose to call your home and decide if further action is required (i.e. call the cops). Or, you could put in an option that turns on a microphone, allowing you to listen in on the home. Even better, you could have the alarm automatically turn on webcams so you could see the cause of the alarm! Hey, you could have Asterisk automatically “release the hounds” while you’re at it!