<?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/"
	>

<channel>
	<title>Naked Imagination &#187; howto</title>
	<atom:link href="http://robsmart.co.uk/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://robsmart.co.uk</link>
	<description>Emerging technology, Virtual Worlds and Cultural Observations</description>
	<pubDate>Thu, 17 Dec 2009 15:27:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Home VOIP system using FreeSwitch and a Linksys 3102 voice gateway (UK Guide)</title>
		<link>http://robsmart.co.uk/2009/06/02/freeswitch_linksys3102/</link>
		<comments>http://robsmart.co.uk/2009/06/02/freeswitch_linksys3102/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 22:20:28 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[]]></category>

		<category><![CDATA[freeswitch]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[linksys spa3102]]></category>

		<category><![CDATA[telephony]]></category>

		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">http://robsmart.co.uk/?p=144</guid>
		<description><![CDATA[This is a basic HOWTO for setting up a home VOIP system using the excellent FreeSwitch telephony platform and a LinkSys SPA3102 voice gateway. (skip to the HOWTO section if you just want to get on with it)
First of all a quick introduction to FreeSwitch for those who haven&#8217;t come across it before&#8230;
(the following mercilessly [...]]]></description>
			<content:encoded><![CDATA[<p>This is a basic HOWTO for setting up a home VOIP system using the excellent <a title="FreeSwitch" href="http://wiki.freeswitch.org/wiki/Main_Page" target="_blank">FreeSwitch</a> telephony platform and a LinkSys SPA3102 voice gateway. (skip to the <strong>HOWTO </strong>section if you just want to get on with it)</p>
<p>First of all a quick introduction to FreeSwitch for those who haven&#8217;t come across it before&#8230;</p>
<p>(the following mercilessly wrenched from <a href="http://www.freeswitch.org/">freeswitch.org</a>)</p>
<blockquote><p><span>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch.  It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</span></p>
<p>We support various communication technologies such as Skype, SIP, H.323, IAX2 and GoogleTalk making it easy to interface with other open source PBX systems such as sipXecs, Call Weaver, Bayonne, YATE or Asterisk.</p></blockquote>
<p>Okay, so we&#8217;ve established what FreeSwitch does. The one thing it doesnt do is connect you to your BT telephone line, we need a piece of hardware for that. In this case the Cisco LinkSys SPA3102 which again according to the blurb on the Cisco site  &#8230;.</p>
<blockquote><p><span class="content">The SPA3102 Voice Gateway allows automatic routing of local calls from mobile phones and land lines to Voice over Internet Protocol (VoIP) service providers, and vice versa.</span></p></blockquote>
<p><strong><span class="content">Why would I want to run a home VOIP system?</span></strong></p>
<p><span class="content">Well for one as stated in the product blurb line above you can setup the voice gateway to use a VOIP service provider for making calls from your landlines, this is easy to do and will save you a bunch of cash especially if you regularly make long distance calls.</span></p>
<p><span class="content">I have other reasons though some important to me and others just hacks i want to play around with here&#8217;s a short list</span></p>
<p><span class="content">* When I&#8217;m working at home I want to be able to make and receive all my landline calls from the softphone I have running on my laptop </span><span class="content"> (I&#8217;m using X-Lite) </span><span class="content">, then i can use my headset which i find most comfortable especially when on long conference calls. Using a softphone on my laptop allows me more freedom to change volume levels which can vary a lot on international conference calls.</span></p>
<p><span class="content">* If I&#8217;m away from home and with internet access somewhere i want to still be able to answer my home phone.</span></p>
<p><span class="content">* I want control of the time of day our phone rings, my daughter Lucy gets put to bed at around 7pm and frequently wakes up when the phone rings in the evening.</span></p>
<p><span class="content">* I want control over who rings, with held numbers will go straight to voicemail hopefully cutting out the dreaded sales calls.</span></p>
<p><span class="content">* Most of the rest is covered by fun hacks i have in mind</span></p>
<p>ok discussion over.</p>
<h1><strong>HOWTO</strong></h1>
<p><em>(disclaimer this is a UK guide for BT landlines, plus if you break anything don&#8217;t blame me)</em><strong><br />
</strong></p>
<h2><span class="content"><strong>What you&#8217;ll need</strong></span></h2>
<p><span class="content">1. a Cisco Linksys SPA3102 (cost £50-£60)</span></p>
<p><span class="content">2. </span>An RJ11 socket to BT plug adaptor, Maplins code <a href="http://www.maplin.co.uk/module.aspx?moduleno=12494">AR34M<br />
</a></p>
<p>3. An RJ11 plug to BT master socket adaptor with ring capacitor,  Maplins code <a href="http://www.maplin.co.uk/module.aspx?moduleno=12492">VD36P</a></p>
<p>4. An ethernet cable</p>
<h2><strong>Install FreeSwitch</strong></h2>
<p>FreeSwitch needs to be installed on a machine on your home network. You can install it on pretty much any platform Windows,Linux, Mac etc.</p>
<p>Follow the <a href="http://wiki.freeswitch.org/wiki/Installation_Guide">install guide</a> on the FreeSwitch site.</p>
<p>When you have FreeSwitch installed start it up with the default configuration and use a softphone such as <a href="http://www.counterpath.com/x-lite.html&amp;active=4">X-lite</a> to check the install. In X-lites SIP Acount settings enter the IP address details for the server you installed FreeSwitch on. Use 1001 as the username and 1234 as the password (this is a default account that comes already set up with FreeSwitch), save these settings and X-Lite should register with FreeSwitch. Now dial 3000 on the X-Lite number pad and you should be connected to the default conference call number on your FreeSwitch server.</p>
<h2><strong>Setup the Linksys 3102 voice gateway</strong></h2>
<p>For this section I mostly refered to <a href="http://www.aoakley.com/articles/2008-01-08.php">Andrew Oakley&#8217;s excellent setup guide</a> in addition to the <a href="http://wiki.freeswitch.org/wiki/SPA3102_FreeSwitch_HowTo">FreeSwitch SPA3102 HOWTO</a> however I&#8217;m regurgitating bits from both here for the sake of completeness.</p>
<p>Firstly as with Andrews guide i&#8217;m assuming you already have a wireless broadband router.</p>
<p>Now get out the instructions that came with your SPA3102, put them in a drawer, do not look at them they are evil and will confuse you <em>(disclaimer - read the safety stuff in there first)</em></p>
<h2><strong>Hooking up all the cabley stuff</strong></h2>
<li> Do not connect the SPA3102 to the mains yet.</li>
<li> Unplug your phones/extension wiring from your BT master wall socket (the first BT wall socket where the telephone line first enters your house).</li>
<li> Connect your SPA3102&#8217;s LINE socket to your BT master wall socket, using either a known-good RJ11-BT cable (eg. an old modem cable) OR using the supplied RJ11-RJ11 cable plus an RJ11-BT adaptor (eg. Maplins code AR34M).</li>
<li> Plug the master socket adaptor (eg. Maplins code VD36P) into the SPA3102&#8217;s PHONE socket.</li>
<li> Plug your BT phone(s) into the master socket adaptor.</li>
<li> Check to make sure your SPA3102 is turned off (unplugged from the mains). When turned off, the SPA3102 connects the LINE to the PHONE socket directly, and we are going to test this connection.</li>
<li> Lift the phone handset. You should hear a dial tone. Try calling a telephone number. If this doesn&#8217;t work, your cabling is wrong.</li>
<li> Use a mobile phone to ring your normal home landline number. Your landline phone should ring as normal.If this is all working you can now plug in the power adaptor and turn on the router<strong></strong></li>
<h2><strong>Connecting the SPA3102 to your network</strong></h2>
<p><strong><br />
</strong></p>
<p>Connect an ethernet cable from your computer to the SPA3102&#8217;s ethernet socket.</p>
<p>In a browser go to 192.168.1.1 you should see the SPA3102&#8217;s web interface, if not check your computer is set to use DHCP to get its ip address.</p>
<p>In <em>Router - WAN Setup</em> change Connection Type to Static IP. Change the Static IP, Netmask, Gateway and Primary DNS to the correct values. For instance, on my networks all computers are 192.168.0.something and the broadband router is 192.168.0.1, so I use 192.168.0.7 as my Static IP, 255.255.255.0 as the netmask, 192.168.0.1 as both the gateway and primary DNS.</p>
<p>click on <em>advanced</em> then <em>WAN Setup</em> again. set  <em>Enable WAN Web Server</em> to YES.</p>
<p>Now <em>Submit All Changes.</em></p>
<p>Unplug the ethernet cable you used and reconnect your computer to your home network.</p>
<p>Use the ethernet cable to connect the SPA&#8217;s internet port up to a spare ethernet port on your home broadband router.</p>
<p>Now from your browser you should be able to connect to the SPA3102 admin panel by using the static IP address you set. In my case 192.168.0.7</p>
<p>in the SPA web interface <em>Click Admin login - Advanced - Voice - Regional</em> and make the following changes:</p>
<p style="padding-left: 30px;">Dial tone: 350@-19,440@-22;10(*/0/1+2)<br />
Ring back: 400@-20,450@-20;*(.4/.2/1+2,.4/2/1+2)<br />
Busy tone: 400@-20;10(.375/.375/1)<br />
Reorder tone: 400@-20;10(*/0/1)<br />
SIT 1 tone: 950@-16,1400@-16,1800@-16;20(.330/0/1,.330/0/2,.330/0/3,0/1/0)<br />
MWI dial tone: 350@-19,440@-22;10(.75/.75/1+2)<br />
CWT1 cadence: 30(.1/2)<br />
CWT2 cadence: 30(.25/.25,.25/.25,.25/5)<br />
CWT frequency: 400@-10<br />
Ring 1 cadence: 60(.4/.2,.4/2)<br />
Ring 2 cadence: 60(1/2)<br />
Ring 3 cadence: 60(.25/.25,.25/.25,.25/1.75)<br />
Ring 4 cadence: 60(.4/.8)<br />
Ring 5 cadence: 60(2/4)<br />
Time Zone: GMT<br />
FXS Port Impedance: 370+620||310nF<br />
Caller ID Method: ETSI FSK With PR(UK)<br />
Daylight Saving Rule: start=3/1/7/2:0:0;end=10/1/7/2:0:0;save=1:0:0</p>
<p>now go to <em>admin-&gt;advanced-&gt;Voice-&gt;PSTN</em> and set the following&#8230;</p>
<p style="padding-left: 30px;">Proxy and Registration</p>
<p style="padding-left: 30px;">Proxy: [FreeSwitch host name or IP]</p>
<p style="padding-left: 30px;">Subscriber Information</p>
<p style="padding-left: 30px;">Display Name: PSTN Line</p>
<p style="padding-left: 30px;">The FreeSwitch user ID</p>
<p style="padding-left: 30px;">User ID: 1000</p>
<p style="padding-left: 30px;">The FreeSwitch password for the user</p>
<p style="padding-left: 30px;">Password: 1234</p>
<p style="padding-left: 30px;">Dial Plans</p>
<p style="padding-left: 30px;">If you want a different extension than 1001 to be dialed change it here</p>
<p style="padding-left: 30px;">Dial Plan 1: (&lt;:1001&gt;S0)</p>
<p style="padding-left: 30px;">(xx.) basically means dial on the phone line of the SPA3102</p>
<p style="padding-left: 30px;">Dial Plan 2: (xx.)</p>
<p style="padding-left: 30px;">VoIP-To-PSTN Gateway Setup</p>
<p style="padding-left: 30px;">I want incoming VoIP requests to be dialed on the phone line aka: the (xx.) rule</p>
<p style="padding-left: 30px;">Line 1 VoIP Caller DP: 2</p>
<p style="padding-left: 30px;">VoIP Caller Default DP: 2</p>
<p style="padding-left: 30px;">FXO Timer Values (sec)</p>
<p style="padding-left: 30px;">I read some place to set this to 3 for caller ID to work, but I just wanted it to instantly forward and start ringing ext 1001</p>
<p style="padding-left: 30px;">PSTN Answer Delay: 0</p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;"><span class="labelft">PSTN-To-VoIP Gateway Setup</span></p>
<p style="padding-left: 30px;">set PSTN CID For VoIP CID to Yes so that caller-id is forwarded</p>
<p style="padding-left: 30px;">
<h2>FreeSwitch Configuration</h2>
<p>FreeSwitch on linux and Mac gets installed under /usr/local/freeswitch by default, im not sure where it goes on Windows so i&#8217;ll use $FREESWITCH_HOME for examples</p>
<p>Create a file called 00_spa3102.xml  in the directory $FREESWITCH_HOME/conf/dialplan/default/</p>
<p>The contents of this file are&#8230;</p>
<p style="padding-left: 30px;">&lt;include&gt;<br />
&lt;extension name=&#8221;To PSTN&#8221;&gt;<br />
&lt;condition field=&#8221;destination_number&#8221; expression=&#8221;(.*)&#8221;&gt;<br />
&lt;action application=&#8221;bridge&#8221; data=&#8221;sofia/internal/${destination_number}@<strong>[IP address of your SPA3102]</strong>:5061&#8243; /&gt;<br />
&lt;/condition&gt;<br />
&lt;/extension&gt;<br />
&lt;/include&gt;</p>
<p style="padding-left: 30px;">
<p>Edit the file $FREESWITCH_HOME/conf/directory/default/1000.xml</p>
<p>remove the following lines to ensure the caller id is passed through</p>
<p style="padding-left: 30px;">&lt;variable name=&#8221;effective_caller_id_name&#8221; value=&#8221;Extension 1001&#8243;/&gt;<br />
&lt;variable name=&#8221;effective_caller_id_number&#8221; value=&#8221;1001&#8243;/&gt;</p>
<p>Now you can start up FreeSwitch with $FREESWITCH_HOME/bin/freeswitch</p>
<h2>Testing</h2>
<p>You should have a softphone such as X-Lite configured with the user 1001 from when you tested your FreeSwitch install earlier.</p>
<p>To test everything is setup correctly dial your house phone from your mobile. The call should come through to X-Lite for you to answer.</p>
<p>Try using X-lite to dial your mobile too, this should also go through.</p>
<p><strong>Next steps</strong></p>
<p>When you have everything working your next steps depend on what you want to acheive. Most of the config you&#8217;ll need will involve changes to the FreeSwitch dialplan that we created above. A next easy step would be to add a voicemail service, there are examples of doing voice mail amongst many other things on the <a href="http://wiki.freeswitch.org/wiki/FreeSwitch_Dialplan_XML" target="_blank">FreeSwitch Dialplan wiki page</a></p>
<p><iframe src="http://rcm-uk.amazon.co.uk/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=zekibooks-21&#038;o=2&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=0M5A6TN3AXP2JHJBWT02&#038;asins=B000GB740W" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://robsmart.co.uk/2009/06/02/freeswitch_linksys3102/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
