<?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>Fri, 26 Mar 2010 02:51:33 +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>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>0</slash:comments>
		</item>
	</channel>
</rss>
