Integrating Skype and Asterisk

Technology is changing the telecoms industry (and market) so rapidly it’s sometimes easy to lose yourself in the chaos, especially if you’re not interested/involved in the technology field. Telecom companies are typically manned by ‘traditional’ engineers/salespeople/managers that have no clue about (and no inclination to get involved with) new technology. Yet, VoIP is really taking off; the open nature of the internet and the neutrality of the net have made things happen. In this article I briefly provide an overview of Skype and Asterisk, two very popular, albeit very different software programs that are revolutionalising the way communicate over large distances. I focus on how these two, heterogeneous, platforms can work together to the benefit of commercial organisations and specifically small-medium enterprises (SMEs).

Skype

Skype is a very popular proprietary software VoIP communications service/program. It allows its users to communicate with audio (and video for those using Microsoft Windows and Skype 2.0 or higher) for free over the internet. It also provides inbound and outbound call services from (and to) the Plain Old Telephone Service (POTS). Those services are paid (non-free). The ability to call a POTS number using skype is called SkypeOut. Its cost is relatively modest, yet there are cheaper and more flexible SIP providers out there. The ability to accept calls made from a POTS phone is called SkypeIn. A user can select one or more telephone numbers — up to 10 — in several countries (US, UK, France, Hong Kong, Denmark, Finland, Sweden, Poland, Germany, Switzerland, Estonia, Australia, Brazil and Japan). While this is undoubtedly very useful for people that are or have friends away from their homeland, it can also make business sense as we’ll see later.

Asterisk

I’ve been dabbling at SIP for some years now, and it must have been in late 2003 that a friend introduced me to Asterisk, the Open Source, software IPBX. PBXs (or Private Branch eXchanges), for the non-tech people, resemble the equipment that telcos have to route calls, only they are usually much smaller. Typically companies buy hardware devices with a console that allow them to pool external lines, route external calls to the right destination, place internal calls between connected terminals, as well as an assortment of other services such as IVR (Interactive Voice Response), placing calls on Hold, playing music-on-hold, call forwarding/waiting, interface with trunk lines, allow PSI installations through trunk/rented lines etc.

This infrastructure typically costs in the tens of thousands, when one chooses the hardware route.

But Asterisk does all that and much more, and its free.

One of the things Skype has going for it is its popularity, the relative low cost and ease with which one can get a dial-in number in many geographically distant locations. I haven’t found another single company that can provide this service. The bad thing is that Skype is evidently not made for business. It is a cheap, high-tech alternative for consumers, but compared to the facilities provided by SIP, Asterisk and IAX2 it pales.

Wouldn’t it then be nice if you could integrate Skype with Asterisk, so that Skype looks like another channel from within Asterisk? You could then do all the fancy stuff Asterisk provides with your overseas ‘virtual’ lines courtesy of Skype.

This would be very useful for SMEs that would like to have a local phone number in other countries to maximise their appeal to consumers in those areas, without the cost of setting up a legal presence in those areas and/or the technical and financial overhead involved.

For example, a travel agent based in a Mediterranean country could have SkypeIn numbers in Germany, France, the UK and the US, allowing people in those countries to call a local (or ‘national’, but the distinction is kind of anachronistic in many parts of the world) number and talk to a sales advisor/representative. On the Asterisk side, the call could be routed to an operator that would speak the language and — in case such a person was unavailable — a message, in that language, could be played. Or, for the ultra-high-tech users, the company can have its own Skype name allowing people to contact them through Skype and route the call to an operator automatically. The possibilities are endless!

ipbx w/ skype

I searched the ‘net for existing software solutions that might serve as the ‘bridge’ between the two programs. Here are some of my findings:

Uplink

This is a free Windows Skype bridge that presents a SIP interface that Asterisk can make use of. You can get it from here.

I guess you might try running this using VMWare under linux, or, if you’re daring, Wine.

IASX

This is a project that has no running site, at the time of writing, so you might as well call it vapourware.

You can find the Google cache page here

It seems to be a bridge between Skype and IAX, the Inter-Asterisk eXchange protocol. I haven’t seen any code yet. It also seems to be exposing a Java interface from the little I’ve read over at the Skype forum.

Skype2PBX

Probably the least attractive of all options, this is just a software link between Skype and a USB FXS unit (called E-ZI Phonebox). You would need an FXO interface for your Asterisk machine to interface with it, so it’s not exactly what we need — or very elegant. You can find it here.

There’s also a bounty (currently at US$1545) that was started in November 2004 aimed at creating a link between the two. The page seems neglected and not up to date.

Some final words..

The Skype API only provides/allows access to control data/events. It doesn’t provide any audio data hooks. On Linux you’d have to override the read/write calls for the OSS channel (Skype does not support ALSA), or write a dummy audio device driver — something like this may already exist). All in all it is quite frustrating. 🙂

Skype/Asterisk integration seems like a very good idea for lots of people, considering the advantages offered by the popularity of Skype, its uniform and easy way to register POTS phone numbers in many locations in the world and the power offered by Asterisk.

Perhaps it’s time to say goodbye to your 15-20 year old, ultra-expensive and closed/proprietary PBX today!

A follow-up article with more solutions for integrating Skype and Asterisk can be found here.