The gtalk/skype/sip/irc asynchronous UC mashup

March 14, 2011 at 4:41 pm 5 comments

I’m a regular visitor to the Voipuser’s conference – which is a weekly conference call about VoIP. The call is hosted on ZipDX’s wideband conference bridge. The quality of the guests combined with the HD audio on the bridge means that the recordings make decent pod casts.

For about a year now, we have been running a Skype gateway so that people who couldn’t or didn’t have time to set up a SIP device could call in (free) via skype.

Like most conference calls, it works best with a text back channel so that URLs, part numbers, email addresses etc don’t need to be laboriously spelled out. For historical reasons this is an IRC channel on . So a typical user would have a softphone fired up on their laptop for the audio and an IRC client for the text.

Skype users are very loyal to skype chat, so a few weeks ago I started looking at trying to bring the IRC chat to them in a more convenient way. Last week I got an experimental system running that did just that. Here is a sample  of the result:

A skype chat bridged to gtalk via irc

A skype chat bridged to gtalk via irc

In some ways that looks like an ordinary skype chat. Indeed for the skype user, that is exactly how it behaves, except that messages from the user are in fact from multiple IRC users.

If you look a little more carefully, you’ll see that there is discussion of a gtalk connection (google talk). That’s because I’d also made the system support connections from gtalk too.

So users from all three of the ‘islands’ in the VoIP world (SIP, Skype and GoogleTalk) could all participate on an equal basis in a conference about VoIP. Not only that, but their IM messages were also exchanged freely, all with the correct attribution.

How was this done?

Diagram showing asterisk/java/groovy bridging between gtalk and skype via irc

Asterisk is the key ‘glue’ here, with it’s support for Skype and Gtalk channels. But even Asterisk doesn’t support the kind of gatewaying we needed for the IRC . For that we needed the (excellent) asterisk-java package which communicates with Asterisk and allows you to manage and control calls in Java. I used the PircBot package to implement an IRC connection in Java.

As this was a prototype, I didn’t want to get bogged down in writing the gateway in Java, I wanted to use something more expressive and easier on the keyboard, so I used Groovy.

The end result was a very few lines of Groovy, here is the meat of it (sorry Jay) :

groovy code using closures for awk style pattern matching on Asterisk events

Now the fun and powerful thing about this code is that it is asynchronous and event driven. Each event from Asterisk is checked to see if it triggers any of our desired actions, but this triggering is done on a fine grain – in the last block we are only interested in Skype chat messages that are to the skype id ‘’. We can write expressive filters in code to do the matching, then define the action to carry out in just a few lines. The over all effect is like the syntax of unix’s AWK pattern matching language.

This is quite different from the kind of scripting you see in twilio, asterisk dialplan, tropo and other telephony scripting environments. They are all about call control, this is about call enhancement. A traditional telephony scripting language sets up the call, but once the 2 (or more) parties are talking they step out of the way. Here I’m adorning a live call with extra asynchronous information.

There are systems that do this sort of adornment – ZIP DX sends messages to the SIP clients throughout a call allowing phones to display the name of the current speaker – but that’s more of an endpoint feature (see also the very cool thrutu). In this case the adornment is taking place in the middle of the network and in the middle of the call – and thats new (at least to me).

I’ll be polishing the prototype and hopefully have it deployed in a stable basis in time for next Friday’s VUC.

Entry filed under: media, VoIP. Tags: , , , , , , , .

The way to create a new product or service when you already have one. The long slow death of Skype for Asterisk.

5 Comments Add your own

  • […] gtalk/skype/sip/irc asynchronous UC mashupBy Phil Wolff, on March 14th, 2011This is a guest post by Tim Panton, telephony/web 2.0 troublemaker, . @steely_glint.I’m a regular visitor to the […]

  • […] See the original post: The gtalk/skype/sip/irc asynchronous UC mashup « Baby is 60 – Tim … […]

  • 3. The gtalk/skype/sip/irc asynchronous UC mashup | Ugli  |  March 23, 2011 at 10:00 pm

    […] is a guest post by Tim Panton, telephony/web 2.0 troublemaker. […]

  • 4. Conference Calls  |  April 13, 2014 at 5:06 pm

    t’s a basic long-distance call for everyone and it beats the
    alternatives of trying to bridge five three-way calls together to get 15 people onto
    a conference call doesn’t it? Not to mention all the
    valuable features we offer including conference call recording, online conference
    management and easy host dial-pad controls to name a few.

    • 5. babyis60  |  April 13, 2014 at 6:04 pm

      I have the feeling you didn’t take the time to read my post, just dropped off a quick link to your service without bothering to understand what you were commenting on. If I’m right implies you won’t listen to your customers either. Not a good advert for your service I’m afraid, so I removed your URL to avoid embarrassment.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

Follow me on Twitter

%d bloggers like this: