In recent issues of Computer Shopper UK, I’ve been looking at how to use OpenWRT on small routers, like the TP Link TL-WDR3600. Those articles aren’t online, but I thought I’d share one of the more useful tips from them, as it deserves a wider audience.
With OpenWRT, it’s simple to install Asterisk, giving you a software phone system, and the Luci web interface even lets you set up VoIP accounts and extensions very easily. As long as you don’t want anything too complicated, you should do fine. Sipgate is a popular choice of provider for many people; there are no monthly fees, and you can choose from local phone numbers all over the place – a tip I included in the article is to get a Belfast number, so people from the Republic of Ireland can call using their national 048 code, instead of having to make an international call to reach a number in the rest of the UK.
However, if you download the current release of OpenWRT right now, and install Asterisk, there’s a very good chance that simply adding a Sipgate account via the web interface won’t actually work, and you won’t be able to receive calls. This, is seems, is do to a bug in some of the underlying libraries. But after a bit of digging around, I came up with a solution. You’ll first need to set everything else up in the web interface, as making any changes there will overwrite the config files.
When that’s done, you need to edit the sip_peers.conf file. If your Sipgate ID is 1234567, then look for the section that starts
Within that section, change the type from ‘peer‘ to ‘friend‘, set ‘qualify‘ to ‘yes‘ and add a line for the dtmfmode:
dtmfmode = rfc2833
Now, edit sip_registrations.conf. Look for the line that registers with the provider; if the password is PASSWORD, then it will look something like this
register => 1234567:PASSWORD@peer-1234567_sipgate_co_uk
Since the problem seems to be with a name resolution library, you need to work out the IP address for the VoIP registrar, which in this case is 184.108.40.206. That ensures the router will find the correct system to register, but it still fails, as it looks like the Sipgate login process wants the domain included. So, you have to include that in the username part.
That’s simple enough, and the resulting line, which certainly made my Sipgate registration work perfectly under OpenWRT and Asterisk, looks like this (obviously, replace the user id and password with your own):
register => email@example.com:PASSWORD@220.127.116.11
And that should be it!