<?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>kenny.barnt.us</title>
	<atom:link href="http://kenny.barnt.us/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://kenny.barnt.us</link>
	<description>just a geek's blog</description>
	<lastBuildDate>Thu, 13 May 2010 14:35:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Quick Thought on the Flash Wars</title>
		<link>http://kenny.barnt.us/?p=181</link>
		<comments>http://kenny.barnt.us/?p=181#comments</comments>
		<pubDate>Thu, 13 May 2010 14:35:55 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Life in General]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=181</guid>
		<description><![CDATA[This (very slightly modified) excerpt from an open letter by one of the clashing companies&#8217; executives, is a perfect example of how both sides are trying to use the same basis for their arguments against the other side. Unless you &#8230; <a href="http://kenny.barnt.us/?p=181">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This (very slightly modified) excerpt from an open letter by one of the clashing companies&#8217; executives, is a perfect example of how both sides are trying to use the same basis for their arguments against the other side. Unless you know already, who wrote this (and assuming you&#8217;ve been following the mess at all), I doubt you could tell me which company this came from:</p>
<blockquote><p>The genius of the Internet is its almost infinite openness to innovation. New hardware. New software. New applications. New ideas. They all get their chance.</p>
<p>[We] believe open markets are in the best interest of developers, content owners, and consumers. Freedom of choice on the web has unleashed an explosion of content and transformed how we work, learn, communicate, and, ultimately, express ourselves.</p>
<p>If the web fragments into closed systems, if companies put content and applications behind walls, some indeed may thrive — but their success will come at the expense of the very creativity and innovation that has made the Internet a revolutionary force.</p>
<p>We believe that consumers should be able to freely access their favorite content and applications, regardless of what computer they have, what browser they like, or what device suits their needs. No company — no matter how big or how creative — should dictate what you can create, how you create it, or what you can experience on the web.</p>
<p>When markets are open, anyone with a great idea has a chance to drive innovation and find new customers.</p></blockquote>
<p>It&#8217;s actually from the <a href="http://www.adobe.com/choice/openmarkets.html">Adobe Open Letter</a>, but can&#8217;t you see the same message coming out of Cupertino just as easily?</p>
<p>Myself, I lean more toward Apple, not out of any fanboyism, but because, IMO, they are only trying to exert reasonable control over their own products &#8211; rather than Adobe&#8217;s approach of wanting everyone to use their product. Regardless, this common philosophical ground should be the foundation of some sort of compromise to end the fighting.</p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=181</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Roll Your Own: Part 4 &#8211; Testing/Conclusion</title>
		<link>http://kenny.barnt.us/?p=160</link>
		<comments>http://kenny.barnt.us/?p=160#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:20:49 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=160</guid>
		<description><![CDATA[(previous) Testing Now that we&#8217;ve got everything configured, all we need to do is test our setup. Dial your Google Voice number from a land-line or cell phone. This should ring your SIP phone. Try this a few times and: &#8230; <a href="http://kenny.barnt.us/?p=160">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://kenny.barnt.us/?p=157">(previous)</a></p>
<p><strong>Testing</strong></p>
<p>Now that we&#8217;ve got everything configured, all we need to do is test our setup.</p>
<ol>
<li>Dial your Google Voice number from a land-line or cell phone. This should ring your SIP phone. Try this a few times and:
<ul>
<li>Answer the call</li>
<li>Let the call ring through to voicemail (unavailable greeting)</li>
<li>Reject the call (busy greeting)</li>
</ul>
</li>
<li>Dial 1002 from your SIP phone. This should give you an error message.</li>
<li>Dial 1009 from your SIP phone. This should connect you to the voicemail system. Enter 1000 for the mailbox number, and 1234 for the password. Try recording greetings and playing any messages you&#8217;d left earlier.</li>
<li>Call a land-line or cell phone from your SIP phone.</li>
<li>Dial 1010 from your SIP phone, this should ring the phone number you specified in extensions.conf</li>
<li>Dial 3000 from your SIP phone, this should playback a test message.</li>
<li>Dial 911 from your SIP phone, this should playback an error message.</li>
</ol>
<p><strong>Conclusion</strong></p>
<p>Now that you&#8217;ve got started with Asterisk, you can customize your setup to do any number of things, all it takes is a little creativity and ingenuity.</p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=160</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Roll Your Own: Part 3.2 &#8211; Asterisk Configuration Continued</title>
		<link>http://kenny.barnt.us/?p=157</link>
		<comments>http://kenny.barnt.us/?p=157#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:20:15 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=157</guid>
		<description><![CDATA[(previous) Now the final, most involved part of the process: Configuring the dialplan. We&#8217;ll take this bit by bit, but if you&#8217;re not sure about what a particular line does, check out the Wiki at Voip-Info.org. Dialplan Basics First we&#8217;ll &#8230; <a href="http://kenny.barnt.us/?p=157">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://kenny.barnt.us/?p=154">(previous)</a></p>
<p>Now the final, most involved part of the process: Configuring the dialplan. We&#8217;ll take this bit by bit, but if you&#8217;re not sure about what a particular line does, check out the Wiki at <a href="http://voip-info.org">Voip-Info.org</a>.</p>
<p><strong>Dialplan Basics</strong><br />
First we&#8217;ll get the basics of our dialplan configuration in place.</p>
<ol>
<li>Create <code>/etc/asterisk/extensions.conf</code> with your favorite text editor.</li>
<li>Add the following block to the new extensions file<br />
<code class="block">[general]</p>
<p>[globals]<br />
 </code><br />
This gives us some general structure for the extensions configuration.</li>
<li>Next, we will add a subroutine for handling calls to internal extensions. This will simplify the dialplan later on.<br />
<code class="block">[internal-call]<br />
exten => s,1,Verbose(====> Processing Internal Call)<br />
exten => s,n,Set(DIALEXT=${ARG1})<br />
exten => s,n,Verbose(====> Call is from ${CALLERID(all)} to ${DIALEXT})<br />
exten => s,n,Dial(SIP/${DIALEXT},15,tT)<br />
exten => s,n,GotoIf($["${SIPPEER(${DIALEXT},status)}" = ""]?badext:vmsw)<br />
exten => s,n(vmsw),GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)<br />
exten => s,n(unavail),Verbose(====> Extension ${DIALEXT} is unavailable)<br />
exten => s,n,Voicemail(${ARG1}@default,u)<br />
exten => s,n,Hangup()<br />
exten => s,n(busy),Verbose(====> Extension ${DIALEXT} is busy)<br />
exten => s,n,Voicemail(${ARG1}@default,b)<br />
exten => s,n,Hangup()<br />
exten => s,n(badext),Verbose(====> Extension dialed does not go to a valid SIP channel)<br />
exten => s,n,Playback(pbx-invalid)<br />
exten => s,n,Hangup()<br />
exten => s,n,Return</p>
<p>exten => h,1,Verbose(====> Ending Internal Call Processing - call was hung up)<br />
exten => h,n,Return</code><br />
This subroutine take an extension as an argument and dials it. If the extension doesn&#8217;t exist, an error message is played. If the extension is busy or unavailable, the call is transferred to Voicemail, which plays the appropriate greeting. s and h are special extensions in Asterisk. s acts as a placeholder for calls entering the context, while h defines actions that should be taken when a call in the context is hung up.</li>
<li>Now we&#8217;ll add a subroutine to handle making the outgoing calls using Google Voice<br />
<code class="block">[gv-out]<br />
exten => s,1,Verbose(====> Exexution passed to Google Voice Handler)<br />
exten => s,n,Set(CALLING=${ARG1})<br />
exten => s,n,Set(GVUID=googlevoiceusername)<br />
exten => s,n,Set(GVPASS=googlevoicepassword)<br />
exten => s,n,Set(SGNUM=5555550000)<br />
exten => s,n,Set(PARKEXT=7100)<br />
exten => s,n,Playback(pls-wait-connect-call)<br />
exten => s,n,Set(PARKINGEXTEN=${PARKEXT})<br />
exten => s,n,Park()</p>
<p>exten => h,1,Verbose(====> Call Parked - Initiating Google Voice Call)<br />
exten => h,n,System(gvoice -e ${GVUID} -p ${GVPASS} call ${CALLING} ${SGNUM})<br />
exten => h,n,Verbose(====> GV Call initated)</code><br />
This subroutine takes a single argument: the 11-digit number to call out to. You&#8217;ll need to change <code>GVUID</code>, <code>GVPASS</code>, and <code>SGNUM</code> to be your Google Voice username, Google Voice password, and sipgate phone number.</li>
<li>Now we&#8217;ll add the <code>[incoming]</code> context. This is where all calls coming in from sipgate end up.<br />
<code class="block">[incoming]<br />
exten => 9999999e1,1,Verbose(====> Processing incoming sipgate call from ${CALLERID(num)})<br />
exten => 9999999e1,n,Set(GVCID=5555555555)<br />
exten => 9999999e1,n,Set(RINGEXT=1000)<br />
exten => 9999999e1,n,Set(PARKEXT=7100)<br />
exten => 9999999e1,n,GotoIf($[${CALLERID(num)}=${GVCID}]?gvringback:incoming)<br />
exten => 9999999e1,n(gvringback),Verbose(====> Call is a Google Voice Ringback)<br />
exten => 9999999e1,n,Answer()<br />
exten => 9999999e1,n,ParkedCall(${PARKEXT})<br />
exten => 9999999e1,n,Verbose(====> Ringback Connected)<br />
exten => 9999999e1,n,Return<br />
exten => 9999999e1,n(incoming),Verbose(====> Call is a regular incoming call)<br />
exten => 9999999e1,n,Gosub(internal-call,s,1(${RINGEXT}))<br />
exten => 9999999e1,n,Verbose(====> Execution returned to incoming)<br />
exten => 9999999e1,n,Return</p>
<p>exten => h,1,Verbose(====> End processing incoming sipgate call - call was hung up)<br />
exten => h,n,Return</code><br />
You&#8217;ll need to change <code>9999999e1</code> to your sipgate SIP-ID and <code>GVCID</code> to your 10-digit Google Voice number</li>
<li>Finally, we&#8217;ll add the [internal] extension, where calls from any of our phones end up.<br />
<code class="block">[internal]<br />
; Internal Calls<br />
exten => _100[1-8],1,Verbose(====> Internal call)<br />
exten => _100[1-8],n,GoSub(internal-call,s,1(${EXTEN})<br />
exten => _100[1-8],n,Verbose(====> End internal call)</p>
<p>exten => 1009,1,Verbose(====> Dialing voicemail)<br />
exten => 1009,n,VoiceMailMain(@default)<br />
exten => 1009,n,Verbose(====> End dialing voicemail)</p>
<p>exten => 1010,1,Verbose(====> Speed dial 15555557777)<br />
exten => 1010,n,GoSub(gv-out,s,1(15555557777))<br />
exten => 1010,n,Verbose(====> End speed dial 15555557777)</p>
<p>exten => 3000,1,Verbose(====> Play a test message)<br />
exten => 3000,n,Playback(tt-weasels)<br />
exten => 3000,n,Verbose(====> End playing test message)</p>
<p>exten => 911,1,Verbose(====> 911 call)<br />
exten => 911,n,Playback(no-911-1)<br />
exten => 911,n,Hangup()<br />
exten => 911,n,Verbose(====> End 911 call)</p>
<p>; Outbound Calls<br />
exten => _1NXXNXXXXXX,1,Verbose(====> 11-digit outbound call to ${EXTEN})<br />
exten => _1NXXNXXXXXX,n,GoSub(gv-out,s,1(${EXTEN}))<br />
exten => _1NXXNXXXXXX,n,Verbose(====> End 11-digit outbound call to ${EXTEN})</p>
<p>exten => _NXXNXXXXXX,1,Verbose(====> 10-digit outbound call to ${EXTEN})<br />
exten => _NXXNXXXXXX,n,GoSub(gv-out,s,1(1${EXTEN}))<br />
exten => _NXXNXXXXXX,n,Verbose(====> End 10-digit outbound call to ${EXTEN})</p>
<p>exten => _NXXXXXX,1,Verbose(====> 7-digit outbound call to ${EXTEN})<br />
exten => _NXXXXXX,n,Set(AREACODE=555)<br />
exten => _NXXXXXX,n,GoSub(gv-out,s,1(1${AREACODE}${EXTEN}))<br />
exten => _NXXXXXX,n,Verbose(====> End 7-digit outbound call to ${EXTEN})</code><br />
This is the real meat of the dialplan. You&#8217;ll want to change <code>AREACODE</code> to whatever area code you want to use for 7-digit dialing, as well as the number for the speed dial on extension 1010. As you can see, combining pattern matching with naming the SIP channels to match their associated extension number reduces the number of entries required in the dialplan. It also allows us to add more phones by just configuring sip.conf and voicemail.conf, with no changes to the dialplan.</li>
<li>Now, reload the dialplan from the Asterisk CLI<br />
<code class="block">asterisk*CLI> dialplan reload</code></li>
</ol>
<p>Now that we&#8217;ve configured the dialplan, all that&#8217;s left to do is test&#8230; <a href="http://kenny.barnt.us/?p=160">(continue)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=157</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Roll Your Own: Part 3 &#8211; Asterisk Configuration</title>
		<link>http://kenny.barnt.us/?p=136</link>
		<comments>http://kenny.barnt.us/?p=136#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:19:51 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=136</guid>
		<description><![CDATA[(previous) With Asterisk installed and sipgate and Google Voice configured, it&#8217;s time for the meat and potatoes of this whole thing: configuring Asterisk. safe_asterisk Before we get into the configuration, though, we need to make a quick security change. We&#8217;ll &#8230; <a href="http://kenny.barnt.us/?p=136">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://kenny.barnt.us/?p=126">(previous)</a></p>
<p>With Asterisk installed and sipgate and Google Voice configured, it&#8217;s time for the meat and potatoes of this whole thing: configuring Asterisk.</p>
<p><strong>safe_asterisk</strong><br />
Before we get into the configuration, though, we need to make a quick security change. We&#8217;ll be using <code>safe_asterisk</code> to start asterisk as a daemon, because it will automatically restart Asterisk in case it crashes for some reason. The safe_asterisk script, however, has a fairly serious security flaw out of the box, and we need to patch it.</p>
<ol>
<li>Open <code>/usr/sbin/safe_asterisk</code> in your favorite text editor and comment out the <code>TTY=9</code> line.<br />
<code class="block"># vim /usr/sbin/safe_asterisk</code>&#8230;<br />
<code class="block">#!/bin/sh<br />
# vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent<br />
CLIARGS="$*"    # Grab any args passed to safe_asterisk<br />
TTY=9               # TTY (if you want one) for Asterisk to run on</code><em>&#8230;becomes&#8230;</em><br />
<code class="block">#!/bin/sh<br />
# vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent<br />
CLIARGS="$*"    # Grab any args passed to safe_asterisk<br />
#TTY=9             # TTY (if you want one) for Asterisk to run on</code></li>
<li>Start Asterisk with safe_asterisk<br />
<code class="block"># safe_asterisk</code></li>
</ol>
<p><strong>Asterisk Configuration</strong><br />
Now that Asterisk is running, we need to get everything configured for our calls to work. If you&#8217;re not familiar with Asterisk Configuration, you may want to check out the wiki at <a href="http://voip-info.org">Voip-Info.org</a> (search for the file you&#8217;re working on) or the <a href="http://www.asteriskdocs.org/">Asterisk Documentation Project</a> for some good references.</p>
<ol>
<li>Before we begin our configurations, we&#8217;ll make backup copies of the samples of the configuration files we&#8217;ll change<br />
<code class="block"># cd /etc/asterisk<br />
# mv extensions.conf extensions.sample<br />
# mv sip.conf sip.sample<br />
# mv voicemail.conf voicemail.sample<br />
# mv features.conf features.sample</code></li>
<li>We also need to a little bit of planning at this point. You&#8217;ll need to decide how you want to setup your dialplan. In this example, we&#8217;re going to use four digit internal extension numbers, with the names of SIP peers set to their extension numbers. You&#8217;re free to change this to suit your needs or wants, and I&#8217;ll try and point out all the things you will need to change from these examples.</li>
</ol>
<p><strong>SIP Configuration</strong><br />
The first thing we&#8217;ll configure is our SIP settings. We&#8217;ll need to configure Asterisk to connect to sipgate, and also configure Asterisk to accept connections from a phone. In this and any other examples 9999999e1 is your sipgate SIP-ID and AAAA1A is your sipgate SIP-Password.</p>
<ol>
<li>Create the file <code>/etc/asterisk/sip.conf</code> in the text editor of your choice.</li>
<li>Add this to the beginning of the new file:<br />
<code class="block">[general]<br />
register => 9999999e1:AAAA1A@sipgate.com/9999999e1</code><br />
The <code>[general]</code> section of sip.conf is where configuration options that apply to all SIP peers are set. It is also where register statements are placed. Register statements allow Asterisk to connect as a client to other SIP servers. We connect to sipgate with a register statement so that calls coming into our sipgate number come to Asterisk.</li>
<li>Add this block below the previous one:<br />
<code class="block">[sipgate]<br />
type=peer<br />
host=sipgate.com<br />
outboundproxy=proxy.live.sipgate.com<br />
insecure=invite<br />
qualify=yes<br />
dtmfmode=rfc2833<br />
username=9999999e1<br />
defaultuser=9999999e1<br />
fromuser=9999999e1<br />
fromdomain=sipgate.com<br />
secret=AAAA1A<br />
context=incoming<br />
disallow=all<br />
allow=ulaw</code><br />
This <code>[sipgate]</code> section of sip.conf configures the options to use for the sipgate connection. These options are all specified by sipgate.</li>
<li>Add this last block below the <code>[sipgate]</code> section:<br />
<code class="block">[1000]<br />
type=friend<br />
host=dynamic<br />
nat=yes<br />
qualify=yes<br />
context=internal<br />
defaultuser=1000<br />
secret=1000<br />
callerid="Your Name" &lt;1000><br />
mailbox=1000</code><br />
This section defines the configuration for our SIP phone to connect to Asterisk at extension 1000.</li>
<li>Save the file as <code>/etc/asterisk/sip.conf</code> . Now, connect to the running Asterisk daemon to get to the Asterisk CLI<br />
<code class="block"># asterisk -rvvv</code></li>
<li>At the Asterisk command prompt, reload the SIP configuration. Most configuration changes in Asterisk don&#8217;t require restarting Asterisk, but simply reloading the configuration files that have been changed.<br />
<code class="block">asterisk*CLI> sip reload<br />
 Reloading SIP<br />
  == Parsing '/etc/asterisk/sip.conf':   == Found<br />
  == Parsing '/etc/asterisk/sip_notify.conf':   == Found<br />
asterisk*CLI> </code></li>
<li>Now we&#8217;ll setup our SIP phone to connect to Asterisk. Use <code>1000</code> in place of your sipgate SIP-ID and SIP-Password, and the hostname or IP of your server in place of sipgate.com in the phone&#8217;s configuration.</li>
<li>Let&#8217;s make sure our SIP configuration is working properly.<br />
<code class="block">asterisk*CLI> sip show registry<br />
Host              dnsmgr   Username   Refresh  State       Reg.Time<br />
sipgate.com:5060  N        1207176e0  105      Registered  Tue, 20 Apr 2010 19:16:08<br />
1 SIP registrations.<br />
asterisk*CLI> sip show peers<br />
Name/username            Host          Dyn Nat ACL Port     Status<br />
1000/1000                10.13.10.85   D   N       5060     OK (50 ms)<br />
sipgate-kenny/9999999e1  172.16.17.10              5060     OK (45 ms)<br />
2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline]<br />
asterisk*CLI></code><br />
If you don&#8217;t have 1 registration and 2 peers showing up, there&#8217;s something amiss, and you&#8217;ll need to look into it.</li>
</ol>
<p>Next we&#8217;ll configure voicemail.conf and features.conf&#8230; <a href="http://kenny.barnt.us/?p=154">(continue)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=136</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roll Your Own: Asterisk + Google Voice = Free Calling</title>
		<link>http://kenny.barnt.us/?p=102</link>
		<comments>http://kenny.barnt.us/?p=102#comments</comments>
		<pubDate>Wed, 21 Apr 2010 03:01:44 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=102</guid>
		<description><![CDATA[In an earlier post I promised a how-to for how I used Asterisk and Google Voice to get a Home Phone, so here goes&#8230; First of all, if you&#8217;re not much of the command-line tinkering type, and you have an &#8230; <a href="http://kenny.barnt.us/?p=102">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In an earlier <a href="http://kenny.barnt.us/?p=97">post</a> I promised a how-to for how I used Asterisk and Google Voice to get a Home Phone, so here goes&#8230;</p>
<p>First of all, if you&#8217;re not much of the command-line tinkering type, and you have an internet-accessable box you can start from scratch with, you really might want to check out the <a href="http://nerdvittles.com/?p=677">Nerd Vittles solution</a> that inspired and guided me in rolling my own.</p>
<p>If you&#8217;re not a tinkerer, but you don&#8217;t have a start-from-scratch box available, you can probably get away with following along through the installation of Asterisk here, and then pop <a href="http://freepbx.org">FreePBX</a> on to your Asterisk install to get a nice GUI for doing your configuration. I&#8217;ve personally never used FreePBX, so I can&#8217;t speak to how easy it would make things, etc.</p>
<p>If you&#8217;re still reading, we need to make sure you have a few things before we go forward.</p>
<p><strong>Prerequisites</strong></p>
<ul>
<li>Root-access to an Internet-Accessable *nix box<sup>*1,2</sup></li>
<li>A free <a href="http://www.sipgate.com/one">sipgate one</a> account</li>
<li>A free <a href="http://voice.google.com">Google Voice</a> account</li>
<li>A SIP Phone of some sort. (More on this later, but know free software phones are available for any OS you might be using)</li>
</ul>
<p><small>1 &#8211; Concerning Internet-Accessability: Your best bet is a box with a public IP (i.e. no NAT). SIP and NAT don&#8217;t play well at all, so it&#8217;s best to just avoid the mess as much as possible. There are work-arounds, but nothing that&#8217;s really great.<br />
2 &#8211; Concerning *nix flavours: This how-to is written from my experiences using Gentoo Linux. I&#8217;ve also run Asterisk on Ubuntu and Debian, and many people run it on CentOS. It can also run on Mac OS X, but will require the Developer Tools, and probably some packages not included with OS X by default.</small></p>
<p>Now that we know what we need to get going, here&#8217;s a quick overview of what we&#8217;re going to do:</p>
<ol>
<li>Install Asterisk and other tools</li>
<li>Configure sipgate and Google Voice</li>
<li>Configure Asterisk for Google Voice calling</li>
<li>Verify</li>
</ol>
<p>Let&#8217;s get started&#8230; <a href="http://kenny.barnt.us/?p=108">(continue)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=102</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Roll Your Own: Part 1 &#8211; Installation</title>
		<link>http://kenny.barnt.us/?p=108</link>
		<comments>http://kenny.barnt.us/?p=108#comments</comments>
		<pubDate>Wed, 21 Apr 2010 03:01:23 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=108</guid>
		<description><![CDATA[(previous) Alright, first thing&#8217;s first, we need to download and install Asterisk and PyGoogleVoice. Installing Asterisk First, we need to download the Asterisk source files. I&#8217;m using Asterisk 1.6.2.6, which is the latest stable version as of this writing. You &#8230; <a href="http://kenny.barnt.us/?p=108">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://kenny.barnt.us/?p=102">(previous)</a></p>
<p>Alright, first thing&#8217;s first, we need to download and install Asterisk and <a href="http://code.google.com/p/pygooglevoice/">PyGoogleVoice</a>.</p>
<p><strong>Installing Asterisk</strong><br />
First, we need to download the Asterisk source files. I&#8217;m using Asterisk 1.6.2.6, which is the latest stable version as of this writing. You can choose to go with another 1.6 branch, or the 1.4 branch, but things may now work out as well as you&#8217;d like.</p>
<ol>
<li>Log into your Linux Box as root (or get root privileges with sudo) and download the Asterisk source tarball<br />
<code class="block"># wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.6.tar.gz</code></li>
<li>Extract the Asterisk source files (in this case we&#8217;re extracting to <code>/usr/src/</code>, feel free to change to your liking.)<br />
<code class="block"># tar -xzf asterisk-1.6.2.6.tar.gx -C /usr/src</code></li>
<li>Run <code>./configure</code> and resolve any dependency issues that come up.<br />
<code class="block"># cd /usr/src/asterisk-1.6.2.6<br />
# ./configure</code></li>
<li>Run <code>make menuselect</code> and select the options you want.<br />
<code class="block"># make menuselect</code><br />
I&#8217;d highly recommend setting the <code>DONT_OPTIMIZE</code> option from the <code>Compiler Flags</code> menu, as this will allow you to get a useful backtrace if you need to do any serious debugging.<br />
I&#8217;d also select the <code>ULAW</code>, <code>ALAW</code>, and <code>GSM</code> sound packages for your language from both the <code>Core Sound Packages</code> and<code> Extras Sound Packages</code> menus. This will prevent most transcoding you&#8217;ll run into with clients using different audio codes. You should pick the Core and Extra sound packages for at least one codec.
</li>
<li>Once you&#8217;ve saved your options from <code>make menuselect</code>, run <code>make</code>, and then <code>make install</code><br />
<code class="block"># make<br />
# make install</code></li>
<li>Finally, install the sample configuration files for Asterisk by running <code>make samples</code><br />
<code class="block"># make samples</code></li>
</ol>
<p><strong>Installing PyGogleVoice</strong><br />
Now we&#8217;ll install PyGoogleVoice. This is a Python API and command-line utility for accessing the Google Voice API.</p>
<ol>
<li>Make sure you have Python 2.3 or newer. You should also have the Python <code>easy_install</code> utility available (part of the Python setuptools package). If you&#8217;re using Python &lt;2.6, you&#8217;ll also need the simplejson package.<br />
<code class="block"># easy_install simplejson</code></li>
<li>Once you&#8217;ve verified you&#8217;ve got everything you need for PyGoogleVoice, install it<br />
<code class="block"># easy_install -U pygooglevoice</code></li>
</ol>
<p><strong>Quick Test</strong><br />
Before we move on, let&#8217;s make sure we&#8217;ve got Asterisk installed properly.</p>
<ol>
<li>We&#8217;ll start asterisk in the foreground (rather than as a daemon) and make sure there are no errors.<br />
<code class="block"># asterisk -cvvv</code></li>
<li>This will start Asterisk with a Verbosity level of 3 and should bring you to the Asterisk CLI prompt:<br />
<code class="block">hostname*CLI> </code></li>
<li>f you&#8217;re seeing that, and you don&#8217;t see any errors as  you scroll back through the asterisk messages, go ahead and stop Asterisk for now:<br />
<code class="block">hostname*CLI> core stop now</code></li>
</ol>
<p>Next we&#8217;ll get things configured with your sipgate and Google Voice Accounts&#8230; <a href="http://kenny.barnt.us/?p=126">(continue)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=108</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roll Your Own: Part 2 &#8211; sipgate/Google Voice Configuration</title>
		<link>http://kenny.barnt.us/?p=126</link>
		<comments>http://kenny.barnt.us/?p=126#comments</comments>
		<pubDate>Wed, 21 Apr 2010 03:00:45 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=126</guid>
		<description><![CDATA[(previous) Now that we&#8217;ve got Asterisk installed, we need to get your sipgate one and Google Voice accounts configured for our setup. SIP Phone The first thing you&#8217;ll need is a SIP phone. You can get either a hardware phone &#8230; <a href="http://kenny.barnt.us/?p=126">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://kenny.barnt.us/?p=108">(previous)</a></p>
<p>Now that we&#8217;ve got Asterisk installed, we need to get your sipgate one and Google Voice accounts configured for our setup.</p>
<p><strong>SIP Phone</strong><br />
The first thing you&#8217;ll need is a SIP phone. You can get either a hardware phone (hard phone) like the <a href="http://www.polycom.com/products/voice/desktop_solutions/soundpoint/desk_phones/soundpoint_ip321_331.html">Polycom SoundPoint IP 321</a>, or a software phone (softphone) like <a href="http://code.google.com/p/telephone/">Telephone</a> for Mac OS X. It will probably be easiest to work with a softphone for now. If you need some help finding one take a look at <a href="http://www.voip-info.org/wiki/view/VOIP+Phones#SoftPhones">this list</a> at Voip-Info.org, or <a href="http://en.wikipedia.org/wiki/Comparison_of_VoIP_software#General_softphone_clients">this list</a> at Wikipedia. Whichever phone you choose, be sure it supports SIP.</p>
<p><strong>Configuring sipgate</strong><br />
Now that you&#8217;ve got a SIP phone, we&#8217;ll get it setup to connect to sipgate. Later your phones will connect through your Asterisk PBX, but for now we need a phone directly connected to sipgate.</p>
<ol>
<li>Login to your sipgate account at <a href="http://sipgate.com">http://sipgate.com</a> and click the settings button. You should see something like this:<br />
<a href="http://kenny.barnt.us/wp-content/uploads/2010/04/sipgate-settings.jpg"><img src="http://kenny.barnt.us/wp-content/uploads/2010/04/sipgate-settings-300x223.jpg" alt="sipgate settings screen" title="sipgate-settings" width="300" height="223" class="alignnone size-medium wp-image-127" /></a></li>
<li>Click on the SIP Credentials link on the left. You&#8217;ll see a new box like this:<br />
<a href="http://kenny.barnt.us/wp-content/uploads/2010/04/sipgate-creds.jpg"><img src="http://kenny.barnt.us/wp-content/uploads/2010/04/sipgate-creds-260x300.jpg" alt="sipgate credentials box" title="sipgate-creds" width="260" height="300" class="alignnone size-medium wp-image-131" /></a><br />
Where your SIP-ID is something like 9999999e1 (your account # followed by e1) and your SIP-Password is something like AAAA1A</li>
<li>Use these settings to configure your SIP phone. You may want to look at this sipgate <a href="http://www.sipgate.com/faq/article/397/How_do_I_set_up_my_VoIP_device">FAQ entry</a> for some more info.</li>
<li>Once you&#8217;ve configured your SIP phone, and it is successfully registering to sipgate, call your sipgate Phone Number to verify your SIP phone rings.</li>
</ol>
<p><strong>Configuring Google Voice</strong><br />
Now we need to configure Google Voice to work properly with our Asterisk setup.</p>
<ol>
<li>Log in to <a href="http://voice.google.com">Google Voice</a> and go to Settings > Calls. You need to make sure Call Screening and Presentation are turned off and Caller ID (in) is set to Display caller&#8217;s number. Your Calls settings should look like this:<br />
<a href="http://kenny.barnt.us/wp-content/uploads/2010/04/gv-settings.jpg"><img src="http://kenny.barnt.us/wp-content/uploads/2010/04/gv-settings-300x260.jpg" alt="Google Voice calls settings" title="gv-settings" width="300" height="260" class="alignnone size-medium wp-image-132" /></a></li>
<li>Go to Phones in the Google Voice settings and click Add another phone. Enter a Name like sipgate, enter your sipgate phone number, and select Home as the Phone Type. When you click Save, Google Voice will take you through the steps to verify the phone number you entered.</li>
<li>Once your sipgate number is verified, give you Google Voice number a call. Your SIP phone should now be ringing.</li>
</ol>
<p>Be sure to do a reality check on your Google Voice forwarding settings. If you&#8217;re using this setup to give yourself a Home phone that multiple people would answer, you&#8217;ll likely want to be sure that it only forwards to your sipgate number, but there may be situations where you want forwarding to stay on for other phones.</p>
<p>Now we get to the fun part: Configuring Asterisk&#8230; <a href="http://kenny.barnt.us/?p=136">(continue)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=126</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roll Your Own: Part 3.1 &#8211; Asterisk Configuration Continued</title>
		<link>http://kenny.barnt.us/?p=154</link>
		<comments>http://kenny.barnt.us/?p=154#comments</comments>
		<pubDate>Wed, 21 Apr 2010 02:59:39 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=154</guid>
		<description><![CDATA[(previous) Now that we&#8217;ve got SIP configured in Asterisk, there are two more things we need to configure before we get to the dial plan: Voicemail (voicemail.conf) and Call Parking (features.conf) voicemail.conf Asterisk&#8217;s built-in voicemail system is quite possibly the &#8230; <a href="http://kenny.barnt.us/?p=154">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://kenny.barnt.us/?p=136">(previous)</a></p>
<p>Now that we&#8217;ve got SIP configured in Asterisk, there are two more things we need to configure before we get to the dial plan: Voicemail (voicemail.conf) and Call Parking (features.conf)</p>
<p><strong>voicemail.conf</strong><br />
Asterisk&#8217;s built-in voicemail system is quite possibly the easiest piece of this puzzle for us to configure.</p>
<ol>
<li>Create <code>/etc/asterisk/voicemail.conf</code> in the text editor of your choice.</li>
<li>Add the following block to the new file:<br />
<code class="block">[general]</p>
<p>[default]<br />
1000 => 1234,Your Name</code><br />
This creates voicemail box 1000 in the default context with a PIN of 1234. The name set here can be used for the dial-by-name directory functionality available in Asterisk.</li>
<li>Reload the voicemail configuration from the Asterisk CLI<br />
<code class="block">asterisk*CLI> voicemail reload</code><br />
That&#8217;s it. All there is to it.</li>
</ol>
<p><strong>features.conf</strong><br />
Call parking is a means of putting calls on hold so they can be transferred to other extensions. We&#8217;re going to use call parking to help us make outgoing calls with Google Voice, but first we need to setup our &#8220;Parking Lot&#8221;.</p>
<ol>
<li>Create <code>/etc/asterisk/features.conf</code> in the text editor of your choice.</li>
<li>Add the following block to the new file:<br />
<code class="block">[general]<br />
parkext => 7000<br />
parkpos => 7001-7100<br />
context => parkedcalls<br />
findslot => first</code><br />
This sets up a parking lot over extensions 7001 through 7100, putting them into the <code>parkedcalls</code> context.</li>
<li>Reload the features configuration from the Asterisk CLI<br />
<code class="block">asterisk*CLI> features reload</code></li>
</ol>
<p><strong>Dialplan Planning</strong><br />
Before we go ahead with configuring our dialplan, we need to decide exactly what we will do in the dialplan.</p>
<ul>
<li>Dialing 1000-1008 connects to an internal phone</li>
<li>Dialing 1009 connects to voicemail</li>
<li>Dialing 1010-1019 performs a special action, like a speed dial</li>
<li>Dialing 3000-3010 performs a test action</li>
<li>Dialing 911 plays an error message</li>
<li>Dialing a 7-digit telephone number makes an outbound call, using a pre-defined area code</li>
<li>Dialing a 10- or 11-digit telephone number makes an outbound call</li>
</ul>
<p><strong>Outbound Calling</strong><br />
You&#8217;re probably still wondering how we are going to be able to make outbound calls when our sipgate account only gives us free incoming calls. The solution is to turn an outbound call into an incoming call, at least as far as sipgate sees things. When you make an outbound call, this is what really happens:</p>
<ol>
<li>Asterisk recognizes that a 7-, 10-, or 11-digit number has been dialed and starts processing it as an external call.</li>
<li>The call is parked on a designated extension.</li>
<li>PyGoogleVoice is used to originate a Google Voice call to the dialed number</li>
<li>Google Voice sets up the call and connects it to our sipgate phone number</li>
<li>Asterisk sees that the incoming call is a ringback from Google Voice and connects the incoming call to the previously parked call</li>
</ol>
<p>Now we&#8217;ll go ahead and configure our dialplan&#8230; <a href="http://kenny.barnt.us/?p=157">(continue)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=154</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I Got a Home Phone</title>
		<link>http://kenny.barnt.us/?p=97</link>
		<comments>http://kenny.barnt.us/?p=97#comments</comments>
		<pubDate>Tue, 20 Apr 2010 15:45:27 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[Computers and other Gadgety-Type Things]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=97</guid>
		<description><![CDATA[I&#8217;m currently finishing up SAT4240 &#8211; VoIP Engineering as part of the Computer Network and System Administration program at Michigan Tech. This has probably been the most interesting course I&#8217;ve had so far in the program, and it&#8217;s made me &#8230; <a href="http://kenny.barnt.us/?p=97">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently finishing up SAT4240 &#8211; VoIP Engineering as part of the <a href="https://cnsa-web.tech.mtu.edu/drupal/">Computer Network and System Administration</a> program at <a href="http://mtu.edu">Michigan Tech</a>. This has probably been the most interesting course I&#8217;ve had so far in the program, and it&#8217;s made me seriously look at Voice Engineering as a career path when I graduate in December.</p>
<p>In our lab we use <a href="http://asterisk.org">Asterisk</a>, a free (as in beer), open-source PBX that runs on *nix systems. It&#8217;s highly configurable and customizable, but also very lightweight. In fact, as part of our course project &#8211; where my group and I created a simulated voice network for a nation-wide development company &#8211; we had Asterisk 1.4 running in <a href="http://openwrt.org/">OpenWRT</a> on a Linksys WRT54GL. Obviously, not every feature is available on such an embedded system, but simply by &#8220;outsourcing&#8221; the voicemail functions for that location to one of our other PBX&#8217;s, we were able to create a system with consistent functionality for all users. Pretty cool &#8216;eh?</p>
<p>The class also got me thinking about something I&#8217;ve wanted to work out for a while now: a home phone. Mostly I was looking for a way to get ahold of people at the house when they don&#8217;t have their cell phone handy &#8211; like me on a lazy Sunday, when my iPhone never leaves the nightstand. However, since I&#8217;d still be using my cell mostly, I didn&#8217;t want to go with a traditional landline or the VoIP offering from Charter because it wouldn&#8217;t be worth the cost. I wanted something that wouldn&#8217;t cost me anymore than I was already paying for internet service.<br />
<span id="more-97"></span><br />
That got me looking for ways to get asterisk to connect to the outside world for free. I was really disheartened when, at first, all I found in terms of free services were purely VoIP solutions, where any connection to the PSTN (the regular phone network), costing extra. A little more digging found a few providers like <a href="http://sipgate.com">sipgate</a>, who offer free DID (Direct Inward Dialing) service. That would give me a way to get incoming calls for free, but any outgoing calls would still cost.</p>
<p>Finally, a little more searching brought me across an <a href="http://nerdvittles.com/?p=635">article</a> from <a href="http://nerdvittles.com">Nerd Vittles</a> about tweaking Asterisk to use Google Voice to get free incoming and outgoing calls. <em>Awesome</em>, I thought, <em>this is how I&#8217;ll do it</em>. Unfortunately, that ended up not really being an option for me, at least, not as presented in that article or its successors. The Nerd Vittles solution is really tied into using <a href="http://pbxinaflash.net/">PBX in a Flash</a>, a complete Asterisk-based PBX system running on <a href="http://centos.org/">CentOS</a> and using the <a href="http://www.freepbx.org/">FreePBX</a>GUI to control Asterisk. This posed one really big problem for me: I didn&#8217;t have a box to run it on. I looked a little into the <a href="http://www.plugpbx.org/">PlugPBX</a> project, but I couldn&#8217;t justify the $100 for a <a href="http://www.plugcomputer.org/">SheevaPlug</a>. I&#8217;d also not heard great things about FreePBX from some friends and colleagues, so I was hesitant to go with any solution that required it.</p>
<p>I talked to my friend, Tommy, who happens to have an internet-accessable Linux box. I told him about my plan, and told him I was pretty sure I could make the free calls thing work for an arbitrary number of people, and he let me go ahead and run my Asterisk install on his box.</p>
<p>From there I got Asterisk up and running, then used the Nerd Vittles article as a general guide for what I needed to do going forward. After a few trials and tribulations, I finally got it working. I could call my Google Voice number, and the VoIP phone in my kitchen would ring. I could dial my cell phone from the VoIP phone, and voila, it rang. Then I dived into getting it to work for more than one person. A friend from Tech who is living in Dubai was nice enough to help me out so he could get/make calls from/to the US without paying out the nose. A few configuration changes, and a couple more hiccups, and we had it going. Then we added Tommy, and everything still ran great.</p>
<p>I&#8217;ll be posting a how-to as a roll-your-own alternative to the Nerd Vittles solution here very soon, so stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Full-time job? [UPDATED]</title>
		<link>http://kenny.barnt.us/?p=96</link>
		<comments>http://kenny.barnt.us/?p=96#comments</comments>
		<pubDate>Thu, 02 Oct 2008 12:45:44 +0000</pubDate>
		<dc:creator>Kenny</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://kenny.barnt.us/?p=96</guid>
		<description><![CDATA[Though it&#8217;s been discussed for a while now, I got an actual full-time job offer from Up and Running yesterday. I&#8217;m still really torn about what to do, but now I at least have numbers to look at. If you&#8217;d &#8230; <a href="http://kenny.barnt.us/?p=96">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Though it&#8217;s been discussed for a while now, I got an actual full-time job offer from Up and Running yesterday. I&#8217;m still really torn about what to do, but now I at least have numbers to look at. If you&#8217;d like to help in the pondering, let me know and I can fill you in on the details.</p>
<p><ins datetime="2008-10-09T12:43:37+00:00"><strong>[Update: 09-10-2008]</strong> I&#8217;ve officially declined the offer. In the end, I decided I&#8217;d be giving up more than I was willing to give up for what the offer was. Wasn&#8217;t a bad offer, but just not right for me at this point in time.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://kenny.barnt.us/?feed=rss2&amp;p=96</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
