Tag Archives: thunderbird

Call popups with Asterisk and Thunderbird

There are several applications around for Windows users that offer popup notification of incoming calls to an Asterisk server, looking up the caller’s name in various Personal Information Managers (PIMs). Since I don’t use Windows, they’re not much use to me, so I wondered if there was anything available for Linux.

A Google a while back threw up this script by Olivier H. Beauchesne which looked promising. It does part of what I wanted—it generates a popup notification of incoming calls, but it makes no attempt to look up the name of the caller.

I considered writing something as a Thunderbird extension, but there seemed to be a couple of downsides to this approach:

  • From recent experience of working with Thunderbird’s address book for a click2dial extension I knew that it doesn’t lend itself well to look ups keyed on phone numbers
  • I wanted something that would always be running, irrespective of whether or not I’d fired up Thunderbird

I decided to have a go at hacking Olivier’s script, quite ambitious considering I’d never written anything in Python before.

It didn’t actually take much to get it to look up incoming numbers in a SQLite database. I then wrote a dirty Perl script to pull all the phone numbers out of my Thunderbird address book and populate the database. The Perl script was way to ugly to share and I always intended to tidy it up, but just never found the time. Until now.

callPopPy in action

callPopPy in action

A prolonged period off work sick has driven me to looking for things to keep my mind occupied, and so I’ve returned to this project. The Perl script has been scrapped. In it’s place I’ve written a Thunderbird extension named Squalit, a much neater solution. Squalit can export a single contact or an entire address book to the database, and can be configured to update the database periodically, ensuring that call popups and Thunderbird are always in sync.

I then turned my attention to the popup script itself. The original relied on libnotify and its Pyhon binding, pynotify. These are only available on Gnome based Linux distributions such as Ubuntu. I thought it would be useful to make everything more portable, so rewrote it to use a library I stumbled across by Daniel Woodhouse, gtkPopupNotify. After a fair few other changes I was left with a distant descendant of Olivier’s original script, which I’ve called callPopPy. callPopPy is portable enough that I’ve had it running on a Windows XP machine, and is doing just what I wanted on Ubuntu. The advantage of the two stage approach is that other utilities could be written to integrate callPopPy with other PIMs.

The combination of TBDialOut for click2dial with Squalit and callPopPy for call popup notification provides me with great integration between Thunderbird and my Asterisk server—I guess this is what is meant by CTI.


Dialing from Thunderbird’s address book: TBDialOut

I’ve had my first go at developing an extension for Thunderbird, the open source email client from Mozilla. The unimaginatively named TBDialOut is an extension that enables the user to place a phone call direct from Thunderbird’s address book.

I’ve actually been using an extension that does this for quite a while—VOIP3Dialer 1.1. But I recently upgraded to Thunderbird 3.1.7 from 2.something-or-other and VOIP3Dialer didn’t work with TB3. I really wanted to keep the funcionality that VOIP3Dialer offered, and with it not having been updated since July 2008, and its support web page gone it seemed there wasn’t much option but to learn how these extensions things work.

It didn’t take long to work out what had changed in Thunderbird’s address book to break things. That sorted, I started to look around a bit more and get to understand the inner workings of an extension. I ended up rewriting pretty much all of the functional code in VOIP3Dialer, and then started adding stuff.

TBDialOut introduces various user options, including a choice of URL schema to use and international dial prefixes. I then tackled the user interface. I added clickable links as well as the original context menu items and three buttons and made a few other usability tweaks. Finally, I changed the three buttons for a single, combined button that prompts the user to select which phone number to dial (home, work or mobile (cell phone)).

Screenshot of TBDialOut

TBDialOut in use

TBDialOut basically just passes the selected phone number to which ever programme is configured to handle the URL scheme you’ve chosen to use with TBDialOut. You can choose from sip:, tel:, callto: or skype:. I’m using it with a small Perl script that contacts my Asterisk server to set up a phone call. When I click on a number with TBDialOut the phones in the house ring out. Pick one up and you’re connected to the number you clicked.