<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Vivek&#039;s blog</title>
	<atom:link href="http://exain.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://exain.wordpress.com</link>
	<description>Howtos, tutorials and other updates</description>
	<lastBuildDate>Sat, 11 May 2013 09:10:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='exain.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Vivek&#039;s blog</title>
		<link>http://exain.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://exain.wordpress.com/osd.xml" title="Vivek&#039;s blog" />
	<atom:link rel='hub' href='http://exain.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Tracking your Route through GPS &#8211; Getting Started</title>
		<link>http://exain.wordpress.com/2013/02/24/tracking-your-route-through-gps-getting-started/</link>
		<comments>http://exain.wordpress.com/2013/02/24/tracking-your-route-through-gps-getting-started/#comments</comments>
		<pubDate>Sun, 24 Feb 2013 17:25:09 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[gpsbabel]]></category>
		<category><![CDATA[josm]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[my tracks]]></category>
		<category><![CDATA[open street maps]]></category>
		<category><![CDATA[osm]]></category>
		<category><![CDATA[routes]]></category>
		<category><![CDATA[sports tracker]]></category>
		<category><![CDATA[tracks]]></category>
		<category><![CDATA[viking]]></category>
		<category><![CDATA[waypoints]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=157</guid>
		<description><![CDATA[It was 14th February 2013, Valentine&#8217;s Day. Inspired by one Motorola commercial, I set out to walk in a &#8216;heart shaped&#8217; route, as a Valentine Gift for my beloved wife. The commercial is available at http://youtu.be/iG2DRiQt1b0 and the end result was tracked on Sports Tracker, with me walking in a heart shaped route near Lotus [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=157&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>It was 14th February 2013, Valentine&#8217;s Day. Inspired by one Motorola commercial, I set out to walk in a &#8216;heart shaped&#8217; route, as a Valentine Gift for my beloved wife. The commercial is available at <a title="Motorola Commercial - Heart Love Bicycle" href="http://youtu.be/iG2DRiQt1b0">http://youtu.be/iG2DRiQt1b0</a> and the end result was tracked on <a title="Sports Tracker Workout for Vivek Kapoor - marquivon" href="http://www.sports-tracker.com/#/workout/marquivon/5cifk2lsu8oumuoc">Sports Tracker</a>, with me walking in a heart shaped route near Lotus Temple, Delhi, India.</p>
<p><a href="http://exain.files.wordpress.com/2013/02/lotus-temple-india.png"><img class="size-full wp-image" id="i-174" alt="Image" src="http://exain.files.wordpress.com/2013/02/lotus-temple-india.png?w=710" width="490" height="280" /></a></p>
<p>I don&#8217;t have a good navigation sense, and rely mostly on GPS/Google Maps/Map My India for my everyday needs. Thus, to accomplish this task I&#8217;d specially bought a professional compass to track the directions, and had planned to cover at least 2 kilometers walking/running (though eventually it was restricted to 100 meters, reasons I&#8217;ll not delve into).</p>
<p>But, the biggest gain (apart from the delighted beloved, and learning how to use a compass) was that I came across various techniques that are used across the globe to track/plan a route. It&#8217;s more awesome than I ever imagined!</p>
<h1><span id="more-157"></span>The Basics &#8211; Routes, Waypoints &amp; Tracks</h1>
<p><strong>Routes</strong> &#8211; It is the pre-defined route that you are supposed to take. When you feed in a From &amp; To location on the maps, what you get is the route, which you can navigate to.</p>
<p><strong>Waypoints</strong> &#8211; These are the points of interest (POI) that you define. For example, a building, a school, a friend&#8217;s home. The POI are defined usually by the manufacturer of the maps, and waypoints are defined by you.</p>
<p><strong>Tracks</strong> &#8211; This is the trail that you&#8217;ve already followed. It&#8217;s in the past. If I follow a certain route, it becomes my Track.</p>
<h1>Start Tracking</h1>
<p>I had consistently used <a title="Sports Tracker" href="http://www.sports-tracker.com">Sports Tracker</a> to track my workouts, and had recently got a heart rate belt too to capture the Calories burnt more accurately. I tried to search for apps which were more focused on maps and tracking, and to my pleasant surprise, I found two more.</p>
<p>1. <a title="Sports Tracker on Play Store" href="https://play.google.com/store/apps/details?id=com.stt.android">Sports Tracker</a> &#8211; to track Calories burnt too</p>
<p><a href="http://exain.files.wordpress.com/2013/02/sports-tracker.jpg"><img class="alignnone size-full wp-image-198" alt="Sports Tracker" src="http://exain.files.wordpress.com/2013/02/sports-tracker.jpg?w=525"   /></a></p>
<p>2. <a title="Google My Tracks on Play Store" href="https://play.google.com/store/apps/details?id=com.google.android.maps.mytracks">Google My Tracks</a> &#8211; by Google itself</p>
<p><a href="http://exain.files.wordpress.com/2013/02/mytracks.jpg"><img class="alignnone size-full wp-image-199" alt="Google My Tracks" src="http://exain.files.wordpress.com/2013/02/mytracks.jpg?w=525"   /></a></p>
<p>3. <a title="Maverick Lite on Play Store" href="https://play.google.com/store/apps/details?id=com.codesector.maverick.lite">Maverick</a> &#8211; the PRO version has more functionality</p>
<p><a href="http://exain.files.wordpress.com/2013/02/maverick.jpg"><img class="alignnone size-full wp-image-197" alt="Maverick Lite" src="http://exain.files.wordpress.com/2013/02/maverick.jpg?w=525"   /></a></p>
<h1>Saving &amp; Modifying Tracks</h1>
<p>You can easily save your tracks in a format called GPX. For the technical folks, the GPX files are simple XML files which have the latitude, longitude, and based on the device used to capture this info, the date, time as well as altitude.</p>
<p>The editing of GPX can easily be done through softwares such as <a title="Viking GPS/GPX editing software" href="http://sourceforge.net/projects/viking/">Viking</a> and <a title="JOSM GPX Editor for Open Street Maps" href="http://josm.openstreetmap.de/">JOSM</a>. I tried Viking, and it worked really well, with the option to export the format back to GPX. JOSM is meant more for Open Street Maps (OSM), which is a collaborative free maps &#8211; an alternative to Google Maps.</p>
<p>On Linux, I can use <a title="GPSBabel - GPS data conversion and transfer" href="http://www.gpsbabel.org/">gpsbabel</a> to convert the gpx format to a variety of different formats, including KML format that Google Maps support by default.</p>
<h1>Creating Tracks, &amp; a Prototype</h1>
<p>The best way to create tracks is to travel yourself using one of the above applications. Once the track is created, you can export it to gpx or share it with other users.</p>
<p>Alternatively, there are a large number of web based applications available which allow you to create your own tracks and export them to Google or other mapping applications.</p>
<p>Using <a title="Google Maps API - for Developers" href="https://developers.google.com/maps/documentation/javascript/tutorial">Google Maps API</a>, I created a prototype of my own at <a href="http://exain.com/maps/">http://exain.com/maps/</a></p>
<p>This prototype allows you to</p>
<ul>
<li>Create a route by doing a left click and selecting points</li>
<li>Tell co-ordinates by right clicking on a location</li>
<li>Export the route&#8217;s latitude and longitude&#8217;s values</li>
</ul>
<p>As it is just a prototype, nothing fancy is available. However, the potential is there to broaden the approach. Maybe would do in the next version.</p>
<h1>Possibilities &amp; Potential Usage</h1>
<ul>
<li>When you visit a place and track it, you can confidently share that track with others. No more approximations and guesses on the amazing journey that you undertook. See it later in satellite view &amp; know where you really were.</li>
<li>Create a route before you start your journey including all the places you plan to visit. Even if you&#8217;re not driving by car, and the trail that you take is in the mountains.</li>
<li>In some countries, people share their cycling &amp; running tracks with others. Makes it convenient. <a title="Open Street Maps" href="http://www.openstreetmap.org/">Open Street Maps</a> are popular, and some are specialized ones too such as <a title="Open Cycle Map" href="http://exain.wordpress.com/2011/06/27/nokia-e6-symbian-anna-imap-with-push-mail/">OpenCycleMap.org</a></li>
</ul>
<p>In what ways do you think this could be leveraged?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=157&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2013/02/24/tracking-your-route-through-gps-getting-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2013/02/lotus-temple-india.png?w=710" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2013/02/sports-tracker.jpg" medium="image">
			<media:title type="html">Sports Tracker</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2013/02/mytracks.jpg" medium="image">
			<media:title type="html">Google My Tracks</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2013/02/maverick.jpg" medium="image">
			<media:title type="html">Maverick Lite</media:title>
		</media:content>
	</item>
		<item>
		<title>Quest for Ultimate 3G Wireless Internet setup at home &#8211; Delhi, India</title>
		<link>http://exain.wordpress.com/2012/12/19/quest-for-ultimate-3g-wireless-internet-setup-at-home-delhi-india/</link>
		<comments>http://exain.wordpress.com/2012/12/19/quest-for-ultimate-3g-wireless-internet-setup-at-home-delhi-india/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 10:48:59 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[173Bu-1]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[airtel]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[dir-456u]]></category>
		<category><![CDATA[dlink]]></category>
		<category><![CDATA[E1731]]></category>
		<category><![CDATA[huawei]]></category>
		<category><![CDATA[k3770-z]]></category>
		<category><![CDATA[micromax]]></category>
		<category><![CDATA[mmx400r]]></category>
		<category><![CDATA[mtnl]]></category>
		<category><![CDATA[photon+]]></category>
		<category><![CDATA[reliance]]></category>
		<category><![CDATA[rt-n66u]]></category>
		<category><![CDATA[tata]]></category>
		<category><![CDATA[vodafone]]></category>
		<category><![CDATA[zte]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=126</guid>
		<description><![CDATA[I had a deep desire to have a network setup at home which was wireless and flexible. I used to have 2 Wimax connections (Tata Wimax &#38; Reliance Wimax), and one ADSL (MTNL) running 24&#215;7. Unfortunately Tata Wimax shut down its services, and I disconnected Reliance Wimax connection. With the start of 3G services, I [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=126&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I had a deep desire to have a network setup at home which was wireless and flexible. I used to have 2 Wimax connections (Tata Wimax &amp; Reliance Wimax), and one ADSL (MTNL) running 24&#215;7. Unfortunately Tata Wimax shut down its services, and I disconnected Reliance Wimax connection. With the start of 3G services, I really wanted more flexibility and expected better uptime, and was ready to live with the disadvantages such as lack of Static IP, and significantly higher cost.</p>
<p>So, I set out to perform the longest duration and most expensive test I&#8217;ve ever done &#8211; 3 months and approximately Rs. 35000/- on equipment and prepaid recharges cost. The location was East Delhi, and duration was October 2012 to December 2012. The performance may change in future, so YMMV. The ingredients were</p>
<p><strong>Two 3G Routers</strong></p>
<ul>
<li><a href="#dlink-dir456u">DLink DIR-456U</a> (Rs. 6000)</li>
<li><a href="#micromax-mmx400r">Micromax MMX400R</a> (Rs. 3000)</li>
</ul>
<p><strong>Two 3G USB Dongles &amp; One 3G USB Supporting Router</strong></p>
<ul>
<li><a href="#zte-k3770-z">ZTE K3770-z USB Dongle</a> (Vodafone, Factory Unlocked) (Rs. 1400)</li>
<li><a href="#huawei-e1731">Huawei E1731 / 173Bu-1 USB Dongle</a> (Airtel Locked, later Unlocked) (Rs. 1600 + Rs. 300 for unlocking it via dc-unlocker.com)</li>
<li><a href="#asus-rt-n66u">Asus RT-N66U Dark Knight Wifi Router</a> with 3G USB Dongle Support (Rs. 14500)</li>
</ul>
<p>The DLink 456U I bought off from Ebay, and Micromax MMX400R, ZTE K3770-z, Huawei E1731, and ASUS RT-N66U from Nehru Place, Delhi.</p>
<p><strong>Four Service Providers</strong></p>
<ul>
<li><a href="#isp-airtel">Airtel</a></li>
<li><a href="#isp-mtnl">MTNL</a></li>
<li><a href="#isp-reliance">Reliance 3G</a></li>
<li><a href="#isp-vodafone">Vodafone</a></li>
</ul>
<p>These 4 service providers have license to provide 3G services in Delhi. I bought 4 Prepaid SIM Cards of each and activated whatever 3G service was needed and their plans.</p>
<p>Additionally also bought one Nokia 101 Dual SIM phone (Rs. 1500) to easily check the balance, validity etc. and send/receive sms messages and USSD codes.</p>
<h1>First, The Verdict</h1>
<p>Vodafone as service provider, unlocked Huawei E1731 and Asus RT-N66U are awesome, and I assume I&#8217;d be staying with Vodafone for a long time to come.</p>
<p>This was my first Vodafone connection and I was delighted to see how Vodafone performed. It&#8217;s slightly on the higher side from the cost perspective, but if you want to have serious net connectivity, then Vodafone would suit you well considering the fact that it gets you</p>
<ul>
<li>Excellent Download and Upload speeds (unlike Airtel)</li>
<li>The connection doesn&#8217;t disconnect every few hours and thus the IP remains the same (unlike Reliance)</li>
<li>Connects in the first go and you don&#8217;t really have to wait (unlike MTNL)</li>
</ul>
<p>Vodafone does not allow connectivity from outside to your setup, so you as such cannot do port forwarding easily, unless it is initiated from the client end (such as by creating a tunnel using ssh -R on Linux).</p>
<p>Having the perfect connectivity between the ASUS router and 3G USB dongle was the most difficult part, and Huawei one performed satisfactorily.</p>
<p><a href="http://exain.files.wordpress.com/2012/12/3g-isp-performance_delhi_india_december20123.png"><img class="alignnone  wp-image-153" alt="3G ISP Performance Comparison, Delhi, India - December 2012" src="http://exain.files.wordpress.com/2012/12/3g-isp-performance_delhi_india_december20123.png?w=691&#038;h=440" width="691" height="440" /></a></p>
<p><span id="more-126"></span></p>
<p>&nbsp;</p>
<p><strong>Table of Contents</strong></p>
<ol>
<li>First, The Verdict</li>
<li>The Test Environment
<ul>
<li>The machines used</li>
<li>The scripts used for testing</li>
</ul>
</li>
<li>Individual Unit Review
<ul>
<li>Router : Micromax MMX400R – FAIL</li>
<li>Router : DLink DIR-456U</li>
<li>Router : Asus RT-N66U Dark Knight</li>
<li>3G USB Modem : ZTE K3770-z</li>
<li>3G USB Modem : Huawei E1731 (173Bu-1)</li>
<li>ISP : Airtel</li>
<li>ISP : Reliance 3G</li>
<li>ISP : MTNL 3G</li>
<li>ISP : Vodafone</li>
</ul>
</li>
<li>Notes about other 3G dongles</li>
<li>More cost-effective ways</li>
<li>Possible disadvantages using a 3G connection</li>
</ol>
<p>&nbsp;</p>
<h1>The Test Environment</h1>
<p><strong>The machines used</strong></p>
<p>The setup runs in a home environment. The routers are connected to an APC 800VA UPS.</p>
<p>The primary machines used to test the setup were</p>
<p>a) Lenovo Thinkpad E420 running Ubuntu 11.10 (yes I&#8217;ve not upgraded yet).</p>
<p>b) Sony Xperia S phone running Android 4.0</p>
<p>The way I tested the speeds were primarily via <a href="http://speedtest.net">http://speedtest.net</a> by selecting the servers of the ISP if available, sometimes in different locations too (e.g. instead of Delhi, selecting Mumbai). I also have a cloud server on <a title="E2E Networks - Superb Cloud Server hosting in India" href="http://e2enetworks.com/">E2E Networks</a> which offers excellent speeds. I had a 5 MB file on it which I used to download to view the approximate speeds that I got during different times of the day (and night). Last was downloading Ubuntu 12.10 from different mirrors randomly. I used wget to do the downloading part, and usually I enabled only a single client connection to the router so that I could get more accurate values.</p>
<p><strong>The scripts used for testing</strong></p>
<p>I prefer using PHP for scripting instead of bash, as that makes work comparatively easier. Created two scripts to check</p>
<p>a) At what frequency does a connection disconnect and how much time does it take to reconnect. The script is <a title="Check Uptime through PHP" href="http://exain.com/uploads/pingcheck.phps" target="_blank">available here</a> and should be executed in the following way (rename phps to php). To exit the script, use CTRL+C. To monitor what is happening, in another console window, use <strong>tail -f pinglog.txt</strong></p>
<pre>$ while true; do php pingcheck.php; done</pre>
<p>b) If the connection is up or not without using the machine. In ASUS RT-N66U I can set a cron job, so I can update my server every minute that my home connection is active, and at what frequency the IP address changes, without worrying about keeping a machine switched on to do the monitoring. The script is <a title="Monitoring Uptime on Router" href="http://exain.com/uploads/3GUptime.zip">available here</a> along with the MySQL database structure, and of course you need to host it on your server to be able to use it correctly.</p>
<p>Once you have setup the database and hosted the script on the server, use a cron job (either on the router, or on your machine) to run it every minute. An example entry would like</p>
<pre>* * * * * (wget -q -O - 'http://yourdomain.com/uptime.php?isp=ISPName&amp;s=t')</pre>
<p>To check the status, access the URL <a href="http://yourdomain.com/uptime.php" rel="nofollow">http://yourdomain.com/uptime.php</a></p>
<p>Then, after these scripts were created, it was the continuous monitoring and trying all sorts of combinations after which I believe I have arrived at a stable solution. I still don&#8217;t get the advertised speeds (never saw 4Mbps+ on the router using this Huawei E1731 during day time), but at-least it works in a way that I don&#8217;t have to worry about connectivity and concentrate on work.</p>
<h1>Individual Unit Review</h1>
<p><a name="micromax-mmx400r"></a></p>
<p>&nbsp;</p>
<h2>Router : Micromax MMX400R &#8211; FAIL</h2>
<p>If you are serious about Internet connectivity, never get this router. Though hardware-wise it could be somewhat stable, but it has a perhaps &#8216;Indian&#8217; touch to it &#8211; as soon as you establish a connection, it shows an advertisement. It shows an advertisement only if you access a http:// service, but it can affect your background services.</p>
<p>Calling Micromax care is of no good use. They said it&#8217;s a feature and what&#8217;s the problem in clicking &#8220;Don&#8217;t show this page&#8221; link. Of course, this was a new thing &#8211; interrupting my work frequently, so I did give it for repair for a week, but unfortunately it was returned as is &#8211; as it was not an &#8220;issue&#8221;.</p>
<p>And now <strong>I&#8217;ll never buy a Micromax product</strong> again. Following is the advertisement</p>
<p><a href="http://exain.files.wordpress.com/2012/12/mmx400r.png"><img class="alignnone size-full wp-image-130" alt="See Advertisement before you work" src="http://exain.files.wordpress.com/2012/12/mmx400r.png?w=525"   /></a><br />
<a name="dlink-dir456u"></a></p>
<p>&nbsp;</p>
<h2>Router : DLink DIR-456U</h2>
<p>This is the only router that I could find in which I could insert a SIM card and it didn&#8217;t have a battery attached. It supported 16 WiFi clients, and it worked really well as far as getting the connection was concerned. The WiFi range was moderate and I could use only between two rooms, and further to that caused issues. Also, specifically Airtel connection didn&#8217;t work well in this. The rest did work though.</p>
<p>I could send SMS from within the setup, so was comparatively easier to get the 3G data balance information from the service provider. It also had a dual WAN support &#8211; so I could attach a regular WAN connection, and the 3G could work as a failover. You could also attach a phone to it and use it to make outgoing calls. All that was pretty cool, and so were the indicators on the front which let you know the current status of the system including the 3G network signal it&#8217;s getting.</p>
<p>An irritant was that the 3G network used to go down once every 2 days. Which meant I had to restart the router frequently to be able to use the Internet. The WiFi used to work, but a reboot from within the Router&#8217;s admin interface didn&#8217;t work, it had to be power-cycled. This was thus an unreliable setup unless you&#8217;re used to shutdown the modem during night. In my case all my WiFi devices operate 24&#215;7 and it didn&#8217;t suit me. I&#8217;d rather want to worry about work than worrying that my net connection might go down anytime.</p>
<p>I had called up their customer support, and though they were helpful, but it had to be given to a service center, and it was pretty difficult to prove what the issue was &#8211; unless I provided them a 24&#215;7 running setup for 2 days. So, I let it go and moved on.</p>
<p>This is how the router looks like. It works well with Vodafone, Reliance &amp; MTNL &#8211; provided you are okay with it restarting it every few days.</p>
<p><a href="http://exain.files.wordpress.com/2012/12/dlink-456u.png"><img class="alignnone size-medium wp-image-131" alt="DLink-456U 3G Router" src="http://exain.files.wordpress.com/2012/12/dlink-456u.png?w=300&#038;h=168" width="300" height="168" /></a></p>
<p><a name="asus-rt-n66u"></a></p>
<p>&nbsp;</p>
<h2>Router : Asus RT-N66U Dark Knight</h2>
<p>This is the most visually intimidating router I&#8217;ve ever seen. With 3 Antennas, a dark shiny color, and LOADS of features, I feel it&#8217;s worth its price.</p>
<p><a href="http://exain.files.wordpress.com/2012/12/asus_rtn66u.png"><img class="alignnone size-medium wp-image-132" alt="ASUS RTN66U" src="http://exain.files.wordpress.com/2012/12/asus_rtn66u.png?w=279&#038;h=300" width="279" height="300" /></a></p>
<p>Within the second day, I upgraded it&#8217;s firmware to <a title="Merlin's Firmware for ASUS RT-N66U" href="http://www.lostrealm.ca/tower/node/80" target="_blank">Merlin&#8217;s firmware</a> and enabled SSH support and also setup the cron jobs to monitor my connection&#8217;s health. I also installed gnokii to send/receive sms messages and it was pretty cool.</p>
<p>The range of the router is excellent, you can setup Guest Network and thus isolate yours guests from your internal network. It has 2 USB ports. One I use for the 3G Modem, and the other for a 64G flash drive. You can setup a DLNA server on it very swiftly and thus share your photographs, videos and music all across your home without the need for a dedicated computer for it. I understood what&#8217;s DLNA from this device, and now I think how I lived without it.</p>
<p>By default it provides Failover support, so if your WAN connection via cable goes down, you could use a 3G Modem and provide connectivity automatically. With Merlin&#8217;s firmware, you can even do Load Balancing between Cable and 3G, and even use your LAN ports on the router for the load balancing (useful if you have 2 ADSL connection and you want to either do a failover or load balancing between them &#8211; of course for that you would need separate ADSL modems). My connection was only 3G so I disabled Dual WAN Support and made 3G/USB as primary connection.</p>
<p>It does have limitation as far as the 3G USB modem support is concerned. I had first bought a ZTE K3770-z modem which is supplied by Vodafone and is factory unlocked. It used to get heated and rarely used to automatically re-connect once disconnected. Also, the speeds that I got when I used to connect it to my Ubuntu machine vs what I got when I connected it to the router had a vast variation (approx 6Mbps vs 1.5-2Mbps).  Overall, it didn&#8217;t work well.</p>
<p>What did work somehow was the Huawei E1731 (173Bu-1) model which is supplied by Airtel, and is locked to Airtel. I had to use a Windows machine and dc-unlocker.com (and pay for it too) to unlock it and use it for Reliance and Vodafone. Unlocking voids  your warranty, so do it at your own risk. It brought stability and reliability and it continuously worked for few days. I still need to see how it works in a 24x7x365 environment and for that I&#8217;d wait till December 2013 to comment on anything.</p>
<p>Overall I&#8217;m very happy with this purchase. Has made a lot of things far easier for me, and I am loving it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a name="zte-k3770-z"></a></p>
<p>&nbsp;</p>
<h2>3G USB Modem : ZTE K3770-z</h2>
<p>This is a good USB modem. It works as advertised, providing 7.2Mbps speed which I was able to nearly achieve on my Ubuntu machine using Airtel, Vodafone and Reliance connectivity. The good part is that this modem is factory unlocked and looks good visually too.</p>
<p>The unfortunate part is that it didn&#8217;t work in tandem with the Asus RT-N66U. I wish it had though.</p>
<p>It used to get heated quite a lot, and sometimes I could even smell plastic melting, which probably was because it was new, or the plastic was actually melting! The RT-N66U recognized it, but it wasn&#8217;t able to provide full throughput. I managed to somehow get a maximum of 1.5-2Mbps and not beyond that. Even the download and ping response was always erratic. Using a Reliance 3G connection (which disconnects every 4 hours), it never managed to connect again.</p>
<p>Also, specifically noted with Reliance 3G, it sometimes established a 2G connection instead of 3G and I had to reboot the router to make it establish a 3G connection.</p>
<p>Overall, there were intermittent issues with it. If you&#8217;re using it on a machine, then it should be fine. On the ASUS RT-N66U it is not reliable.</p>
<p><a name="huawei-e1731"></a></p>
<p>&nbsp;</p>
<h2>3G USB Modem : Huawei E1731 (173Bu-1)</h2>
<p>This model is provided by Airtel and there are many variants to it. By default it&#8217;s called Huawei E1731, but only after you open the hood you will come to know the actual model number. In my case it was 173Bu-1.</p>
<p>Since it came &#8216;Airtel Locked&#8217; by default, and I already had an Airtel 3G SIM with me, so I used it first on the Airtel network. It worked fine with RT-N66U. The speed that I got was approximately 1.2-1.5Mbps, not more, both upload &amp; download. The Airtel signal strength is moderate in my location and I found the speeds to be satisfactory. The pings were stable, the response was fast and the way things were going, I could have continued.</p>
<p>There was an issue that I faced with Airtel 3G, that they reduced my speed to 64-80Kbps and I couldn&#8217;t figure out why despite numerous calls to them for almost a week. So the time was ripe for unlocking.</p>
<p><strong>Unlocking Process : </strong>The unlock procedure was a bit complicated initially as I wasn&#8217;t aware of the concepts. I was assuming it&#8217;ll be a simple firmware update. However, there was more in store. Please note: Unlocking Airtel E1731 router would void the warranty. Do it at your own risk.</p>
<p>To unlock Huawei 173Bu-1, you don&#8217;t really need a firmware update. There are a finite number of attempts that can be performed on a Huawei 3G USB Dongle to unlock it (10 attempts to be precise). Airtel by default exhausts those attempts, so you cannot update the firmware no matter how hard you try by using the methods available on other websites. The trick is to reset the counter to 0. But that method I couldn&#8217;t figure out. So I eventually headed to dc-unlocker.com as it had that model supported, downloaded their client on a Windows machine, purchased 4 credits for 4 Euros, and then unlocked it. It was painful as I wasn&#8217;t aware of the complexities, but once unlock was done, the unlock attempts counter was reset to 0, and I was also able to use any other sim card without performing the firmware update.</p>
<p>After that, it&#8217;s the default modem that I&#8217;m using on the RT-N66U, and to be honest, it has provided a peace that I wasn&#8217;t having for few months now.</p>
<p><a name="isp-airtel"></a></p>
<p>&nbsp;</p>
<h2>ISP : Airtel</h2>
<p>I was very hopeful that Airtel would give a wonderful performance. It was partially good, and unfortunately things were not smooth &#8211; both from technology perspective, and from the ISP itself.</p>
<p><strong>Price: </strong>Cost-wise it&#8217;s slightly on the higher side. There&#8217;s a bill shield concept that they&#8217;re using which I didn&#8217;t find attractive, and in any case a post-paid user pays more for same data than a pre-paid user since tax is also applied, and the speed is reduced (to 20kbps!!) after the data limit is reached. You probably can extend it via &#8220;Smart Bytes&#8221; in Airtel, but post-paid is always expensive than pre-paid if you intend to use it only for data. You can check the balance either via USSD code, or via Website. For pre-paid users, it&#8217;s the worst experience because if you&#8217;re using a USB modem on a router, you can&#8217;t send USSD code (e.g. *121*10#), and you need to have access to the SMS if you ever want to check your balance online as the Airtel website sends a one time password for every login that you do. That&#8217;s bad. Last, but not the least, you cannot recharge an Airtel pre-paid account till your data balance is &lt;50 MB, or your duration expires. So over-all, Airtel makes it all very painful.</p>
<p><strong>Compatibility: </strong>In DIR-456U, it never worked at all consistently, and kept on disconnecting randomly. I got my SIM changed by visiting the store, but it was of no good. Tested it for 1 week, and realized it was futile to test it on DIR-456U.</p>
<p>On ASUS RT-N66U, with Huawei E1731, it worked rather well. There were no random disconnects and everything was smooth.</p>
<p><strong>Additional Features/Problems: </strong>The best part about Airtel is that it doesn&#8217;t block the incoming ports, which means if you do a port forwarding on your router, then you can connect to it from outside. I used that a lot for SSH connections and that was one of the reasons I really wanted to move ahead with Airtel, as no other provider that I tested provided this functionality.</p>
<p><strong>Customer Service: </strong>Alas, one fine day, my speed was reduced to 64Kbps (or probably 80Kbps). It is a prepaid account, and I had sufficient data left in my account that this wasn&#8217;t expected. I called up Airtel 3G Customer Support, and they said that they&#8217;ll get back in 24 hours. 24 Hours later when I asked them for the status, they mentioned that everything is is fine at their end and it would be an intermittent issue at my end. I insisted that the speed was still slow, and they escalated it with a response time of 24 hours. This happened for 5 days. Eventually I managed to get my data balance below 50 MB and recharged with a cheaper plan, and within an hour everything seemed working well. Unfortunately, this was something that put up an unpredictable aspect. This earlier had happened to one of my Airtel postpaid connections, though I didn&#8217;t bother to follow-up. So it did left a dent regarding the quality and predictability.</p>
<p>So, Airtel was sadly (gladly?) out.</p>
<p><a name="isp-reliance"></a></p>
<p>&nbsp;</p>
<h2>ISP : Reliance 3G</h2>
<p>Reliance surprisingly gave rather good connectivity. I wasn&#8217;t expecting it, and was delighted that I could reach approximately 4Mbps connectivity. But, there was a drawback which I&#8217;ll mention later, which was lot worse than Airtel.</p>
<p><strong>Price: </strong>Price-wise it offers attractive plans. It has long term plans also (90 days, 180 days), so  you can use it as a backup connectivity medium. They give sufficient data (Rs. 1300 &#8211; 15 GB compared to Rs. 1500 for 10 GB in Airtel, and Rs. 1255 for 10 GB in Vodafone). You cannot check how much data you&#8217;ve consumed by visiting their website. All you can do is, send SMS, or send USSD code using a mobile phone to check the balance. If your router doesn&#8217;t support SMS, then you&#8217;re out of luck. You&#8217;ll be doing SIM swapping to check the balance.</p>
<p><strong>Compatibility:</strong> In DIR-456U, it worked well always, and it worked well in ASUS RT-N66U too, after I used the Huawei E1731 card &#8211; though I noticed a performance drop (it sometimes showed 500-800 Kbps as the max speed, and I couldn&#8217;t increase it). So I&#8217;m not very sure how compatible it is with Huawei E1731.</p>
<p><strong>Additional Features/Problems:</strong> The significant drawback was, that it disconnects every 4 hours. Which means, if you&#8217;re connected and you&#8217;re downloading something or are on a Skype call, and you&#8217;ve been connected for 4 hours, at 4 Hours and 1 second it&#8217;ll disconnect. It&#8217;s that precise. Never a second late. I&#8217;ve run it for continuously for 4 days, and the behavior is the same.</p>
<p><strong>Customer Support</strong><strong>:</strong> Calling Reliance customer support was of not much help. They said it&#8217;s a &#8220;Feature&#8221;, that you get disconnected every 4 hours &#8211; it helps prevent misuse. Also, having interacted with their Customer Support for this connection over certain other issues regarding prepaid recharges as well as my Wimax connection, including personally visiting Reliance Web World stores (in Nehru Place, Delhi for instance), I have realized that Reliance is the worst as far as technical support or customer satisfaction is concerned. I&#8217;ve seen wrong billing, customer support people lying &amp; taking people for a ride and making everything so unpleasant and messy.</p>
<p>I said Thank You Reliance, never relying on you for my net connectivity needs.</p>
<p><a name="isp-mtnl"></a></p>
<p>&nbsp;</p>
<h2>ISP : MTNL 3G</h2>
<p>MTNL 3G is highly unpredictable. It offers moderate speeds &#8211; approx 1.6-1.8Mbps download. However, the speeds and the latency received is highly variable, and you cannot rely on it in a 24&#215;7 setup.</p>
<p><strong>Price: </strong>It has comparatively cheaper plans. Rs. 850 for 10 GB and Rs. 1650 for Unlimited data transfer are very attractive, considering no other provider offers an unlimited data plan yet. The balance could be checked only by using a phone. I am not aware how it can be checked online, neither did I try. The painful aspect regarding MTNL was that it&#8217;s not easy to do an online recharge. I tried the Paytm website to do a recharge of Rs. 42 (500 MB for 3 days), and I couldn&#8217;t do it, no matter what the time of the day was.</p>
<p><strong>Compatibility: </strong>The SIM worked fine in DIR-456U. The issue was that it rarely connected in one go to the 3G network (using pps3g as the APN). It always took time disconnecting, registering, disconnecting, registering and the ping response and overall speed was not satisfactory. I used to get sudden high speeds, and then a complete drop. Of course, it&#8217;ll be a disaster if I try to do a Skype Voice/Video call on it. Didn&#8217;t try it on Huawei and ASUS RT-N66U.</p>
<p>MTNL was not the one I&#8217;d be using.</p>
<p><a name="isp-vodafone"></a></p>
<p>&nbsp;</p>
<h2>ISP : Vodafone</h2>
<p>I never thought Vodafone would be the one that would be my primary Internet connection. I always prefer setups which have their own international Internet backbone (Bharti, Tata, Reliance), and not the ones which buy it from these 3, but Vodafone was a good performer &#8211; so good that I decided to stay with it.</p>
<p><strong>Price: </strong>From cost perspective, Vodafone is not on the cheaper side. With Rs. 1255 getting you 10 GB, that&#8217;s the maximum which is on offer. However, it has an excellent website through which you can check the balance and do the recharging etc. done without playing the SMS or USSD game. It also allows you to recharge even if you have sufficient data balance remaining in your account, which Airtel does not. It all seemed like Vodafone plans and technology setup is designed by people who use a gift called &#8216;brain&#8217;.</p>
<p><strong>Compatibility: </strong>In DIR-456U it worked like a charm. Offering excellent speeds &#8211; 4.8Mbps download to 2.1Mbps upload, it didn&#8217;t disconnect and lasted till I had to manually disconnect. It probably uses the Tata network at the back-end; the latency was low and stable. Network signal was also good. Connected in one go and I was up in 15 seconds.Though the original Vodafone USB dongle K3770-z didn&#8217;t perform well, but the unlocked Huawei E1731 did on the ASUS RT-N66U. The speeds were good, and it worked no matter what time of the day it was. I was finally able to play 720p videos without interruption <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Additional Features/Problems: </strong>There was a minor hiccup that I faced &#8211; I used to renew for Rs. 1250, but one fine day I wasn&#8217;t able to. After visiting a Vodafone shop, I realized that the plan was changed from 1250 to 1255, and it wasn&#8217;t updated on the site. That was something that didn&#8217;t feel nice, considering I was updating on the last day when my plan was going to expire, and I was without connectivity for next 2 days till I sorted it out with their customer care. But apart from that, things have been good, and I&#8217;m pretty happy.</p>
<p>Thank you Vodafone <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h1>Notes about other 3G dongles</h1>
<p>I never went into Idea Cellular&#8217;s Netsetter direction because I had been their customer for 8 years. And I saw that consistently their performance degraded &#8211; their 3G network was never good on the phone, they used to block ping, traceroutes, and even SSH port, which showed that whoever is running their data network division is pretty clueless in the technology and awareness department. So I wasn&#8217;t going to risk it.</p>
<p>Aircel &amp; MTS I didn&#8217;t try because I wanted to stick with what ever was most available here in Delhi. Also, I wasn&#8217;t sure if I would be able to unlock their modems and use them successfully with the setup that I needed.</p>
<p>I did use Tata Photon+ dongle, but only for a few hours. It connected in the first go. The model was Huawei EC156. It seemed to work fine, but the speeds being offered were too low here in my location (approximately 512Kbps), and I didn&#8217;t really wanted to move in that direction. So I opted out.</p>
<h1>More cost-effective ways</h1>
<p>You don&#8217;t necessarily need a big router such as ASUS RT-N66U to setup your 3G network. Just head over to <a href="http://ebay.in" target="_blank">Ebay.in</a> and search for 3G Routers. You will get a list of devices which offer 3G USB Dongle connectivity, and are from various manufacturers. You can call the sellers and check with them which USB dongles they support.If you need to be independent of 3G USB Dongles, then you can try DLink&#8217;s DIR-457U 3G SIM Router which also has a battery and is portable. I doubt it will show any advertisements unlike Micromax but if possible you try before buying.</p>
<h1>Possible disadvantages using a 3G connection</h1>
<p>Following is what I realized while I was doing all this testing. Though my setup seems to work for now, but I still need to test it year long to be able to see if a 3G connection is worth it or not. The disadvantages that I saw were</p>
<ol>
<li>The traffic on the 3G network varies during different times of the day, leading to variable download speeds and latency</li>
<li>Sometimes a connection is established, but it may not necessarily offer good connectivity, so there&#8217;s a need to disconnect and connect again. You may also latch to a 2G network, and you need to disconnect and connect again to get on to 3G.</li>
<li>Periodic disconnection (specially with Reliance 3G) might interrupt your ongoing work</li>
<li>If the connection is not used, then there&#8217;s a possibility that it&#8217;ll automatically disconnect (which happens with Vodafone &#8211; if unused it disconnects within 5-7 minutes, and has to be connected again).</li>
<li>Faults are much more frequent compared to a Fixed Wireline (such as ADSL), or a Fixed Wireless (such as Wimax).</li>
</ol>
<p>Hope the above helps you to make a decision on which side you really want to move to. Of course, your mileage may vary depending on your location. If you can try by borrowing data cards from your friends, then do that first. Best of luck in your quest!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=126&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2012/12/19/quest-for-ultimate-3g-wireless-internet-setup-at-home-delhi-india/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2012/12/3g-isp-performance_delhi_india_december20123.png" medium="image">
			<media:title type="html">3G ISP Performance Comparison, Delhi, India - December 2012</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2012/12/mmx400r.png" medium="image">
			<media:title type="html">See Advertisement before you work</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2012/12/dlink-456u.png?w=300" medium="image">
			<media:title type="html">DLink-456U 3G Router</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2012/12/asus_rtn66u.png?w=279" medium="image">
			<media:title type="html">ASUS RTN66U</media:title>
		</media:content>
	</item>
		<item>
		<title>Wireless on Ubuntu 11.10 and Lenovo Thinkpad E420</title>
		<link>http://exain.wordpress.com/2011/10/16/wireless-on-ubuntu-11-10-and-lenovo-thinkpad-e420/</link>
		<comments>http://exain.wordpress.com/2011/10/16/wireless-on-ubuntu-11-10-and-lenovo-thinkpad-e420/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 06:08:39 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[acer_wmi]]></category>
		<category><![CDATA[e420]]></category>
		<category><![CDATA[lenovo]]></category>
		<category><![CDATA[oneiric ocelot]]></category>
		<category><![CDATA[realtek]]></category>
		<category><![CDATA[rtl8188ce]]></category>
		<category><![CDATA[rtl8192ce]]></category>
		<category><![CDATA[thinkpad]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu 11.10]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=114</guid>
		<description><![CDATA[Unlike 11.04 and earlier, Ubuntu 11.10 runs much better on Lenovo Thinkpad E420. The only glitch is the wifi drivers which don&#8217;t run by default, and it could be corrected easily Using LiveCD or a running system Press Super (Window) key, and open Terminal Type sudo modprobe -r acer_wmi That&#8217;s all. You should be able [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=114&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Unlike 11.04 and earlier, Ubuntu 11.10 runs much better on Lenovo Thinkpad E420. The only glitch is the wifi drivers which don&#8217;t run by default, and it could be corrected easily</p>
<h2>Using LiveCD or a running system</h2>
<ul>
<li>Press Super (Window) key, and open Terminal</li>
<li>Type <strong>sudo modprobe -r acer_wmi</strong></li>
</ul>
<p>That&#8217;s all. You should be able to connect to the wireless till next reboot.</p>
<h2>Making the change permanent</h2>
<p>Edit the file <strong>/etc/modprobe.d/blacklist.conf</strong> and in the end type</p>
<pre>blacklist acer_wmi</pre>
<p>Reboot and you&#8217;re done. If you&#8217;re doing it entirely from the GUI, then editing the file could be done by pressing ALT+F2 (this would open a &#8220;Run&#8221; window) and typing there <strong>gksu gedit /etc/modprobe.d/blacklist.conf</strong></p>
<p><strong>Please note:</strong> This applies to wireless card having rtl8188ce chipset. You can view that by typing <strong>lspci</strong> in a terminal and searching for the entries respective to Network Controller.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=114&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2011/10/16/wireless-on-ubuntu-11-10-and-lenovo-thinkpad-e420/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu 11.04 on Lenovo E420</title>
		<link>http://exain.wordpress.com/2011/07/24/ubuntu-11-04-on-lenovo-e420/</link>
		<comments>http://exain.wordpress.com/2011/07/24/ubuntu-11-04-on-lenovo-e420/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 17:25:25 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[dconf-editor]]></category>
		<category><![CDATA[e420]]></category>
		<category><![CDATA[freeze]]></category>
		<category><![CDATA[gnome-do]]></category>
		<category><![CDATA[hang]]></category>
		<category><![CDATA[natty]]></category>
		<category><![CDATA[pae]]></category>
		<category><![CDATA[rtl8188ce]]></category>
		<category><![CDATA[systray-whitelist]]></category>
		<category><![CDATA[thinkpad]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unity]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=107</guid>
		<description><![CDATA[Update: 16 October 2011 &#8211; Ubuntu 11.10 works better. http://wp.me/p9bZ0-1Q I recently got a Lenovo E420 laptop, and I just went ahead and installed Ubuntu 11.04 on it. Few are some of the things that may help those who&#8217;re facing issues with it. I got 4 GB RAM on Core i5. It&#8217;s 64bit processor, so [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=107&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>Update: 16 October 2011</strong> &#8211; Ubuntu 11.10 works better. <a href="http://wp.me/p9bZ0-1Q" rel="nofollow">http://wp.me/p9bZ0-1Q</a></p>
<p>I recently got a Lenovo E420 laptop, and I just went ahead and installed Ubuntu 11.04 on it. Few are some of the things that may help those who&#8217;re facing issues with it. I got 4 GB RAM on Core i5. It&#8217;s 64bit processor, so I preferred 64bit Ubuntu instead of 32bit pae kernel.</p>
<h3>Wireless</h3>
<p>The machine has rtl8188ce chipset, and the Realtek drivers available from Realtek&#8217;s website don&#8217;t work well. You just need to blacklist acer_wmi module</p>
<p>Edit /etc/modprobe.d/blacklist.conf and add</p>
<pre>blacklist acer_wmi</pre>
<p>Save and reboot. This won&#8217;t work if you&#8217;ve compiled Realtek drivers and installed them. It&#8217;ll work only in the default install. Here&#8217;s more detailed link -  <a title="Fix wireless on Ubuntu 11.04 Thinkpad Edge E420" href="http://askubuntu.com/questions/53625/wireless-on-thinkpad-edge-e420s">http://askubuntu.com/questions/53625/wireless-on-thinkpad-edge-e420s</a></p>
<h3></h3>
<h3>Random screen lockups</h3>
<p>I am not sure why it occurred &#8211; due to the kernel or due to the compiz settings. I did both. Installed Kernel 2.6.39 from <a title="Ubuntu 2.6.39 kernel for 11.04 Natty" href="http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.39-rc4-natty/">http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.39-rc4-natty/</a></p>
<p>Also, I installed CompizConfig Settings Manager (ccsm) from Ubuntu Software Center, and then disabled this option</p>
<p>General -&gt; OpenGL -&gt; Sync to VBlank (uncheck this)</p>
<p>Reboot. The system may not hang. <a href="http://www.preshweb.co.uk/2011/05/ubuntu-11-04-x-freezing-after-screensaver-active-laptop-lid-closed/">http://www.preshweb.co.uk/2011/05/ubuntu-11-04-x-freezing-after-screensaver-active-laptop-lid-closed/</a></p>
<p><strong>Update 26 July 2011:</strong> There are still instances of system hanging <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  Unable to identify the cause as yet. However, this time the system just hangs with no mouse movement at all. This behavior I experienced in 32bit-pae kernel too and usually happens when system has gone through more than a few standbys. Will diagnose and update further.</p>
<p><strong>Update 2 &#8211; 30 July 2011</strong> : I updated the BIOS to v1.16 (earlier it was 1.10), but it didn&#8217;t do any good. The system still got hung. It is not due to standby also as I disabled the &#8220;Suspend&#8221; option from Power Management section and rebooted the computer and used it for around 3 hours after which I got a Kernel Panic. Realtek has put a new version of their <a title="Linux Drivers for Realtek rtl8188ce (rtl8192ce)" href="http://www.realtek.com/downloads/downloadsView.aspx?Langid=1&amp;PNid=21&amp;PFid=48&amp;Level=5&amp;Conn=4&amp;ProdID=272&amp;DownTypeID=3&amp;GetDown=false&amp;Downloads=true#RTL8188CE">drivers for rtl8188ce chipset</a> &#8211; I&#8217;ve just installed those and rebooted and it seems to be working. Will update later if it has cured the hanging problem.</p>
<p><strong>Update 3 &#8211; 31 July 2011</strong> : After installing the realtek rtl8188ce drivers as mentioned in the post above, I&#8217;ve not rebooted the machine since more than 24 hours. Had suspended it more than a few times, and did various experiments which earlier eventually led to a freeze. But I&#8217;m happy to report that till now all has been good and it has not yet hung. I&#8217;ll keep working on it for next few days and see if there has been a proper resolution.</p>
<h3></h3>
<h3>Indicator icons for unsupported apps</h3>
<p>I installed gnome-do and I was unable to see the indicator icon for that. Installed <strong>dconf-editor</strong> from Ubuntu Software Center.</p>
<p>Got the name of the application from .xsession-errors file (TrayChild). Opened dconf-editor and added &#8216;Do&#8217; in there. Logged out and logged back in and all is well.</p>
<p><a title="Identify names for systray-whitelist Ubuntu 11.04 unity" href="http://askubuntu.com/questions/36898/how-can-i-see-a-list-of-all-the-systray-icons-that-are-not-whitelisted/39750#39750">http://askubuntu.com/questions/36898/how-can-i-see-a-list-of-all-the-systray-icons-that-are-not-whitelisted/39750#39750</a></p>
<p>Don&#8217;t set systray-whitelist to &#8220;all&#8221; as that may lead to the icons in indicator being unclickable.</p>
<p>To be honest, it was horrendous to use Ubuntu 11.04 due to severe productivity issues for the first week. I installed 32bit pae kernel so that the 4GB RAM could be supported. But I couldn&#8217;t upgrade it to 2.6.39 as no pae kernel was available for 2.6.39. I rather installed 64bit Ubuntu, and updated it immediately and rest did what I mentioned above. No more hangs till now, and life has been happy.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=107&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2011/07/24/ubuntu-11-04-on-lenovo-e420/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Nokia E6 Symbian Anna IMAP with push mail</title>
		<link>http://exain.wordpress.com/2011/06/27/nokia-e6-symbian-anna-imap-with-push-mail/</link>
		<comments>http://exain.wordpress.com/2011/06/27/nokia-e6-symbian-anna-imap-with-push-mail/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 11:53:36 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[e6]]></category>
		<category><![CDATA[e6-00]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[imap idle]]></category>
		<category><![CDATA[mfe]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[push mail]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[symbian anna]]></category>
		<category><![CDATA[z-push]]></category>
		<category><![CDATA[zarafa]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=103</guid>
		<description><![CDATA[Nokia Symbian based phones have a terrible IMAP support. If you have IMAP server of your own, you only have two options Use &#8220;Nokia Messaging&#8221; which means you receive your emails via Nokia servers (similar to blackberry) and it&#8217;d not be your phone but nokia servers which would connect to your IMAP server and push [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=103&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Nokia Symbian based phones have a terrible IMAP support. If you have IMAP server of your own, you only have two options</p>
<ul>
<li>Use &#8220;Nokia Messaging&#8221; which means you receive your emails via Nokia servers (similar to blackberry) and it&#8217;d not be your phone but nokia servers which would connect to your IMAP server and push mails to your phone. This works better, but then you&#8217;re giving your details to Nokia, and could be a privacy issue for some.</li>
<li>Use the in-built IMAP client. This would mean you don&#8217;t have a &#8216;push&#8217; email, but a check interval of 5 minutes. Not awesome.</li>
</ul>
<p>Following is one more way to set to use IMAP via the Nokia Mail for Exchange client, and you don&#8217;t need to have any Microsoft Exchange setup.</p>
<p>&nbsp;</p>
<h3 id="Concept">Concept</h3>
<ol type="1">
<li>You need to be running an IMAP server.</li>
<li>There&#8217;s an open source PHP based software called &#8220;z-push&#8221; which allows activesync connectivity and has IMAP backend, which means you can use it to &#8216;sync&#8217; your phones using the Nokia Mail for Exchange client.</li>
<li>You need Apache web server with php5 and php5-imap support where <strong>z-push</strong> would be setup.</li>
<li>You download and configure z-push.</li>
<li>You configure your phone settings, and then use Nokia Mfe client to connect to your IMAP server and thus have &#8220;push&#8221; functionality.</li>
</ol>
<p>&nbsp;</p>
<h3 id="Assumptions">Assumptions</h3>
<ol type="1">
<li>An IMAP server is running with SSL support with self-signed certificates (I used dovecot), which has usernames as &#8216;<a href="mailto:user@domain.com">user@domain.com</a>&#8216; format.</li>
<li>You have Apache with PHP5 and php-imap support. On ubuntu/debian you can install it using <tt>apt-get install php5-imap</tt>.</li>
<li>Nokia Mail For Exchange supports only a single account on a phone. So if you have multiple email accounts to be synced, bad luck.</li>
<li>It was tested on a Nokia E6 running Symbian Anna. Your setup may vary or could be different.</li>
</ol>
<p>&nbsp;</p>
<h3 id="Server_side_setup">Server side setup</h3>
<ol type="1">
<li>Download z-push from Source Forge <a href="http://z-push.sf.net/">http://z-push.sf.net</a> ; I used version z-push-1.5.4RC-705.tar.gz.</li>
<li>Extract it in a suitable location, for example, <tt>/var/www/z-push</tt></li>
<li>You can refer to the <tt>INSTALL</tt> document too for more information inside the z-push extracted files.</li>
<li>Make the &#8216;state&#8217; directory web server user writable. So do <tt>chown www-data.www-data state</tt> or <tt>chmod 777 state</tt>.</li>
<li>Configure z-push. We will modify the following
<pre>$BACKEND_PROVIDER = "BackendIMAP";

// ************************
//  BackendIMAP settings
// ************************

define('IMAP_SERVER', 'localhost');
define('IMAP_PORT', 993);
define('IMAP_OPTIONS', '/ssl/novalidate-cert');
define('IMAP_DEFAULTFROM', 'domain');
define('IMAP_SENTFOLDER', 'Sent');
define('IMAP_USE_IMAPMAIL', false);</pre>
</li>
<li>So that the &#8220;Sender Name&#8221; when sending out email works well, there&#8217;s a <tt>IMAP_DEFAULTFROM</tt> setting, which didn&#8217;t work too well in my case, so I modified the backend file to display the &#8220;Sender&#8217;s Name&#8221; correctly in the format <tt>Firstname Lastname &lt;user@domain.com&gt;</tt>. The following changes were done in <tt>backend/imap.php</tt>
<pre># Added the following lines in the section below
# $v = "$this-&gt;_domain &lt;$this-&gt;_username&gt;";
# $envelopefrom = "-f$this-&gt;_username";

            if ($k == "from") {
                if (trim($v)) {
                    $changedfrom = true;
                    $v = "$this-&gt;_domain &lt;$this-&gt;_username&gt;";
                    $envelopefrom = "-f$this-&gt;_username";
                } elseif (! trim($v) &amp;&amp; IMAP_DEFAULTFROM) {</pre>
</li>
<li>In Apache configuration, I have SSL setup. So in the configuration file for the SSL, I specified an alias as under
<pre>        Alias /Microsoft-Server-ActiveSync "/var/www/z-push/index.php"</pre>
</li>
<li>Restart Apache and your z-push is ready.</li>
</ol>
<p>&nbsp;</p>
<h3 id="Client_side.2BAC8-phone_setup">Client side/phone setup</h3>
<ol type="1">
<li>Now that the server side setup is ready, we&#8217;ll configure the phone.</li>
<li>You can enter the settings as per the requirements while configuring the Mail For Exchange client.</li>
<li>The &#8220;domain&#8221; would be your full name (as you wish to display when you send someone an email).</li>
<li>That&#8217;s all. Sync it and you&#8217;re ready to go!</li>
</ol>
<p>&nbsp;</p>
<h2 id="Troubleshooting">Troubleshooting</h2>
<ol type="1">
<li>To enable debug logs, create a file <tt>debug.txt</tt> in the z-push directory and assign it web server user writeable privileges. For example:
<pre>cd /var/www/z-push
touch debug.txt
chown www-data.www-data debug.txt # or; chmod 777 debug.txt</pre>
</li>
<li>You may want to experiment with the <tt>IMAP_OPTIONS</tt> by referring to <a href="http://php.net/imap_open">http://php.net/imap_open</a></li>
<li>Your &#8216;Sent&#8217; items folder could be different. You may want to keep it blank (the default).</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=103&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2011/06/27/nokia-e6-symbian-anna-imap-with-push-mail/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Making a WiFi Hotspot / Access Point using Linux &amp; wifi lan card/USB adapter</title>
		<link>http://exain.wordpress.com/2011/03/31/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter/</link>
		<comments>http://exain.wordpress.com/2011/03/31/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 06:49:08 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[access point]]></category>
		<category><![CDATA[ap]]></category>
		<category><![CDATA[ath5k]]></category>
		<category><![CDATA[hostapd]]></category>
		<category><![CDATA[hotspot]]></category>
		<category><![CDATA[linksys]]></category>
		<category><![CDATA[rt2800usb]]></category>
		<category><![CDATA[rt2870sta]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wusb54gc]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=97</guid>
		<description><![CDATA[If you have a wifi LAN card / USB adapter, then you can use it as an access point so that other machines can connect to the internet via your machine using Wifi. The process is fairly simple, but requires you to have a compatible set of drivers which allow a wifi lan card to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=97&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If  you have a wifi LAN card / USB adapter, then you can use it as an  access point so that other machines can connect to the internet via your machine using Wifi. The process is  fairly simple, but requires you to have a compatible set of drivers  which allow a wifi lan card to come into &#8220;Master&#8221; mode.</p>
<p>It didn&#8217;t work well for</p>
<ul>
<li>Linksys  WUSB54GC v3 USB adapter. Till Ubuntu 10.04, there were no good drivers for  use with hostapd (supporting mac80211 / nl80211). In Ubuntu 10.10,  though the drivers were working, but the connection was highly unstable &#8211;  in fact unusable. The drivers that I tried were rt2800usb (which  allowed the adapter to come into Master mode), and rt2870sta which  didn&#8217;t allow the adapter to come into &#8220;Master&#8221; mode. It always remained  &#8220;Auto&#8221; or &#8220;Managed&#8221; (checked via iwconfig). Need to test in 11.04 when  it arrives.</li>
</ul>
<p>What worked pretty well</p>
<ul>
<li>02:00.0 Ethernet controller: Atheros Communications Inc. AR5001 Wireless Network Adapter (rev 01), using <tt>ath5k</tt> drivers. hostapd didn&#8217;t complain at all and all was smooth. This was in Ubuntu 10.04.</li>
</ul>
<h3 id="Concept">Concept</h3>
<ol type="1">
<li>There&#8217;s an  application called hostapd which allows converting a wifi adapter into  an access point and provide privileges such as WPA authentication and  ssid name definition etc. I used it and it worked well.</li>
<li>When  a client connects to the access point, apart from authentication it&#8217;ll  require IP addresses to be assigned. For that a DHCP server is used.</li>
<li>You  need to have 2 interfaces, one which accesses the net (e.g. eth0), and  other which provides the access point services (e.g. wlan0).</li>
<li>You  start the wlan interface, assign it an IP address, start the dhcp  server, setup firewall/nat and start hostapd. That&#8217;s all to it. Your  devices would be able to use the wifi adapter as the access point.</li>
</ol>
<h3 id="Procedure">Procedure</h3>
<pre>apt-get install dhcp3-server hostapd</pre>
<p>Modify <tt>/etc/hostapd/hostapd.conf</tt> and put the following</p>
<pre>interface=wlan0
driver=nl80211
ssid=MyAP
hw_mode=g
channel=11
wpa=1
wpa_passphrase=MyPasswordHere
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
wpa_ptk_rekey=600</pre>
<p>The dhcpd.conf section in <tt>/etc/dhcp3/dhcpd.conf</tt> would have something like the following</p>
<pre>subnet 10.10.0.0 netmask 255.255.255.0 {
        range 10.10.0.25 10.10.0.50;
        option domain-name-servers 8.8.4.4, 208.67.222.222;
        option routers 10.10.0.1;
}</pre>
<p>Modify <tt>/etc/default/dhcp3-server</tt></p>
<pre>INTERFACES="wlan0"</pre>
<p>Check what name your adapter got via <tt>iwconfig</tt>. You can change the name also and make it persistent via <tt>/etc/udev/rules.d/70-persistent-net.rules</tt> so that it always gets a single type of name. In our example we&#8217;re  assuming wlan0, but it could be changed. Make necessary changes in your  configuration too.</p>
<p>Configure the new interface</p>
<pre>ifconfig wlan0 10.10.0.1</pre>
<p>The above could also be done in a better way via the <tt>/etc/network/interfaces</tt> file, but didn&#8217;t try it out. In any case if you shutdown hostapd, the  network interface (wlan0) loses its address, so need to put a script  which assigns it again before hostapd is started. An example could be</p>
<pre>iface wlan0 inet static
 address 10.10.0.1
 netmask 255.255.255.0</pre>
<p>Restart the dhcp3-server. It should now be ready to serve addresses and is also bound to the network interface too.</p>
<p>Allow ip masquerading</p>
<pre>echo "1" &gt; /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</pre>
<p>Now start hostapd and see the messages that it shows</p>
<pre>hostapd -dd /etc/hostapd/hostapd.conf</pre>
<p>Wait  for a few seconds, it should show some probes being done by other wifi  devices. If it shows, then probably you&#8217;re in good luck.</p>
<p>Now try to connect via your device to this access point. It should work.</p>
<p>To make this work on boot, can put the relevant config in <tt>/etc/default/hostapd</tt></p>
<pre>RUN_DAEMON="yes"
DAEMON_CONF="/etc/hostapd/hostapd.conf"
DAEMON_OPTS="-dd"</pre>
<p>and also put the firewall rules in /etc/rc.local (make sure its executable).</p>
<p>Remember  &#8211; if you shutdown your hostapd, the network card would lose its  address. So you have to assign that again before starting hostapd. The  usual practice would be</p>
<ul>
<li>Stop hostapd</li>
<li>Stop dhcp server</li>
<li>Restart network (or rather <tt>ifup wlan0</tt> / <tt>ifconfig wlan0 10.10.0.1</tt> would do)</li>
<li>Restart dhcp server</li>
<li>Start hostapd</li>
</ul>
<h3 id="Miscellaneous">Miscellaneous</h3>
<ol type="1">
<li>You can check the wifi interfaces via
<pre>iwconfig</pre>
</li>
<li>To  set a wifi adapter into master mode, try the following. If it doesn&#8217;t  work and shows an error that it&#8217;s not possible or something, fret not &#8211;  use hostapd as that&#8217;ll do that in any case.
<pre>iwconfig wlan0 mode Master</pre>
</li>
<li>Network  Manager could create issues, though in my test environment &#8211; instead of  using an ethernet interface, I used two wlan interfaces, one being  controlled by Network Manager for internet access, and other for making  it an access point.</li>
<li><tt>modprobe -r ath5k</tt> / <tt>modprobe -r rt2800usb</tt> etc. is to be used for unloading the modules.</li>
<li>If you wish to proceed without using authentication so that you can test it easy, then put the following in <tt>/etc/hostapd/hostapd.conf</tt>
<pre>interface=wlan0
driver=nl80211
ssid=MyAP
hw_mode=g
channel=11</pre>
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=97&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2011/03/31/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter/feed/</wfw:commentRss>
		<slash:comments>99</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Recovering contacts from Backup.arc on Nokia Series 60 3rd edition devices</title>
		<link>http://exain.wordpress.com/2011/01/06/recovering-contacts-from-backup-arc-on-nokia-series-60-3rd-edition-devices/</link>
		<comments>http://exain.wordpress.com/2011/01/06/recovering-contacts-from-backup-arc-on-nokia-series-60-3rd-edition-devices/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 12:28:13 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[backup.arc]]></category>
		<category><![CDATA[contacts.cdb]]></category>
		<category><![CDATA[nbuexplorer]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[symbian]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=89</guid>
		<description><![CDATA[I have a Nokia E61 (Symbian Series 60 3rd Edition &#8211; v9.1). I usually take backups on my memory card in the phone (I&#8217;ve three of them) and restore them in case it&#8217;s necessary. However, today when I tried to do it, it wouldn&#8217;t restore and always ask for a &#8220;Restart&#8221; after flashing &#8220;Restoring&#8230;&#8221; screen [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=89&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I have a Nokia E61 (<strong>Symbian Series 60 3rd Edition &#8211; v9.1</strong>). I usually take backups on my memory card in the phone (I&#8217;ve three of them) and restore them in case it&#8217;s necessary. However, today when I tried to do it, it wouldn&#8217;t restore and always ask for a &#8220;Restart&#8221; after flashing &#8220;Restoring&#8230;&#8221; screen for a split second. I tried all my other backups made during last 1 year and it just won&#8217;t work. I even hard-reset/formatted the phone by pressing *,3 and call key and then starting the phone, assuming that maybe there&#8217;s some issue with the firmware. It just didn&#8217;t work. I&#8217;d my latest backup available on my memory card and I couldn&#8217;t use it. After spending more than a few hours, I managed to retrieve information, more importantly my contacts.</p>
<p>Credit goes to</p>
<ul>
<li>Michael Montey from <a href="http://groups.google.com/group/noki-sms/browse_thread/thread/1012e376016ca2ba">http://groups.google.com/group/noki-sms/browse_thread/thread/1012e376016ca2ba</a></li>
<li><a title="Profile of petrusek on Sourceforge.net" href="http://sourceforge.net/users/petrusek">petrusek</a> &#8211; who created NbuExplorer (<a title="NbuExplorer by petrusek" href="http://nbuexplorer.sourceforge.net">http://nbuexplorer.sourceforge.net</a>)</li>
</ul>
<p>Here&#8217;s how I retrieved all the Contacts. It assumes you have a Backup.arc with you. If you&#8217;ve taken backup on the memory card and view the contents of the memory card on computer, you&#8217;ll see a Backup/ folder in which the Backup.arc would be there. If not, tough luck.</p>
<ol>
<li>It works only on Windows. I used Windows XP.</li>
<li>Install NbuExplorer from <a href="http://nbuexplorer.sourceforge.net">http://nbuexplorer.sourceforge.net</a> &#8211; it requires <a title="Download .Net Framework 2.0 from MS website" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;displaylang=en">.Net Framework 2.0</a> which I downloaded from Microsoft website, so install the framework prior to opening NbuExplorer.</li>
<li>Install Java 1.4.2 and Symbian SDK. As of now I&#8217;m not too sure that Java 1.4.2 would be necessary at all. For Symbian SDK, you need to be a member of <a href="http://forum.nokia.com">Nokia Forum</a> &#8211; the version that I downloaded was <a title="Symbian SDK for Series 60 3rd Edition devices" href="http://www.forum.nokia.com/info/sw.nokia.com/id/05c63dfd-d6e9-4c0e-b185-d365e7001aeb/S60-SDK-0548-3.0-f.3.215f.zip.html">S60-SDK-0548-3.0-f.3.215f.zip</a></li>
<li>Now open NbuExplorer and point it to the Backup.arc file. It should show the contents in it including pictures, sounds etc.</li>
<li>You need to locate the file having the name <strong>Contacts</strong> and ending with the extension <strong>.cdb</strong>. In my case the name was<strong> DBS_100065FF_Contacts.cdb</strong> and it was under <strong>C: -&gt; private -&gt; 100012a5</strong> within the NbuExplorer interface. Once you locate it, right-click on the file name and select &#8216;Export selected file(s)&#8217;. It&#8217;ll ask you for a location &#8211; you may select &#8220;Desktop&#8221;. Keep that file safe &#8211; it has all your contacts.</li>
<li>Now close NbuExplorer and start Symbian Emulator. It would open a Symbian interface &#8211; you need to add a new contact in there. You can add anything. We just want it to build a contact database of its own which we&#8217;ll eventually replace with our own contact database. Once done, close the Emulator.</li>
<li>Next step is to replace the contact database created by the emulator by our actual database which has our contacts. In my case I went to C:\Symbian\9.1\S60_3rd\Epoc32\winscw\c\private\100012a5. The file DBS_100065FF_Contacts.cdb was already present. I replaced it with my actual file which I&#8217;d retrieved via NbuExplorer.</li>
<li>We&#8217;ll add a memory card to our Symbian Emulator. For that edit the file <strong>epoc.ini</strong>which is located in C:\Symbian\9.1\S60_3rd\Epoc32\Data and modify the following values so that they look like the following<br />
_EPOC_DRIVE_E \epoc32\winscw\e<br />
_EPOC_LocDrv_1 E: FAT</li>
<li>Let&#8217;s start the Emulator now. If you go to contacts, if all goes well you should be seeing all your contact listing. Hurray! Step 1 done.</li>
<li>Now we&#8217;ll need to transfer the contacts to the memory card. Mark all contacts and then select &#8220;Copy to memory card&#8221; from within the emulator interface. It should say that it has copied them to the memory card.</li>
<li>Now go to the &#8220;e&#8221; drive created via epoc.ini, that is, in C:\Symbian\9.1\S60_3rd\Epoc32\winscw\e. There would be a folder called &#8220;Others&#8221; inside which there&#8217;d be &#8220;Contacts&#8221;. If all goes well, you should see a lot of <strong>.vcf</strong> entries inside it. Those are your contacts. Copy them to an actual memory card of the phone &#8211; in the same directory (Others\Contacts). Now put the memory card in your phone.</li>
<li>In your phone, open &#8220;Contacts&#8221;, and then select the option <strong>Copy -&gt; From memory card</strong>. The contacts would be copied. For me it retrieved all information with precision.</li>
</ol>
<p>I had evaluated <a href="http://www.nokisoft.com/noki/">Nokisoft.com&#8217;s Noki Explorer</a> application. There were two things I wasn&#8217;t sure of, (a) it retrieved 30 contacts in the trial version, but the data that was retrieved was not complete; and (b) it seemed to be a tad expensive for one time use. Nokisoft&#8217;s explorer may be easier to retrieve contacts &#8211; that you can decide.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=89&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2011/01/06/recovering-contacts-from-backup-arc-on-nokia-series-60-3rd-edition-devices/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Asterisk Basics, and Load Balancing via DUNDi</title>
		<link>http://exain.wordpress.com/2010/07/03/asterisk-basics-and-load-balancing-via-dundi/</link>
		<comments>http://exain.wordpress.com/2010/07/03/asterisk-basics-and-load-balancing-via-dundi/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 08:23:30 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dundi]]></category>
		<category><![CDATA[iax]]></category>
		<category><![CDATA[iax2]]></category>
		<category><![CDATA[jr richardson]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[load sharing]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pbx]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[sip]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=74</guid>
		<description><![CDATA[IMPORTANT: The configurations, that is, the code sections underneath are not wrapped. However, if you want to copy paste them, you can just select them and despite they being not visible to you, they&#8217;ll get copied into the clipboard. Otherwise you may want to refer to the PDF version. Prepared by : Vivek Kapoor http://exain.com [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=74&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>IMPORTANT:</strong> The configurations, that is, the code sections underneath are not wrapped. However, if you want to copy paste them, you can just select them and despite they being not visible to you, they&#8217;ll get copied into the clipboard. Otherwise you may want to refer to the PDF version.</p>
<p>Prepared by : Vivek Kapoor <a href="http://exain.com/">http://exain.com</a><br />
Prepared on : 01 July 2010<br />
PDF Version : <a href="http://exain.files.wordpress.com/2010/07/asterisk_basics_load_balancing_dundi_vivek_kapoor.pdf">Asterisk_Basics_Load_Balancing_DUNDi_Vivek_Kapoor</a></p>
<h2 id="head-5cb82ee8a71a410f7a31417a845e23dedd8c3cf3">Purpose of  this document</h2>
<p>Asterisk is an open source PBX. Which means, you can  setup your own little telephone exchange in your home/office  environment. On a much larger usage, you may look forward to setting up a  redundant phone setup wherein multiple boxes are interconnected with  each other and provide some sort of failover capability and easier  management, which is possible through something called DUNDi. This  document aims to provide such a solution with a possibility of  horizontal scaling instead of vertical scaling. So, this may mean that  by using low-end commodity hardware, you can setup a strong telephone  infrastructure which can cater to thousands of users.</p>
<p>Read the document carefully. Read it fully before you  start implementing it. It is intentionally detailed so that you know  what you&#8217;re doing.</p>
<h2 id="head-772a8099db808fe0fb818839c5e35374ef33b2bf">Acknowledgements</h2>
<p>All credit of this document goes  to JR Richardson. I&#8217;m afraid I&#8217;ve not been able to find a suitable link  for him, but his whitepapers and presentations are the ones which helped  me move forward. And of course, <a href="http://www.voip-info.org/wiki/view/Mark+Spencer">Mark Spencer</a> &#8211;  the guy behind Asterisk. Without him this document wouldn&#8217;t have  existed.</p>
<p>The writings by JR Richardson</p>
<ul>
<li><a href="http://www.voip-info.org/storage/users/813/47813/images/1654/DUNDi_So_Easy.pdf">http://www.voip-info.org/storage/users/813/47813/images/1654/DUNDi_So_Easy.pdf</a></li>
<li><a href="http://atlaug.com/stuff/Presentations/Astricon06/JR_Richardson_Whitepaper.pdf">http://atlaug.com/stuff/Presentations/Astricon06/JR_Richardson_Whitepaper.pdf</a></li>
</ul>
<h2 id="head-c49b50ed6cb94d8e7f7819cd5629decd19564e8d"><span id="more-74"></span>Disclaimer</h2>
<p>Though I have significant  experience doing Linux and related systems, but I&#8217;m more of a novice in  Asterisk. The following may or may not work for you. I don&#8217;t provide any  warranty whatsoever of it being successful, or rather, consistently  successful, and providing an actual load balanced solution. I&#8217;ve yet to  implement it in a production setup, and hence all you do is at your own  risk. The below procedure SHOULD work, but I CANNOT say that it WILL  work.</p>
<h2 id="head-b6c735c2c05c6aff230729e678bd325ac120c9dc">Before we  begin</h2>
<p>A little about the nomenclature</p>
<ul>
<li><strong>Asterisk</strong> : <a href="http://asterisk.org/">http://asterisk.org</a> It  is a PBX (Private Branch Exchange) software which runs on Linux  platform. It allows you to have VOIP facility without incurring cost on  proprietary hardware, and can run off a home desktop system.</li>
<li><strong>DUNDi</strong> : <a href="http://dundi.com/">http://dundi.com</a> DUNDi is  a peer-to-peer system for locating Internet gateways to telephony  services. Unlike traditional centralized services (such as the  remarkably simple and concise ENUM standard), DUNDi is fully-distributed  with no centralized authority whatsoever. We will be using it to  interconnect multiple asterisk boxes and setting up a load balanced  environment which will also act as a failover.</li>
<li><strong>SIP  Softphone</strong> : A softphone running from your desktop which allows  you to register to asterisk and enable VOIP communication. I, for this  document, use Zoiper &#8211; <a href="http://zoiper.com/">http://zoiper.com</a></li>
<li><strong>RealTime</strong> : <a href="http://www.voip-info.org/wiki/view/Asterisk+RealTime">http://www.voip-info.org/wiki/view/Asterisk+RealTime</a> It will allow us to connect to MySQL and have the users registered in  there instead of being hard coded in sip configuration. This way it will  be possible to have users register to any registration server and not  just one on which they&#8217;re configured.</li>
</ul>
<p>You  need to have some experience related to Linux systems. You should be  comfortable in compiling applications from scratch. The method mentioned  in this email should work as is, but if there are issues, then you  would be resolving them on your own. Also, it is highly recommended to  have some working knowledge about Asterisk. You should have setup some  Asterisk based environment &#8211; if you&#8217;ve not done that yet, then I think  you should first concentrate on that. You&#8217;ll be delighted to see what  all is possible through Asterisk.</p>
<h2 id="head-c53a401d9388b30d213d853eeccea7d256733117">Quick look at  the steps</h2>
<p>To make it work with the minimum  configuration, we&#8217;ll proceed step by step so that we don&#8217;t miss a thing.  This means we&#8217;ll not jump straight-away to the fully functional DUNDi  setup, but do it slowly, understanding each step as we do it. Here&#8217;s how  we&#8217;ll move forward</p>
<ol type="1">
<li>Installation of  Asterisk on a Debian/Ubuntu systems (2 systems initially, later 3)</li>
<li>Basic  SIP User Creation &amp; Testing</li>
<li>Making  it work with DUNDi &#8211; 2 Server Setup</li>
<li>More  DUNDi &#8211; 3 Server Setup</li>
<li>Adding RealTime to it</li>
<li>What&#8217;s  next</li>
</ol>
<h2 id="head-4c4d3ab8c42578ad60df09b94e8034eb4d41e6c4">Asterisk  Installation</h2>
<ol type="1">
<li>You need to  have atleast TWO working Debian/Ubuntu machine. I will be using THREE  machines eventually, but will start with two. Though the following would  work for any Linux distribution available, the steps related to  installation and initialization of packages could vary &#8211; so you may  refer to the documentation of your distribution.</li>
<li>I am using Virtual Machines running via KVM  for this exercise. You may use Virtualbox, Xen, or any of your  preferred solutions. Here&#8217;s the basic structure
<ul>
<li>Server A, IP: 192.168.1.5, MAC Address:  00:16:36:99:54:62</li>
<li>Server  B, IP: 192.168.1.6, MAC Address: 00:16:36:2f:11:9c</li>
<li>Server C, IP: 192.168.1.10, MAC Address:  00:16:36:6e:d7:dc</li>
</ul>
</li>
<li>Three packages are required from the asterisk website,  the asterisk package itself, dahdi &amp; asterisk-addons for mysql  support. Get them from <a href="http://asterisk.org/">http://asterisk.org</a> &#8211; I chose the following versions which were the latest at the time of  writing this article
<ul>
<li>asterisk-1.6.2.8.tar.gz</li>
<li>dahdi-linux-complete-2.3.0.1+2.3.0.tar.gz</li>
<li>asterisk-addons-1.6.2.1.tar.gz</li>
</ul>
</li>
<li>The  installation steps are as under. The asterisk installation documents are  readily available on the internet, so you may try out a more detailed  ones. Here&#8217;s what will get you started</li>
<li>Install  the pre-requisites first
<pre>apt-get install linux-headers-$(uname -r) build-essential automake autoconf bison flex libtool libncurses5-dev libssl-dev libgsm1 libgsm1-dev libgsmme-dev libgsm-tools libxml2-dev libmysqlclient-dev
</pre>
</li>
<li>Untar all the downloaded packages  (asterisk, dahdi and asterisk-addons) into /usr/local/src and then one  by one run the following
<pre># Dahdi First
cd dahdi-linux-complete-2.3.0.1+2.3.0
make clean
make
make install
make config

# Now for Asterisk
cd asterisk-1.6.2.8
make clean
./configure
make install
make samples
make config

# Last, the asterisk add-ons (important for MySQL support)
cd asterisk-addons-1.6.2.1
make clean
./configure
make menuselect # Optional - I usually disable h323 support
make
make install
make samples
</pre>
</li>
<li>DAHDI may require some  downloading from the Internet, so make sure you have the machine  connected to the Internet, or use a proxy by using
<pre>export http_proxy=http://your.proxy.ip:port
</pre>
</li>
<li>That&#8217;s all. Asterisk is  configured. You may run the following to verify.
<pre>/etc/init.d/asterisk start
asterisk -r
/etc/init.d/asterisk stop
</pre>
</li>
</ol>
<h2 id="head-a8a5df090d6a1fc572cc5333604455320934c6fe">Basic SIP  User Creation &amp; Testing</h2>
<p>For each file listed below,  certain changes are done. You can name as per your convenience, but it  should match in all the relevant sections further in the document.</p>
<h3 id="head-25d837deea2afb4f6923e660cf51fe4d3975bde2">Server A,B  &amp; C : /etc/asterisk/asterisk.conf</h3>
<p>Uncomment  the following</p>
<pre>verbose = 14
</pre>
<h3 id="head-b334f1037b3ac7cba5f2ad45c2af4eb86bd88123">Server A :  /etc/asterisk/sip.conf</h3>
<pre>[general]
srvlookup=no
NAT=yes
bindport=5060
allowguest=no
canreinvite=no

[1001]
type=friend
context=internal
host=dynamic
disallow=all
allow=gsm
canreinvite=no
qualify=yes
</pre>
<p>You can change bindport as per the requirements. If you  happen to change the bindport to, say, 5070, then while configuring  Zoiper, in the domain section, write something like 192.168.1.5:5070</p>
<h3 id="head-1579082612d2bf39e26e66c655b12996a130d499">Server A :  /etc/asterisk/extensions.conf</h3>
<pre>[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[internal]
exten =&gt; 123,1,Playback(demo-congrats)
exten =&gt; 123,n,Hangup()
</pre>
<h3 id="head-bc17a742eb4894ce0ae6be116419f2d3ba0ab94c">Server B :  /etc/asterisk/sip.conf</h3>
<pre>[general]
srvlookup=no
NAT=yes
bindport=5060
allowguest=no
canreinvite=no

[1002]
type=friend
context=internal
host=dynamic
disallow=all
allow=gsm
canreinvite=no
qualify=yes
</pre>
<h3 id="head-107783a09499cf4be44d474a0d5b8be801148f62">Server B :  /etc/asterisk/extensions.conf</h3>
<pre>[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[internal]
exten =&gt; 456,1,Playback(demo-congrats)
exten =&gt; 456,n,Hangup()
</pre>
<h3 id="head-ab17a8888badfc64072f2bd87d099c4e0dd76e8f">Testing the  setup</h3>
<p>What we see above is that there  are two servers, Server A and Server B. Server A has SIP user 1001, and  Server B has 1002. Both the users belong to a context called &#8220;internal&#8221;,  which probably means that when they dial in any extension, the first  context that they&#8217;ll hit is &#8220;internal&#8221;, and from there onwards they&#8217;d be  redirected to other contexts as per the dial plan.</p>
<p>The context &#8220;internal&#8221; is defined in &#8220;extensions.conf&#8221;  file. There&#8217;s not much in that context except one single extension, 123  in Server A and 456 in Server B. When that extension is called, a  congratulations message is played. So to test it, I have used an  application called Zoiper which allows two lines to be connected. You  can download Zoiper from <a href="http://www.zoiper.com/softphone/">http://www.zoiper.com/softphone/</a> &#8211; I used Zoiper Classic for Linux.</p>
<p>Let&#8217;s start  asterisk first on Server A &amp; Server B by using</p>
<pre>/etc/init.d/asterisk start
</pre>
<p>and then connect to an asterisk  session by using</p>
<pre>asterisk -r
</pre>
<p>I created two SIP accounts in Zoiper, for Server A I  entered 192.168.1.5 as domain, and 1001 as username, and for Server B I  entered 192.168.1.6 as domain and 1002 as username. Rest of the details  can be added as per your preference. I deselected the &#8220;Register on  startup&#8221; option under advanced settings. Then on the Zoiper interface I  registered to both the servers.</p>
<p>On Server A,  something like the following should appear when you list the sip peers</p>
<pre>CLI&gt; sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
1001/1001                  xx.xx.xx.xx     D   N       5060     OK (116 ms)
1 sip peers [Monitored: 1 online, 0 offline Unmonitored: 0 online, 0 offline]
CLI&gt;
</pre>
<p>Same goes for Server B. It should show something like  the following</p>
<pre>CLI&gt; sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
1002/1002                  xx.xx.xx.xx     D   N       5060     OK (134 ms)
1 sip peers [Monitored: 1 online, 0 offline Unmonitored: 0 online, 0 offline]
CLI&gt;
</pre>
<p>Now select in Zoiper, the Server A Account and dial 123 &#8211;  it should playback the congratulations message. If you try to dial 456,  it&#8217;ll not work. But if you select Server B in the Account, and then  dial 456, it should work as expected.</p>
<p>A sample  screenshot of Zoiper is below</p>
<p><a href="http://exain.files.wordpress.com/2010/07/zoiperscreen01.png"><img class="alignnone size-full wp-image-80" title="Zoiper Screenshot for DUNDi" src="http://exain.files.wordpress.com/2010/07/zoiperscreen01.png?w=525" alt="Zoiper Screenshot for DUNDi"   /></a></p>
<p>Also check the messages that appear in the console that  you&#8217;d opened earlier (by using asterisk -r). A sample of the same on  Server A is as under</p>
<pre>CLI&gt;
  == Using SIP RTP CoS mark 5
    -- Executing [123@internal:1] Playback("SIP/1001-00000001", "demo-congrats") in new stack
    -- &lt;SIP/1001-00000001&gt; Playing 'demo-congrats.gsm' (language 'en')
    -- Executing [123@internal:2] Hangup("SIP/1001-00000001", "") in new stack
  == Spawn extension (internal, 123, 2) exited non-zero on 'SIP/1001-00000001'
CLI&gt;
</pre>
<p>So, our basic configuration is working fine. If you add  more SIP users in sip.conf file, and add relevant extensions in  extensions.conf file, then you can have a single server PBX running  perfectly fine. It is important to have the above working so that we can  be sure that our setup is ready for DUNDi.</p>
<h2 id="head-28a0e7e8fc13bd93f1f0106c0dd129ac20ae5a33">Making it  work with DUNDi &#8211; 2 Server Setup</h2>
<p>Before we delve further into  DUNDi, please remember that the most important thing here is &#8220;contexts&#8221;.  If you specify them incorrectly, it wouldn&#8217;t work as expected and  you&#8217;ll be left wondering what&#8217;s happening.</p>
<p>Let&#8217;s begin now in a two server configuration. The  purpose here is that extension 1001 would be registered on Server A, and  1002 on Server B. But, via DUNDi, Server A would know that extension  1002 is on Server B, and would effectively be able to call it too.</p>
<h3 id="head-b334f1037b3ac7cba5f2ad45c2af4eb86bd88123-2">Server A :  /etc/asterisk/sip.conf</h3>
<p>Add a new context (regcontext to  be precise) called &#8220;dundiextens&#8221; in the [general] section. It&#8217;s a  pretty simple file</p>
<pre>[general]
regcontext=dundiextens
srvlookup=no
NAT=yes
bindport=5060
allowguest=no
canreinvite=no

[1001]
type=friend
context=internal
host=dynamic
disallow=all
allow=gsm
canreinvite=no
qualify=yes
</pre>
<p>The <strong>regcontext</strong> parameter is very  important here. It auto-creates a context as soon as a SIP user logs in  (in our case the context will be dundiextens). This is used and searched  by DUNDi to get to the desired extension. Later we&#8217;ll see how to view  the users who belong to &#8220;dundiextens&#8221; context.</p>
<h3 id="head-bc17a742eb4894ce0ae6be116419f2d3ba0ab94c-2">Server B :  /etc/asterisk/sip.conf</h3>
<p>Similar to Server A, the new  context has to be added. The following would be the final sip.conf for  Server B.</p>
<pre>[general]
regcontext=dundiextens
srvlookup=no
NAT=yes
bindport=5060
allowguest=no
canreinvite=no

[1002]
type=friend
context=internal
host=dynamic
disallow=all
allow=gsm
canreinvite=no
qualify=yes
</pre>
<h3 id="head-5fa406b9dc3e7c397681f1129d678cecef7c7ad9">Server A  &amp; B : /etc/asterisk/iax.conf</h3>
<p>We will be using IAX2 trunk to  interconnect the DUNDi boxes. IAX2 doesn&#8217;t work too well in virtual  machines as it requires a timing device/timing source. For me it didn&#8217;t  work well as far as Playback() was concerned, but when doing a voice  call everything seemed to be just fine. I&#8217;ve not been able to figure out  if it&#8217;s a timing device/virtual machine issue or it&#8217;s just some setting  in iax.conf that needs to be done. If I run dahdi_test in a virtual  machine, the results are always above 99.6%. The same is with a  dedicated machine, so I guess the timing source seems to okay.</p>
<p>Tried using SIP Trunk also, but it causes a number of  issues when doing RealTime. When using RealTime the users were  registered multiple times on Asterisk box, so 1001 which was initially  registered on Server A got registered on Server B as well. Also, I  wasn&#8217;t able to figure out a way to send a call from Server A to a  particular context on Server B. It also caused a bit of scalability  issues as well since if using dedicated trunks then I&#8217;d have to provide  each server&#8217;s details in sip.conf of all servers. So when a new server  is added, the sip.conf would need to be updated on all the servers,  which isn&#8217;t that elegant (because then sip reload would also be called).</p>
<p>Here&#8217;s the content of the  &#8220;iax.conf&#8221; file where [iaxuser] is added. It&#8217;s the same on each server</p>
<pre>[general]
jitterbuffer=no
nochecksums=no
disallow=all
allow=gsm

[iaxuser]
type=friend
dbsecret=dundi/secret
context=incomingdundi
</pre>
<p>So, as we see, there are three contexts we&#8217;ve  encountered till now. Context &#8220;internal&#8221;, which is associated with the  SIP user being registered, context &#8220;dundiextens&#8221; which is auto-created  as soon as the first user registers on a particular server, and lastly  context &#8220;incomingdundi&#8221; &#8211; this is used when a call arrives via the IAX  trunk. All these have to be mentioned in extensions.conf of each server.</p>
<p>If you notice, there&#8217;s a  parameter &#8220;dbsecret&#8221; in the file. I guess it allows one server to  authenticate to another by using a username/password combination. The  advantage is that it&#8217;s just a username/password authentication and not  any server information hard coded. Which has the best advantage that if  any new server is added to the cluster, it&#8217;ll automatically be  authenticated. Also, I had read somewhere, probably in the links below,  that &#8220;dundi/secret&#8221; value for &#8220;dbsecret&#8221; is to be taken literally &#8211; you  shouldn&#8217;t be changing it.</p>
<p>If you want  to read about using IAX and SIP trunks in DUNDi, you can refer to the  following</p>
<ul>
<li><a href="http://www.voip-info.org/wiki/view/DUNDi+Enterprise+Configuration+IAX">http://www.voip-info.org/wiki/view/DUNDi+Enterprise+Configuration+IAX</a></li>
<li><a href="http://www.voip-info.org/wiki/view/DUNDi+Enterprise+Configuration+SIP">http://www.voip-info.org/wiki/view/DUNDi+Enterprise+Configuration+SIP</a> (this doesn&#8217;t work yet)</li>
<li><a href="http://www.voip-info.org/wiki/view/DUNDi+Enterprise+Configuration+SIP+with+no+passwords">http://www.voip-info.org/wiki/view/DUNDi+Enterprise+Configuration+SIP+with+no+passwords</a></li>
</ul>
<h3 id="head-a0d8086c96a9f4707625cd89d7cfa0b1153320d9">DUNDi key  generation</h3>
<p>Before we  proceed further, we will need to create a couple of keys on one server,  and COPY it to another server. I haven&#8217;t tried creating different keys,  so cannot confirm otherwise.</p>
<p>On Server A,  go to /var/lib/asterisk/keys directory, and execute the following</p>
<pre>astgenkey -n dundi
</pre>
<p>and when it asks for pressing  ENTER, just do that. A couple of files would be created in that  directory &#8211; dundi.key &amp; dundi.pub. Copy both the files to Server B  in the same directory &#8211; /var/lib/asterisk/keys. This essentially means  that dundi.key and dundi.pub are identical on both the servers, and  would remain identical as new servers join the cluster.</p>
<h3 id="head-fc13fe593be8f57fd61bed78cb936074fb731c52">Server A :  /etc/asterisk/dundi.conf</h3>
<p>dundi.conf has three primary  sections, [general], [mapping] and peer information to which it can  place queries. Here&#8217;s what needs to be in dundi.conf</p>
<pre>; Part 1
[general]
department=Your Department
organization=Your Company, Inc.
locality=Your City
stateprov=ST
country=US
email=your@email.com
phone=+12565551212

bindaddr=192.168.1.5
port=4520
entityid=00:16:36:99:54:62
cachetime=5
ttl=2
autokill=yes

; Part 2
[mappings]
priv =&gt; dundiextens,0,IAX2,iaxuser:${SECRET}@192.168.1.5/${NUMBER},nopartial

; Part 3
[00:16:36:2f:11:9c] ; MAC Address of Server B
model = symmetric
host = 192.168.1.6 ;(this is the IP address of the DUNDi Server B)
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary
</pre>
<p>Let&#8217;s move to each item step by step</p>
<p>Part 1 &#8211; The [general] section is self explanatory.  Following points should be looked into</p>
<ul>
<li>bindaddr=192.168.1.5  &lt;- The IP Address of your existing machine</li>
<li>entityid=00:16:36:99:54:62  &lt;- The MAC address of the interface for 192.168.1.5. However, it  could be any mac address that you own, that is, it should be something  unique.</li>
<li>cachetime=5 &lt;- Better to have it at 5 seconds than  3600 seconds if it&#8217;s a closed group network. If there&#8217;s a failure of one  server, the re-requests shall be redirected to other servers after 5  seconds have elapsed. May not be good if you&#8217;re connecting to outside  servers not in your domain as it has to potential for frequent queries  if there&#8217;s heavy traffic.</li>
<li>ttl=2 &lt;- The number of DUNDi lookup requests made.  So, if request goes to Server B from Server A, then that&#8217;s one request.  Now Server B can make a maximum of 1 more request to other servers it  has paired with.</li>
</ul>
<p>Part  2 &#8211; The [mapping] section defines what you will provide as the contact  address when another server gets in touch with you. So, if a SIP  extension is registered with you, you will provide the server asking for  that extension a complete path to your machine. If we break the  following statement,</p>
<pre>priv =&gt; dundiextens,0,IAX2,iaxuser:${SECRET}@192.168.1.5/${NUMBER},nopartial
</pre>
<p>As per the documentation, here &#8220;priv&#8221; is the DUNDi  context and will be used by DUNDi. We&#8217;ll see later how it&#8217;s used in  extensions.conf file. Then comes the local context which it&#8217;ll search.  In our case it&#8217;s &#8220;dundiextens&#8221; which we defined in sip.conf under the  regcontext parameter. Then is the weight, the technology being used, the  destination that is to be sent to the server requesting information,  and then further options. You can review DUNDi documentation at <a href="http://www.voip-info.org/wiki/view/DUNDi">http://www.voip-info.org/wiki/view/DUNDi</a> for more details on each of the parameters.</p>
<p>Part 3 &#8211; These are the peers that you&#8217;ll register with  for looking up / doing DUNDi searching. So, if you have multiple  servers, then you&#8217;ll need to have multiple peer definitions similar to  the one mentioned earlier. Since we&#8217;re using only one Server (Server B) as the peer, we&#8217;ve entered that  information in dundi.conf. I think the MAC addresses are more for  consistency than any technical verification, so you should be able to  connect machines outside your network too &#8211; across the globe maybe.</p>
<h3 id="head-2713315c8369ef73dbfb748125518254870f2ce8">Server B :  /etc/asterisk/dundi.conf</h3>
<p>In continuation to the concept  above, we&#8217;ll add the dundi.conf for Server B. Here&#8217;s an example</p>
<pre>; Part 1
[general]
department=Your Department
organization=Your Company, Inc.
locality=Your City
stateprov=ST
country=US
email=your@email.com
phone=+12565551212

bindaddr=192.168.1.6
port=4520
entityid=00:16:36:2f:11:9c
cachetime=5
ttl=2
autokill=yes

; Part 2
[mappings]
priv =&gt; dundiextens,0,IAX2,iaxuser:${SECRET}@192.168.1.6/${NUMBER},nopartial

; Part 3
[00:16:36:99:54:62] ; MAC Address of Server A
model = symmetric
host = 192.168.1.5 ;(this is the IP address of the DUNDi Server A)
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary
</pre>
<p>Our DUNDi configuration is complete. Now Server A has  Server B as DUNDi peer, and vice versa. This means if Server A queries  Server B, then Server B would respond favorably and provide the location  to the SIP extension if it exists on that server (and of course vice  versa).</p>
<h3 id="head-1579082612d2bf39e26e66c655b12996a130d499-2">Server A :  /etc/asterisk/extensions.conf</h3>
<p>Now, for  DUNDi we&#8217;ll need to work up a bit more. Following is the extensions.conf  for each of the contexts mentioned above, that is, internal,  dundiextens, and incomingdundi</p>
<pre>[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[lookupdundi]
switch =&gt; DUNDi/priv

[internal]
exten =&gt; 123,1,Playback(demo-congrats)
exten =&gt; 123,n,Hangup()

include =&gt; lookupdundi

exten =&gt; _XXXX,2,Playback(demo-congrats)
exten =&gt; _XXXX,n,Hangup()

[incomingdundi]
exten =&gt; _XXXX,1,Goto(internal,${EXTEN},2)
</pre>
<p>We&#8217;ve created a new context called [lookupdundi]. This  performs the actual lookup, and if you notice, it does search the &#8220;priv&#8221;  context mentioned in dundi.conf file.</p>
<p>The [internal] context still has the extension 123 on  which demo-congrats is being played. However, we have included  &#8220;lookupdundi&#8221; context in there, and further to that created a pattern of  4 digits starting from Priority 2. Priority 2 is very important here.  Why? Because when a SIP Phone is registered, due to the regcontext being  specified in sip.conf, a Priority 1 with NoOp is already created, which  you can see by typing &#8220;dialplan show dundiextens&#8221; on the asterisk  prompt after the SIP phone is registered. So, when the phone will reach  the &#8220;internal&#8221; context, it&#8217;ll look for Priority 2, and that&#8217;s what we  need to provide.</p>
<p>The last  context, [incomingdundi] is called via the IAX Trunk that we created  (called &#8220;iaxuser&#8221; in sip.conf). This transfers the request to &#8220;internal&#8221;  context on Priority 2.</p>
<p>So, it  signifies that, primarily the &#8220;internal&#8221; context is the one where in the  primary dialplan would be written related to what will happen to a call  once it arrives. At this stage, we are not doing anything except  playing a congratulations message.</p>
<h3 id="head-107783a09499cf4be44d474a0d5b8be801148f62-2">Server B :  /etc/asterisk/extensions.conf</h3>
<p>There&#8217;s not  much change for Server B, except having a different extension 456  instead of 123.</p>
<pre>[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[lookupdundi]
switch =&gt; DUNDi/priv

[internal]
exten =&gt; 456,1,Playback(demo-congrats)
exten =&gt; 456,n,Hangup()

include =&gt; lookupdundi

exten =&gt; _XXXX,2,Playback(demo-congrats)
exten =&gt; _XXXX,n,Hangup()

[incomingdundi]
exten =&gt; _XXXX,1,Goto(internal,${EXTEN},2)
</pre>
<h3 id="head-ab17a8888badfc64072f2bd87d099c4e0dd76e8f-2">Testing the  setup</h3>
<p>So here we are, our DUNDi  configuration with two servers is complete, and I just hope it works  without issues for you. Here is how we&#8217;ll test it.</p>
<ol type="1">
<li>Restart Asterisk and start the console on both the servers
<pre>/etc/init.d/asterisk restart
asterisk -r
</pre>
</li>
<li>Use Zoiper and register to both  Server A and Server B. You should see appropriate registration messages  in the asterisk console of both the servers.</li>
<li>Now we will see if on both servers the  &#8220;dundiextens&#8221; has been created and if the users 1001 and 1002 are part  of it.
<pre># On Server A
CLI&gt; dialplan show dundiextens
[ Context 'dundiextens' created by 'SIP' ]
  '1001' =&gt;         1. Noop(1001)                                 [SIP]

-= 1 extension (1 priority) in 1 context. =-
CLI&gt;

# On Server B
CLI&gt; dialplan show dundiextens
[ Context 'dundiextens' created by 'SIP' ]
  '1002' =&gt;         1. Noop(1002)                                 [SIP]

-= 1 extension (1 priority) in 1 context. =-
CLI&gt;
</pre>
</li>
<li>All cool.  Both our phones are registered and as you see the first priority of NoOp  is created in there. Next is to see if the peers are displayed  correctly. Server A would show Server B as its peer, and vice versa.
<pre># Server A : Listing DUNDi peers
CLI&gt; dundi show peers
EID                  Host                Model          AvgTime  Status
00:16:36:2f:11:9c    192.168.1.6         (S) Symmetric  Unavail  OK (1 ms)
1 dundi peers [1 online, 0 offline, 0 unmonitored]
CLI&gt;

# Server B : Listing DUNDi peers
CLI&gt; dundi show peers
EID                  Host                Model          AvgTime  Status
00:16:36:99:54:62    192.168.1.5         (S) Symmetric  Unavail  OK (1 ms)
1 dundi peers [1 online, 0 offline, 0 unmonitored]
CLI&gt;
</pre>
</li>
<li>Next we will see if what happens  if a lookup request is made by DUNDi from Server A to find 1001 (which  is on Server A), and 1002 (which is on Server B). As you will see,  Server A will not give a result of the extensions registered on its own  instance, but only those which are registered on other servers. So, 1001  when searched doesn&#8217;t retrieve any info, but 1002 does.
<pre>CLI&gt; dundi lookup 1001@priv
DUNDi lookup returned no results.
DUNDi lookup completed in 7 ms
CLI&gt; dundi lookup 1002@priv
  1.     0 IAX2/iaxuser:5FGlTXaaJQ+YDTZ0xmbNdQ==@192.168.1.6/1002 (EXISTS)
     from 00:16:36:2f:11:9c, expires in 5 s
DUNDi lookup completed in 8 ms
CLI&gt;
</pre>
</li>
<li>Doing the above on Server B  gives the results as expected. 1002 returns no results as it is on the  same machine, but 1001 does.
<pre>CLI&gt; dundi lookup 1001@priv
  1.     0 IAX2/iaxuser:tgz3cZ1U22WtapJcibkpFA==@192.168.1.5/1001 (EXISTS)
     from 00:16:36:99:54:62, expires in 5 s
DUNDi lookup completed in 6 ms
CLI&gt; dundi lookup 1002@priv
DUNDi lookup returned no results.
DUNDi lookup completed in 8 ms
CLI&gt;
</pre>
</li>
<li>Now let&#8217;s place a call from  Server A selected in Zoiper to 1001. It shouldn&#8217;t play anything. Then  place a call to 1002 &#8211; it should play a congratulations message, and  there should be some information displayed on Server B&#8217;s asterisk  console.</li>
</ol>
<p>If it works for you,  then it means that the DUNDi configuration is working well. If it  doesn&#8217;t, then it would show some messages at the console of what didn&#8217;t  work. You can try enabling sip debugging through</p>
<pre>sip set debug on
</pre>
<h2 id="head-6fb3221733fde213e3a443859199b2985213467c">More DUNDi &#8211; 3  Server Setup</h2>
<p>We&#8217;ll now add Server C to our  existing cluster. This will be our DUNDi lookup server and no user would  register to it.</p>
<p>JR Richardson  mentioned in his document of having a separate DUNDi lookup server  which will have all information about the peers. The advantages that it  would have is</p>
<ul>
<li>There  would be only one peer entered in all registration servers. So if a new  registration server is added to the cluster, the other registration  servers needn&#8217;t have the DUNDi entry in them.</li>
<li>It will be easier to manage since the new  registration server would be added into the DUNDi configuration of  Server C only, and all other servers would know of it instantly.</li>
</ul>
<p>Let&#8217;s move to the configuration part on each server. I  am assuming that you&#8217;ve done the basic installation of Asterisk on  Server C. There&#8217;s no need for setting up sip.conf, iax.conf or  extensions.conf on Server C, only &#8220;dundi.conf&#8221; is needed.</p>
<p>Do the following before proceeding so that you don&#8217;t  encounter weird behavior</p>
<ul>
<li>Unregister  the SIP connections in Zoiper</li>
<li>Stop  Asterisk on all three servers via
<pre>/etc/init.d/asterisk stop
</pre>
</li>
</ul>
<h3 id="head-fc13fe593be8f57fd61bed78cb936074fb731c52-2">Server A :  /etc/asterisk/dundi.conf</h3>
<p>We&#8217;ll remove Server B&#8217;s entry  from dundi.conf and add Server C&#8217;s entry. Here&#8217;s the final dundi.conf on  Server A</p>
<pre>; Part 1
[general]
department=Your Department
organization=Your Company, Inc.
locality=Your City
stateprov=ST
country=US
email=your@email.com
phone=+12565551212

bindaddr=192.168.1.5
port=4520
entityid=00:16:36:99:54:62
cachetime=5
ttl=2
autokill=yes

; Part 2
[mappings]
priv =&gt; dundiextens,0,IAX2,iaxuser:${SECRET}@192.168.1.5/${NUMBER},nopartial

; Part 3
[00:16:36:6e:d7:dc] ; MAC Address of Server C
model = symmetric
host = 192.168.1.10 ;(this is the IP address of the DUNDi Server C)
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary
</pre>
<p>Only the Peer&#8217;s MAC Address and host are changed in Part  3 of the configuration. So we have added Server C as a peer having IP  Address of 192.168.1.10.</p>
<h3 id="head-2713315c8369ef73dbfb748125518254870f2ce8-2">Server B :  /etc/asterisk/dundi.conf</h3>
<p>The configuration is almost  similar to Server A except of course the bindaddress and entityid.</p>
<pre>; Part 1
[general]
department=Your Department
organization=Your Company, Inc.
locality=Your City
stateprov=ST
country=US
email=your@email.com
phone=+12565551212

bindaddr=192.168.1.6
port=4520
entityid=00:16:36:2f:11:9c
cachetime=5
ttl=2
autokill=yes

; Part 2
[mappings]
priv =&gt; dundiextens,0,IAX2,iaxuser:${SECRET}@192.168.1.6/${NUMBER},nopartial

; Part 3
[00:16:36:6e:d7:dc] ; MAC Address of Server C
model = symmetric
host = 192.168.1.10 ;(this is the IP address of the DUNDi Server C)
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary
</pre>
<h3 id="head-4fcaf30ad99942d5a9cbc879765a81418d2737e3">Server C :  /etc/asterisk/dundi.conf</h3>
<p>Remember, you should have copied  dundi.key and dundi.pub from either Server A or Server B to Server C&#8217;s  /var/lib/asterisk/keys. The two said files should be identical on all  the machines. The DUNDi configuration will have information on the peers  to which it will connect. Since it will connect to all asterisk  registration servers, hence the peers would be Server A and Server B.</p>
<p>Here&#8217;s the configuration</p>
<pre>; Part 1
[general]
department=Your Department
organization=Your Company, Inc.
locality=Your City
stateprov=ST
country=US
email=your@email.com
phone=+12565551212

bindaddr=192.168.1.10
port=4520
entityid=00:16:36:6e:d7:dc
cachetime=5
ttl=1 ; Notice the TTL. You wouldn't want this server to loop, but only ask its peers ONCE
autokill=yes

; Part 2
[mappings]
priv =&gt; 

; Part 3
[00:16:36:99:54:62] ; Peer 1 : MAC Address of Server A
model = symmetric
host = 192.168.1.5 ;(this is the IP address of the Server A)
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary

[00:16:36:2f:11:9c] ; Peer 2 : MAC Address of Server B
model = symmetric
host = 192.168.1.6 ;(this is the IP address of the Server B)
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary
</pre>
<p>A few details on above. The &#8220;ttl&#8221; is 1 instead of 2.  Since our lookup server (Server C) is peering with all the registration  servers, it should ask them only once and the registration servers  shouldn&#8217;t forward the request to other servers. ttl=1 ensures that. If  it had been ttl=2, then registration servers (Server A &amp; B would query their peers &#8211; and their  peer is only 1, Server C &#8211; and thus it would get into an unwanted loop.</p>
<p>There&#8217;s an empty &#8220;priv =&gt; &#8221; parameter. It is there  because [mapping] somehow requires atleast one parameter, even if it&#8217;s  empty.</p>
<p>Peer 1 and Peer 2 are added.  If you add another server to it, then you just need to add an entry in  this file only and make it Peer 3 and so on.</p>
<p>That&#8217;s all to it. Let&#8217;s test this out.</p>
<h3 id="head-1f5ced979ff8befdf3f1a30bee3f40f1c0b2cc92">Testing the 3  Server Setup</h3>
<p>In our test  we have two servers, Server A and Server B on which the SIP phones  would register. Server C would act just as a lookup server and answer  requests.</p>
<ol type="1">
<li>Start Asterisk on all the  three servers and connect to their consoles.
<pre>/etc/init.d/asterisk start
asterisk -r
</pre>
</li>
<li>Now use the  command &#8220;dundi show peers&#8221;. It should show only 1 peer on Server A &amp;  B, and 2 peers on Server C. This is just fine.</li>
<li>Register your SIP  Phone on Server A &amp; B, so both extensions 1001 &amp; 1002 should be  registered.</li>
<li>Now  you can either do &#8220;dundi lookup 1001@priv&#8221; or &#8220;dundi lookup 1002@priv&#8221;  from Server C and it&#8217;ll show you both. Doing &#8220;1002@priv&#8221; from Server A  or &#8220;1001@priv&#8221; from Server B would also give you results which are  retrieved from the peer (Server C).</li>
<li>Make  a call now from Server A selected in Zoiper to extension 1002 (on  Server B).</li>
</ol>
<p>If  you&#8217;ve been able to do a 2 server setup, this type of setup should be  trivial for you. Remember, dundi.key and dundi.pub should be identical  on all three servers, so make sure you do that.</p>
<h2 id="head-44982927a1bf1725e08f407a6cb01b75eb837ad2">Adding  RealTime to it</h2>
<p>Yeah, having users hard coded in  sip.conf file is so so so uncool! Let&#8217;s have them in database. Of  course, for this to work you should have asterisk-addons installed on  Server A and Server B. Server C is just the lookup server, so we don&#8217;t  need anything there as far as asterisk is concerned.</p>
<h3 id="head-d062c65cba10f65b84a9ca90ce5c2cd7e9fd0666">Setting up  MySQL Server</h3>
<p>You need to have some  understanding of MySQL to continue. On a Debian/Ubuntu machine you can  install MySQL via</p>
<pre>apt-get install mysql-server
</pre>
<p>For our setup, we will install it on Server C as it is  sitting idle in any case, doing just the lookups. You can have a  dedicated machine for it depending on your requirements. Also, as JR  Richardson had mentioned in one of the documents, asterisk realtime does  a lot of database activity, so it is rather good to have it on other  server and it should go via a separate network interface which is not  being used for VOIP. Since usually all servers have atleast two ethernet  cards, it should be trivial. Think about it and implement as per your  requirements.</p>
<p>After  installation, comment out &#8220;bind-address&#8221; in /etc/mysql/my.cnf file and  then restart mysql through /etc/init.d/mysql restart. This is what I did  on the mysql server after connecting to it</p>
<pre>mysql&gt; create database asterisk;
mysql&gt; grant all privileges on asterisk.* to userA@192.168.1.5 identified by 'secretA';
mysql&gt; grant all privileges on asterisk.* to userB@192.168.1.6 identified by 'secretB';
</pre>
<p>I separated the user so that if in future I need to  identify which user is doing what, then it&#8217;s possible. Otherwise you can  have a single user, it&#8217;s much more convenient that way, specially when  you add more servers. You can also use &#8216;%&#8217; (quotes intended) instead of  IP Address so that anyone can connect to it.</p>
<p>Next import the database structure in which you&#8217;ll store  the users. You can copy paste the following directly into mysql prompt,  or save it as a file and import it later. This is copied directly from  asterisk source and is in the contrib/scripts/sip-friends.sql file. A  minor change you&#8217;d need is that &#8220;fullcontact&#8221; column should have a  varchar(128), otherwise asterisk would complain.</p>
<pre>CREATE TABLE `sipfriends` (
  `name` varchar(40) NOT NULL default '',
  `type` varchar(10) NOT NULL default '',
  `defaultuser` varchar(40),
  `fromuser` varchar(40),
  `fromdomain` varchar(40),
  `secret` varchar(40),
  `md5secret` varchar(40),
  `auth` varchar(10),
  `mailbox` varchar(20),
  `subscribemwi` varchar(10), -- yes/no
  `vmexten` varchar(20),
  `callerid` varchar(40),
  `cid_number` varchar(40),
  `callingpres` varchar(20),
  `usereqphone` varchar(10),
  `language` varchar(10),
  `incominglimit` varchar(10),
  `context` varchar(40) NOT NULL default '',
  `subscribecontext` varchar(40),
  `amaflags` varchar(20),
  `accountcode` varchar(20),
  `musicclass` varchar(20),
  `mohsuggest` varchar(20),
  `allowtransfer` varchar(20),
  `callgroup` varchar(20),
  `pickupgroup` varchar(20),
  `autoframing` varchar(10), -- yes/no
  `disallow` varchar(20) default 'all',
  `allow` varchar(20),
  `maxcallbitrate` varchar(15),
  `host` varchar(40) default 'dynamic',
  `outboundproxy` varchar(40),
  `ipaddr` varchar(20) NOT NULL default '',
  `defaultip` varchar(20),
  `port` int(6) NOT NULL default '0',
  `fullcontact` varchar(128),
  `insecure` varchar(20),
  `qualify` varchar(15),
  `regseconds` int(11) NOT NULL default '0',
  `regexten` varchar(20),
  `regserver` varchar(20),
  `rtptimeout` varchar(15),
  `rtpholdtimeout` varchar(15),
  `rtpkeepalive` varchar(15),
  `lastms` int(11) NOT NULL default '-1',
  `setvar` varchar(200),
  `useragent` varchar(50),
  PRIMARY KEY  (`name`),
  INDEX host (host, port),
  INDEX ipaddr (ipaddr, port)
) TYPE=MyISAM;
</pre>
<p>Last step &#8211; add two users into it, which will be our SIP  users.</p>
<pre>mysql&gt; insert into sipfriends set name='1001',type='friend',context='internal',host='dynamic',disallow='all',allow='gsm',qualify='yes';
mysql&gt; insert into sipfriends set name='1002',type='friend',context='internal',host='dynamic',disallow='all',allow='gsm',qualify='yes';
</pre>
<p>Let&#8217;s move on to other configurations.</p>
<h3 id="head-d2545468bfd5bac0bd22a423df4dfd8dcb332aea">Server A :  /etc/asterisk/res_mysql.conf</h3>
<p>The file contains the database  details</p>
<pre>[general]
dbhost = 192.168.1.10
dbname = asterisk
dbuser = userA
dbpass = secretA
dbport = 3306
requirements=warn
</pre>
<h3 id="head-b8116cba3c530a875b75978e0f06133cfbd38902">Server B :  /etc/asterisk/res_mysql.conf</h3>
<p>If you didn&#8217;t configure two  separate users in MySQL, then Server A&#8217;s values could be used. But since  in my setup each server has a separate user, therefore the following is  needed</p>
<pre>[general]
dbhost = 192.168.1.10
dbname = asterisk
dbuser = userB
dbpass = secretB
dbport = 3306
requirements=warn
</pre>
<h3 id="head-c6a887145e9254f1f12c337ebb34e6bd3b321198">Server A  &amp; B : /etc/asterisk/extconfig.conf</h3>
<p>Here&#8217;s what should be there in  the file on both the servers</p>
<pre>[settings]
sipusers =&gt; mysql,general,sipfriends
sippeers =&gt; mysql,general,sipfriends
</pre>
<p>Now we&#8217;ll remove the users in sip.conf files on both the  servers (1001 &amp; 1002). You may want to comment them out by  prefixing a semi-conon (;).</p>
<h3 id="head-068c3c7123a67d7b34b074286df72b201b0c9c3b">Server A  &amp; B : /etc/asterisk/sip.conf</h3>
<p>We&#8217;ll just remove the sip user  entries (of 1001 &amp; 1002) in sip.conf file as it&#8217;s no longer needed.  And we&#8217;ll add one parameter &#8220;rtcachefriends&#8221; in the general context so  that users registered in real time are cached by sip and thus  qualify=yes works for them. You may omit it as per your requirements.</p>
<pre>[general]
regcontext=dundiextens
srvlookup=no
NAT=yes
bindport=5060
allowguest=no
canreinvite=no
rtcachefriends=yes
</pre>
<h3>Testing RealTime  Setup</h3>
<ol type="1">
<li>Unregister the phones from  Zoiper.</li>
<li>Restart asterisk and then open the consoles of Server A  &amp; Server B.
<pre>/etc/init.d/asterisk restart
asterisk -r
</pre>
</li>
<li>On Server C&#8217;s mysql prompt, if  you enter &#8220;show processlist&#8221;, you will two persistent connections from  both the servers. All&#8217;s good to go.</li>
<li>Now  try registering the phones. It should register. Server A&#8217;s asterisk  console should print out something similar to the following
<pre>CLI&gt; sip show peers
Name/username              Host            Dyn Nat ACL Port     Status       Realtime
1001/1001                  xx.xx.xx.xx     D   N       5060     OK (122 ms)  Cached RT
priv                       192.168.1.6         N       5060     Unmonitored
2 sip peers [Monitored: 1 online, 0 offline Unmonitored: 1 online, 0 offline]
CLI&gt;
</pre>
</li>
<li>Let&#8217;s try calling extension 1001  now from Server B selected in Zoiper.</li>
<li>It should playback the congratulations  message that we&#8217;d defined in extensions.conf.</li>
</ol>
<h2 id="head-840b0f4e741bc37eb0367a45219bd084d1cd2ed3">What&#8217;s next</h2>
<h3 id="head-9186a87a80a88885c2f5923e5f30a967d9259d43">Enabling  actual calling out</h3>
<p>Till now we had just used  playback. If you intend to actually call out the users, which of course  you&#8217;d want to do, then do the following.</p>
<p>/etc/asterisk/extensions.conf</p>
<pre>[general]
static=yes
writeprotect=no
autofallthrough=no
clearglobalvars=no
priorityjumping=no

[lookupdundi]
switch =&gt; DUNDi/priv

[internal]
exten =&gt; 123,1,Playback(demo-congrats)
exten =&gt; 123,n,Hangup()

include =&gt; dundiextens

exten =&gt; _XXXX,2,NoOp(internal context called on Server A to ${EXTEN})
exten =&gt; _XXXX,n,Dial(SIP/${EXTEN},10)
exten =&gt; _XXXX,n,Hangup()

include =&gt; lookupdundi

[incomingdundi]
exten =&gt; _XXXX,1,NoOp(Landed on Server A ${EXTEN})
exten =&gt; _XXXX,n,Goto(internal,${EXTEN},2)
</pre>
<p>If you notice, I&#8217;ve included &#8220;dundiextens&#8221; in the  &#8220;internal&#8221; context. This would allow you to call users who are  registered on the same server as yours. If they&#8217;re not registered, then  &#8220;lookupdundi&#8221; would be called. The SIP extension if found would ring for  10 seconds unless answered, and then hangup would be called. This is  very very basic, but it should give you an idea where to start.</p>
<h3 id="head-4265c529ce8bd1922cfab314a17f119d53ff3dd2">Using  extensions in RealTime</h3>
<p>If you plan  to use extensions also in RealTime instead of hard coding them, such as  for IVR, Voicemail etc. Then the following should work. I would prefer  that you don&#8217;t put the user extension information in there, but rather  use it as a replacement for extension 456 or extension 123 that we  created above.</p>
<p>In database,  the table structure would be</p>
<pre>CREATE TABLE `extensions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `context` varchar(20) NOT NULL DEFAULT '',
  `exten` varchar(20) NOT NULL DEFAULT '',
  `priority` tinyint(4) NOT NULL DEFAULT '0',
  `app` varchar(20) NOT NULL DEFAULT '',
  `appdata` varchar(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`context`,`exten`,`priority`),
  KEY `id` (`id`)
) ENGINE=MyISAM;
</pre>
<p>In /etc/asterisk/extconfig.conf you will add</p>
<pre>extensions =&gt; mysql,general,extensions
</pre>
<p>In /etc/asterisk/extensions.conf, in &#8220;internal&#8221; context  you will add</p>
<pre>switch =&gt; Realtime
</pre>
<p>As an example, let&#8217;s insert an Echo() application as  extension 100. Enter the following information in the database</p>
<pre>mysql&gt; insert into extensions set context='internal',exten='100',priority='1',app='Playback',appdata='demo-echotest';
mysql&gt; insert into extensions set context='internal',exten='100',priority='2',app='Echo',appdata='';
</pre>
<p>Restart asterisk and then try dialing out extension 100  from either Server A or B. One thing to note is that we are restarting  only because we&#8217;ve made significant changes in the configuration. The  best part of RealTime is that you don&#8217;t need to restart any of the  services if new SIP users are added, or new extensions are added.</p>
<h3 id="head-bc9e3c77246fd71804358eb4703fb47b1178afcd">Securing the  setup</h3>
<ol type="1">
<li>Secure the  SIP users. In the database, put some value for &#8220;secret&#8221; column.</li>
<li>Put firewall on your  servers. You need to open ports for SIP, for RTP and DUNDi. Here&#8217;s a  sample configuration
<pre># For IAX
$IPTABLES -A INPUT -p tcp --dport 4569 -j ACCEPT
$IPTABLES -A INPUT -p udp --dport 4569 -j ACCEPT
# For DUNDi
$IPTABLES -A INPUT -p tcp --dport 4520 -j ACCEPT
$IPTABLES -A INPUT -p udp --dport 4520 -j ACCEPT
# For SIP
$IPTABLES -A INPUT -p udp --dport 5060 -j ACCEPT
$IPTABLES -A INPUT -p udp --dport 5070 -j ACCEPT # In case bindport is different
# For SIP RTP
$IPTABLES -A INPUT -p udp --dport 10000:20000 -m udp -j ACCEPT

# In case bindport is different in sip.conf then you can do a bit of port forwarding
$IPTABLES -A PREROUTING -t nat -p udp --dport 5060 -j DNAT --to xxx.xxx.xxx.xxx:5070
</pre>
</li>
</ol>
<h3 id="head-9f80c3f811fb22e0d8c1b1c9e3cdfec52038ae0a">Do load  balancing &amp; fail over</h3>
<ul>
<li>Round Robin DNS for  poor man&#8217;s load balancing. This means having two (or more) &#8220;A&#8221; records  for your domain. The softphone would connect randomly to any. No failure  can be detected in this scenario, but still you can maintain uptime by  using linux-ha (high availability)</li>
<li>DNS SRV for load balancing as well as failover. Zoiper  supports DNS SRV and it&#8217;s not that difficult to implement. All you need  is a few SRV records in your DNS Server, and that&#8217;s pretty easy via  GoDaddy&#8217;s DNS. You can assign weight to each server as well as port  numbers, and the softphone would automatically connect to another server  in case the one it&#8217;s connected with goes down.</li>
<li>GeoDNS in case you are having users  spread across the globe. Have multiple registration servers spread all  over the world and use GeoDNS to make the user register to the ones  closest to them.</li>
<li>Have multiple dundi lookup servers in case dundi lookup  server itself goes down. Recommended is a High Availability scenario (ha  &#8211; <a href="http://linux-ha.org/">http://linux-ha.org/</a>)</li>
<li>MySQL Cluster  setup for database. So you&#8217;ll have high uptime.</li>
<li>Master Slave/Replication configuration of  MySQL for better performance. JR Richardson mentioned somewhere that we  can have multiple MySQL servers running &#8211; the data is read from one  database and written to another. This way we can have faster and  localized reads in case the servers are geographically apart.</li>
</ul>
<p>Hope  this serves a good purpose for you. Any comments or questions are  welcome.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=74&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2010/07/03/asterisk-basics-and-load-balancing-via-dundi/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2010/07/zoiperscreen01.png" medium="image">
			<media:title type="html">Zoiper Screenshot for DUNDi</media:title>
		</media:content>
	</item>
		<item>
		<title>Board800 now on Twitter!</title>
		<link>http://exain.wordpress.com/2010/04/03/board800-now-on-twitter/</link>
		<comments>http://exain.wordpress.com/2010/04/03/board800-now-on-twitter/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 16:55:44 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[board800]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/2010/04/03/board800-now-on-twitter/</guid>
		<description><![CDATA[Now also get updates of Board800 on Twitter<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=64&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Now also get updates of <a title="Follow board800 on twitter" href="http://twitter.com/board800">Board800</a> on Twitter</p>
<p><a href="http://twitter.com/board800"><img class="alignnone" title="Board800 on Twitter" src="http://board800.com/images/twitter.png" alt="Board800 on Twitter" width="100" height="37" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=64&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2010/04/03/board800-now-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>

		<media:content url="http://board800.com/images/twitter.png" medium="image">
			<media:title type="html">Board800 on Twitter</media:title>
		</media:content>
	</item>
		<item>
		<title>Board800 &#8211; My first Flex and Red5 Application</title>
		<link>http://exain.wordpress.com/2010/03/10/board800-my-first-flex-and-red5-application/</link>
		<comments>http://exain.wordpress.com/2010/03/10/board800-my-first-flex-and-red5-application/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 16:47:24 +0000</pubDate>
		<dc:creator>Vivek Kapoor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[board800]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[interactive whiteboard]]></category>
		<category><![CDATA[multiuser whiteboard]]></category>
		<category><![CDATA[red5]]></category>
		<category><![CDATA[whiteboard]]></category>

		<guid isPermaLink="false">http://exain.wordpress.com/?p=58</guid>
		<description><![CDATA[A few months back I was not even aware that it was now possible to do Adobe Flex development on Linux. Adobe has made the Flex SDK freely available, and Red5 is the media server which can easily integrate with a Flex application. The possibilities are endless, and I personally feel that this is the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=58&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A few months back I was not even aware that it was now possible to do Adobe Flex development on Linux. Adobe has made the Flex SDK freely available, and Red5 is the media server which can easily integrate with a Flex application.</p>
<p>The possibilities are endless, and I personally feel that this is the way future applications would be developed. What I thought Java Web Start could have achieved (had it been a bit faster and the plugin etc. didn&#8217;t involve huge download and cumbersome installation), now I see that in Adobe Flex.</p>
<p>Regardless, I spent last few months working on a Flex application, and it has now culminated into what I&#8217;ve named as Board800 (<a href="http://www.board800.com">http://www.board800.com</a>). It is an interactive multi-user whiteboard application, on the lines of Dabbleboard, though much simpler. You can use it to collaborate with other users, and also *purchase* it if you wish to deploy it on your own servers. Go check it out now! <a href="http://www.board800.com">http://www.board800.com</a></p>
<p><a href="http://www.board800.com"></a><a href="http://www.board800.com"><img class="aligncenter size-full wp-image-59" title="board800" src="http://exain.files.wordpress.com/2010/03/board800.png?w=525" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exain.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exain.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exain.wordpress.com&#038;blog=2191018&#038;post=58&#038;subd=exain&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exain.wordpress.com/2010/03/10/board800-my-first-flex-and-red5-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1739fc60506b838306ac94d040f9f41f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>

		<media:content url="http://exain.files.wordpress.com/2010/03/board800.png" medium="image">
			<media:title type="html">board800</media:title>
		</media:content>
	</item>
	</channel>
</rss>
