LEGO a Go-Go
How could I not post that picture?
As a little experiment in getting Asterisk to interface with physical objects, I setup a servo that will push a LEGO man over when the user enters 1 on their phone and pulls him back up when they enter 2. It was all relatively straightforward, using a PHP script to send commands from Asterisk to an Xport, and then passing that through to the Arduino, which controls the servo.
More on setting up the Xport to work with Arduino on Tom Igoe’s site.
Here’s the Arduino code to take the input from the Xport, pass it through to the Arduino, and then move the server to specified points when it receives a 1 or a 2: Arduino code for Asterisk to Xport
And then I use a simple AGI call in the dialplan…
exten => s,1,AGI(/home/ajs292/asterisk_agi/ajs292_arduino.php)
…to run this simple PHP script, which opens a socket to the Xport and passes the digits through as ASCII: AGI/PHP script for Asterisk to Xport
A much more detailed description of this on Kate’s site, from where I stole much of my code.

Activity