Saturday, March 24, 2007

Asterisk, Asterisk@Home, FreePBX, trixbox, etc.

One of the more daunting tasks was wading through all the bits that make up what many people simply call Asterisk. Asterisk is essentially a software application that provides PBX capabilities of IP based phone systems. In a nutshell what that means is that Asterisk can accept incoming calls, route them to an extension, and connect the call when the extension answers. Likewise for outbound calls, Asterisk allows an extension to make a call and Asterisk either connects the call to an outbound trunk or to another extension. This is roughly what a traditional PBX provides for a business. It allows multiple phones to share trunks (phone lines to and from the outside world) so that every phone doesn't need a separate phone line to the phone company. As well by allowing extension to extension calls without involving outside resources, calls within an organization can be free. But that is just the tip of the iceberg. A PBX can also provide voice mail services, music on hold (MOH), call queues, interactive voice response (IVR), etc.

Now Asterisk itself is quite a beast. Setting up an Asterisk system takes a lot of knowledge as its sheer flexibility makes it quite complex to configure. To alleviate some of that, freePBX was created to make simple things simple. freeBPX can be thought of as a configuration layer on top of Asterisk. It provides a web based administration tool to configure and monitor Asterisk. As well it provides a rather sophisticated set of dialplans that allow for some nice modules that make adding certain features easy.

To further simplify using Asterisk, another project was started called Asterisk@Home. This included creating a distribution including not only Asterisk and freePBX, but a pre-built version of CentOS (essentially a Redhat based Linux distribution), MySQL, SugarCRM, HUDlite, and more. This allows a less sophisticated (or lazy person such as me) to quickly get an Asterisk based system up and running. In fact, at the moment, I'm using the VMWare distribution of trixbox (the new name for Asterisk@home) hosted by my Windows MCE system. Yeah, I know, that's not the best place to run Asterisk, but it works for a playground for now.

Choice of providers and equipment

Another factor that got me started in this search for a home VoIP solution was that I had switched our home telephone service to SunRocket about a year ago. They had an offer for 2 years of unlimited service for $199 and that included an Analog Telephony Adapter (ATA). I'll have to say that in general I have been very please with SunRocket's service. It does what it says it does, and I think we've only experienced one outage, and that was brief, maybe part of a day. My biggest complaint with them is their lack of softphone support and no support for Bring Your Own Device (BYOD). This means you are locked into using only their provided devices.

I'd like softphone support so when I'm traveling (of which I did too much last year) I can get online where ever I'm at and make free calls without paying my hotel up to several dollars a call, or more when I'm travelling internationally. I'd also like softphone support so I can use my Windows Mobile based phone as a VoIP phone as there are many places that offer free Internet access, thus free calls without using up minutes of cellular time.

One of the biggest difficulties in trying to bring my own devices to SunRocket (even if it's not supported) was trying to get the SIP credentials for my ATA. SunRocket had sent me an Innomedia MTA6328-2Re to use to connect to their service. It took me almost 4 months to track down the credentials for that device as the various forums where they were discussed refused to post the credentials outright. I eventually found them at this blog. I originally wanted the credentials so I could use a softphone while travelling. But having them made it possible to get Asterisk working.

Apparently while I was doing this research and trying to get things working SunRocket started making it harder to bring a softphone. Not only do you now need the credentials, you need your SIP device to present specific user agent identification. This is apparently to prevent people from using the Xten (now CounterPath) X-Lite free softphone. SunRocket also changed what makes up the SIP credentials as well. More on this later.

Another interesting development has been the availability of the ATS 6011S cordless VoIP phone that has been selling for $50-$100 with an identical rebate making the device effectively free after rebate. This cordless phone has a built-in ATA/router in the charging stand. Normally the device is set up to automatically contact SunRocket to get provisioning information and new firmware. If on the other hand you connect a spare network connection to the LAN port (which by default provides DHCP addresses and has an address of 192.168.251.1) of the 6011S and use the administrative login found in this forum, you can change the WAN port to a static IP address on your private network, and either block the device from accessing the Internet using a router, or set the device's gateway and DNS servers to point to itself. Change the setting to allow remote management of the device over the WAN port and then connect the WAN port to your private network. Once that is done, you can then access the administrative settings on port 8080 and set the SIP settings to whatever you like. I created a SIP extension for the device in my Asterisk server and can now use it as an extension in my house.

Getting started

I decided to go down the path of VoIP when I stumbled across trixbox. I had heard a little about Asterisk, in particular Asterisk@Home while setting up my Linksys WRT54GL router. The DD-WRT firmware that I was investigating, due to its support for Quality of Service (QoS), had a version that supported VoIP. I can't say I ever really tried that distribution as the reports were that if you had to transcode a call because of different codecs being required for a single call, that the WRT54GL was too slow to perform that. In any case, this blog will be about my experiences and what I can share to pass along to others as the hunt was time consuming to say the least.