Being an avid Asterisk admin and a novice AGI coder, I decided that it would be cool to try my hand at using Asterisk to control my Arduino over ethernet. Upon googling similar projects I came across Kate Hartman’s page on doing just that with an Arduino connected via an XPort module. Well, I have the Adafruit ethernet shield with a WIZnet module, but I decided to give it a try anyway. The first thing I noticed was the Arduino code appeared to be communicating with the XPort module via serial communication. This is a bit of a problem as the WIZnet module needs to make use of the ethernet library in Arduino IDE. So I threw together a little test environment with an LED connected to pin 4 and plugged in my ethernet shield to give the code a shot. Needless to say, it didn’t work straight out of the box…so I’ve made a few minor modifications which you can find attached to this post. I also found that Kate’s Asterisk AGI code was a bit dusty, being written perhaps for an older version of Asterisk than what I have (1.4.21.2), so I made a few modifications and was able to get it up and running. This should come in REALLY handy for some of the projects I’ve got waiting in the wings (ArduinOIL). Here’s how to get it up and running.
; Arduino Control
exten => 999,1,Answer
exten => 999,2,AGI(arduino_control.php)
exten => 999,3,Hangup
Amazing Project, I was wondering if you know of a way to trigger the arduino to make a call out? I am working on modifying my crappy old home buzzer to make it ring a cordless phone here at my house so I know when someone is at the door.
Any help would be great.
Regards,
The009
That’s a great idea. You can trigger asterisk to make an outbound call using the methods described on this page: http://www.voip-info.org/tiki-index.php?page=Asterisk+auto-dial+out
The hardest part would be getting the arduino to trigger the process over IP…off the top of my head having the arduino SSH into the PBX would probably be the easiest way. Connecting over HTTP would be another option. I may take a stab at it and post the details if I can find the time.
Hi,
interesting project. What about the other way? Connect the old door-bell push-botton to an arduino, which initiates a sip-call via ethernet-shield. So it rings on every phone / cell-phone at home or even in the garden. Is this possible? The commericial stuff including voice (SIP-Door-Station) is to expensive. Regards, Ralf
Thanks Ralf! Unfortunately, in order to have an Arduino make a SIP phone call, you’d have to do some pretty serious coding to make it handle SIP registers / notifies, etc. I’m not THAT good at programming
I agree though…it’d be really neat to see.