<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nerdy By Nature &#187; Asterisk</title>
	<atom:link href="http://www.nerdybynature.com/index.php/category/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nerdybynature.com</link>
	<description>Pull up your high-water pants, strap on your suspenders and push your glasses up the bridge of your nose...</description>
	<lastBuildDate>Tue, 22 Nov 2011 20:10:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Br-r-r-r-r-ing&#8230;It&#8217;s your Arduino</title>
		<link>http://www.nerdybynature.com/index.php/2010/09/br-r-r-r-r-ing-its-your-arduino/</link>
		<comments>http://www.nerdybynature.com/index.php/2010/09/br-r-r-r-r-ing-its-your-arduino/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 01:55:34 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[alarm system]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[doorbell]]></category>
		<category><![CDATA[sip]]></category>

		<guid isPermaLink="false">http://www.nerdybynature.com/?p=324</guid>
		<description><![CDATA[A recent comment by the009 got me thinking&#8230;I&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>A recent comment by <a href="http://www.the009.net/" target="_blank">the009</a> got me thinking&#8230;I&#8217;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&#8217;s how it works:</p>
<p>Asterisk: A php script lives on your Asterisk server (hosted up by apache) that, when it&#8217;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&#8217;t have port 80 open to the world!)</p>
<p>Arduino: The sketch code is easy&#8230;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&#8217;s IP matches the allowed IP configured in the php script, your phone should ring!</p>
<p>Make it happen:</p>
<ol>
<li>To get started, <a href="http://www.nerdybynature.com/wp-content/uploads/2010/09/arduino_call.zip" target="_blank">download the code</a> and extract the files.</li>
<li>scp arduino_call.php into your web directory on your asterisk server.</li>
<li>Next, add the lines from extensions_custom.conf (zip package) to /etc/asterisk/extensions_custom.conf</li>
<li>Edit the variables at the top of arduino_call.php to match your configuration.</li>
<li>Upload the sketch to your arduino, customizing to your configuration (of course!).</li>
<li>Adapt it to your project!</li>
</ol>
<p>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!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/h6KHTLB5a-g&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/h6KHTLB5a-g&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nerdybynature.com/index.php/2010/09/br-r-r-r-r-ing-its-your-arduino/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pachube + Asterisk</title>
		<link>http://www.nerdybynature.com/index.php/2009/05/pachube-asterisk/</link>
		<comments>http://www.nerdybynature.com/index.php/2009/05/pachube-asterisk/#comments</comments>
		<pubDate>Thu, 14 May 2009 15:46:29 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[pachube]]></category>

		<guid isPermaLink="false">http://www.nerdybynature.com/?p=199</guid>
		<description><![CDATA[I&#8217;m currently working on a project that works with pachube to post information to the web. It&#8217;s really handy to be able to get the sensor information from my Arduino to the web with an ethernet shield and a few lines of code. However, I want to take this functionality a step further and make [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nerdybynature.com/wp-content/uploads/2009/05/logo.png"><img class="size-medium wp-image-210 alignright" title="pachube logo" src="http://www.nerdybynature.com/wp-content/uploads/2009/05/logo.png" alt="" width="168" height="60" /></a>I&#8217;m currently working on a project that works with pachube to post information to the web. It&#8217;s really handy to be able to get the sensor information from my Arduino to the web with an ethernet shield and a few lines of code. However, I want to take this functionality a step further and make the pachube feed available from my Asterisk phone system in the rare event that I&#8217;m away from civilization and don&#8217;t have access to an internet connection. The script I came up with is geared towards my ArduinOil project, but could easily be converted and used in any way with any information. The way it works is this: user calls extension (or could be made available from an AVR), the AGI script requests pachube feed information, flight or cepstral is used to read information to user. Here&#8217;s what you&#8217;ll need to do to get it up and running:</p>
<ol>
<li>Download the <a href="http://community.pachube.com/files/Pachube_PHP_library.zip" target="_blank">pachube PHP library</a>, and <a href="http://www.nerdybynature.com/wp-content/uploads/2009/05/pachube.zip" target="_blank">pachube AGI script</a>.</li>
<li>Unzip the pachube_functions.php file from the PHP library zip and copy it and the AGI script into /var/lib/asterisk/agi-bin/</li>
<li>Unzip pachube.php from the AGI script zip and copy it into /var/lib/asterisk/agi-bin/</li>
<li>chmod +x and chown asterisk:asterisk both files</li>
<li>Make changes to configurable options in pachube.php (ie. api key, feed id, etc.)</li>
<li>Add the following dial plan code to your extensions.conf or extensions_custom.conf (FreePBX)</li>
<blockquote><p>exten =&gt; 750,1,Answer<br />
exten =&gt; 750,n,Wait(2)<br />
exten =&gt; 750,n,AGI(pachube.php)<br />
exten =&gt; 750,n,Hangup</p></blockquote>
<li>Reload your asterisk dial plan: asterisk -rx dialplan reload</li>
</ol>
<p>There is more feed information available from the pachube PHP library such as latitude and longitude of the project, multiple datastreams, etc. But this should be enough to get you on your way. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nerdybynature.com/index.php/2009/05/pachube-asterisk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Asterisk to Control your Arduino</title>
		<link>http://www.nerdybynature.com/index.php/2009/03/using-asterisk-to-controll-your-arduino/</link>
		<comments>http://www.nerdybynature.com/index.php/2009/03/using-asterisk-to-controll-your-arduino/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 14:06:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[control]]></category>

		<guid isPermaLink="false">http://www.nerdybynature.com/?p=180</guid>
		<description><![CDATA[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&#8217;s page on doing just that with an Arduino connected via an XPort module. Well, I have [...]]]></description>
			<content:encoded><![CDATA[<p>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 <a href="http://itp.nyu.edu/~kh928/phonesandobjects.html" target="_blank">Kate Hartman&#8217;s page</a> 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&#8217;t work straight out of the box&#8230;so I&#8217;ve made a few minor modifications which you can find attached to this post. I also found that Kate&#8217;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&#8217;ve got waiting in the wings (ArduinOIL). Here&#8217;s how to get it up and running.</p>
<ol>
<li><a href="http://www.nerdybynature.com/wp-content/uploads/2009/03/arduino_control.zip" target="_blank">Download source code</a></li>
<li>Upload the attached sketch to your Arduino</li>
<li>Copy the arduino_control.php file into your agi-bin (usually /var/lib/asterisk/agi-bin) and edit the configurable options to match your setup. Make sure you change the permissions on the file with &#8220;chown asterisk:asterisk arduino_control.php&#8221; and also make it executable with &#8220;chmod +x arduino_control.php&#8221;</li>
<li>Edit your dial plan (I use freePBX so the file is /etc/asterisk/extensions_custom.conf, otherwise it would be /etc/asterisk/extensions.conf) to include the following lines (you can change the 999 to whatever extension you prefer to dial to get control of your arduino):</li>
<blockquote><p>; Arduino Control<br />
exten =&gt; 999,1,Answer<br />
exten =&gt; 999,2,AGI(arduino_control.php)<br />
exten =&gt; 999,3,Hangup</p></blockquote>
<p></p>
<li>
Restart asterisk services with &#8220;amportal restart&#8221;
</li>
<li>
Hack the code apart and make it do something awesome!
</li>
</ol>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/zOnF97u8OwQ&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/zOnF97u8OwQ&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nerdybynature.com/index.php/2009/03/using-asterisk-to-controll-your-arduino/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

