Sipgate, Asterisk and OpenWRT

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

[peer-1234567_sipgate_co_uk]

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 217.10.79.23.  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 => 1234567@sipgate.co.uk:PASSWORD@217.10.79.23

And that should be it!

One thought on “Sipgate, Asterisk and OpenWRT

  1. I have been able to setup successfully with the VMWare setup since I couldn’t figure out the settings for the ATA with Asterisk installed on a DD-WRT router. However, thanks to the info provided by barebottoms, I was able to get a little bit further with a registration state showing “on-line.” Unfortunately, incoming and outgoing calls apparently don’t go through to the ATA. With outgoing, I hear the wait-to-connect, 75, music (also, my GV number appears on CW after ~20 seconds). Incoming calls placed to my GV number show up on SIPgate, and get transferred to every other phone but the one connected to the ATA. I ran into a few errors, mainly with installing the Asterisk web interface (seemingly installs fine but I can’t access the web page, but this shouldn’t be critical. Any input would be appreciated! Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *