September
01
Posted on 01-09-2010
Filed Under (Arduino, Asterisk, electronics) by Dan

A recent comment by the009 got me thinking…I’ve been able to get Asterisk grab info about sensors connected to an ethernet-enabled Arduino, but how about the other way around? What if you could allow your Arduino to make outbound calls through your Asterisk system to make a make-shift alarm system, or over-powered doorbell? Well, wait no longer! Here’s how it works:

Asterisk: A php script lives on your Asterisk server (hosted up by apache) that, when it’s accessed, checks to make sure the client accessing it matches a pre-defined IP of your Arduino. If so, it creates a call file with the criteria that you configure to call a number of your choice and drops it in the Asterisk outgoing queue directory, triggering Asterisk to make a call. (I would highly suggest you only set this up on a server that doesn’t have port 80 open to the world!)

Arduino: The sketch code is easy…simply trigger a client connection to the Asterisk server when a button is pushed, motion sensor tripped, or ultra sonic range finder measures a particular distance (that part is up to you). As long as the Arduino’s IP matches the allowed IP configured in the php script, your phone should ring!

Make it happen:

  1. To get started, download the code and extract the files.
  2. scp arduino_call.php into your web directory on your asterisk server.
  3. Next, add the lines from extensions_custom.conf (zip package) to /etc/asterisk/extensions_custom.conf
  4. Edit the variables at the top of arduino_call.php to match your configuration.
  5. Upload the sketch to your arduino, customizing to your configuration (of course!).
  6. Adapt it to your project!

Feel free to edit and manipulate this script to fit your needs, I just ask that you add a comment to this page explaining how you used it. Videos / pictures are always welcomed as well!

(4) Comments    Read More   

Comments

Arduitter on 9 September, 2010 at 2:10 pm #

Hey, just wanted you to know that i placed a post with a link to this project on my project blog.


Magne on 9 February, 2011 at 9:40 am #

Hi,

My call file is not moved to the outgoing folder. Do you know why that could be?


Dan on 9 February, 2011 at 10:43 am #

I would definitely check permissions on the outgoing folder and the file that is being created by the script. Also, make sure the syntax of the call file is correct. If all else fails, fire up the asterisk CLI in verbose mode and see what’s happening with the following command: asterisk -rvvvvvvvvvvvvv


Jungle-Boogie on 24 January, 2012 at 1:55 am #

Don’t stop playing with Arduino or asterisk. I recently discovered Arduino and I’m starting to think of ways to integrate it with my asterisk.


Post a Comment
Name:
Email:
Website:
Comments:

*

Prove you are human by reading this resistor:
0Ω+/- 5%

0
0
1
2
3
4
5
6
7
8
9

0
0
1
2
3
4
5
6
7
8
9

0
0
1
2
3
4
5
6
7
8
9

5
5
10
20

Match the sliders on the left to each color band on the resistor.

Click Here for a new resistor image.

If you'd like to learn more, read about resistor color codes here.