Sunday, November 25, 2007

New Family Member

I now interrupt my irregular random, rambling feature to announce a new arrival to our family. Jaya gave birth to a baby girl last Wednesday (November 21st) evening :-). Unfortunately she (the baby) picked up some infection the same night and gave us some pretty anxious moments. She seems to be doing fine now though she's still in the hospital.

Saturday, November 17, 2007

Wireless bridging with Linksys WRT54G

I had bought a Linksys WRT54G (version 2.0) a few years back for home wireless networking. Since I already knew that it was Linux based and eminently hackable, choosing this particular router was a no brainer. However, I never really bothered to upgrade the firmware because the stock firmware served my needs. In fact, after I bought a Huawei ADSL modem with a 4-port switch and wireless, the WRT54G was idling in the back of my cupboard.

In my recent trip to San Jose (Sep/Oct), I was waxing ebulliently about VoIP ATA adapters to my friend Ramesh Panuganty when the topic of putting the VoIP phone in another room came up. These ATA adapters (Linksys PAP2T, Grandstream Handytone 503 etc) come with a regular ethernet port. Both our homes don't have a wired LAN configured, so this was a problem. When we looked at wireless bridging options, we found the solutions to be quite expensive and supported only one port (See Linksys WET54G for example, 90 bucks for 1 ethernet port!).

Compare that to the price of Linksys WRT54GL for only $64 at the same website. You can get other brands like Netgear or Buffalo for even cheaper. So the question of whether you can use these devices for bridging to LAN segments came up. A bit of googling and reading confirmed that this is called "Client-Bridge" mode and is supported by all of the open source firmware options for the WRT54G.

Incidentally, I was feeling a dire need for a ethernet hub to debug the SIP registration problems (no low end home networking switch seems to support span). Wouldn't it be nice to run tcpdump right on the WRT54G for this purpose? So it was time to dust out my little box and play with it. It turned out to be surprisingly simple. I initially downloaded the DD-WRT version which seemed to be more popular. Following the advice in the wiki pages, I first downloaded flashed the mini generic version of v23 SP2. Without even checking it out immediately upgraded to the WRT54G "voip" version (no good reason, the "voip" just sounded attractive :-). Wireless bridging worked beautifully. Just configured my SSID and my WEP key and everything worked flawlessly.

There was one small problem. After wasting half an hour on it I realized that my 4MB box had no free space to install tcpdump. So I switched to the mini WRT54G version which gave me enough space. After wasting another half an hour on it because I didn't configure the IP router and DNS correctly, I managed to install tcpdump package using ipkg. Only, tcpdump didn't work. I always got a bus error. Okay, what next?

Fortunately I had already downloaded X-WRT image bundled with the OpenWRT "White Russian" firmware. I download the X-WRT because it promised a better Web UI and I didn't really want to muck around with the CLI trying to configure the box. This one worked great. The original settings from the DD-WRT firmware worked fine for the OpenWRT firmware too. I was able to get tcpdump working. OpenWRT is more Linux/Debian like (more software options and no weird Microsoft like SP2 naming for the image). So everything is hunky-dory now :-).

Friday, November 16, 2007

SIP registration saga continued

I am currently using the Linksys PAP2 adapter because it has 2 SIP accounts allowing me to connect to either callcentric or gizmoproject. I have only one phone connected but switching the phone cord is easier than changing the configuration everytime. Any way, I noticed yesterday that sipsak on the PC was able to query without problems. But Linksys was still complaining that it couldn't contact the login server. Rebooting the Linksys didn't help. So I tried tshark on the PC and ran sipsak. In addition to the response to sipsak request, I noticed something strange. I was getting "401 SIP Status Unauthorized" packets coming to my PC. The content looked like some kind of Challenge for authorization which I confirmed by googling.

So it turned out that the BSNL Huawei modem had a messed up NAT. Response to the outgoing registration packets from the Linksys were coming to the PC! So I rebooted the modem but that didn't help either. I just retyped my password in the Linksys and that did the trick. I am reasonably confident that it was NAT translation issue; so BSNL is not at fault on this occasion. At least not since yesterday.

Thursday, November 15, 2007

BSNL Broadband SIP Access is down again

Well, what do you know. SIP registrations are failing again for my Bangalore connection for the last two days. I know for a fact that registrations are currently going through in my home town (Coimbatore) for both my parents and in my in-laws. As I mentioned in my earlier post, non standard ports currently work - I don't know how long it will last. So I am officially recommending Callcentric which allows SIP registrations on port 5080. Callcentric accounts are also more feature rich than Sipphone (which is used by Gizmo Project). For instance, Callcentric allows you setup speed dials in the server which can be accessed by a four digit code ("*75xx"). SIP to SIP calls are free and I am able to call my home town over SIP without problems.

Some one commented to my previous post that BSNL is blocking specific range of IP addresses which may very well be true. I tried logging out my PPPoE session a couple of times to get a new IP Address. It didn't seem to help, I didn't have the patience to keep trying. But really, this sucks.

Saturday, November 03, 2007

SIP registration successful again

My Grandstream device has successfully registered overnight with the which is the SIP server used by Gizmo Project. So this does seem to be a temporary problem. However, this keeps happening fairly regularly, I'll keep monitoring and post if I see the same problem again.

On a related note, it's pretty painful to debug what exactly going on with these headless devices. This is not just a Grandstream device issue. I face the same issue with the Linksys PAP2. Grandstream did provide logging to an external server which helped me quite a bit. However, I need either a hub or a low-end switch that can do span. I do have a Linksys WRT54G, I can put openwrt firmware and do tcpdump right on the box. That's a project for another day.

Incidentally the Grandstream box appears to be running Linux though Grandstream website makes no mention of it. I'd love to get a shell prompt on it. It's a very small and sleek device.

BSNL broadband blocks VoIP?

Yeah, yeah, it's been a while since I blogged. I won't bore you folks with miserable excuses. Let me jump right to the topic. I have this neat Grandstream Handytone 503 ATA (Analog Telephone Adapter) which allows me to connect a regular phone to it and make VoIP calls. I bought it from Telephony Depot, shipped to friend in the US and got it to India. Linksys PAP2 is more popular but this one is sleeker and has analog PSTN pass through which I liked (it doesn't work well with BSNL PSTN line, but that's a topic for another post). Any way, I have a VoIP account with Gizmo Project, voice quality is excellent, even better than Skype except for one small problem.

Suddenly, BSNL appears to blocking SIP ports. The clue is your device fails to register with the SIP server. For all I know this may be a regular thing because the problem keeps popping up for me once in a while in the short time I've used the device. I always thought it's a device issue but today I decided to dig deeper and here's what I found. Outgoing port 5060 (the SIP port) is definitely blocked for both tcp and udp (I test with an external BSD box where I have ssh access). So I found another VoIP provider called Callcentric which conveniently provides SIP port 5080 and SIP registration appears to go through fine.

The summary above looks simple but I had to go through a lot of trial and error. At first it appeared that ports 5061 through port 5080 were also blocked but right now just after I started posting this I was successfully able to get through to callcentric. I am using an excellent utility called sipsak to help me with debugging this. Any way, if BSNL is indeed blocking SIP calls that's really bad. VoIP is legal in India for individual users and BSNL has no right to do this. Ganesan