Incoming call popup under Ubuntu and Asterisk

When I worked in a survey firm, I was tasked with building a VOIP system to cut costs and to raise productivity. The biggest productivity drain in an outbound call center is the dialing time and getting someone on the line. By implementing an Asterisk server, we could control and expand the server to our needs. Furthermore, this meant we could have remote workers. We saved a bundle of money in long distance and in fixed costs. The hosted server and the bandwidth itself cost about 80$ a month, while the connectivity to the phone network was negligible and, more importantly, flexible. In other words, if it was a slow month, the cost was low, and conversely, if it was a very busy month, the costs were higher but the money was coming in.

Incoming call popup

Since it was my server and I was billing the company for it, I figured I could use the same server for my personal phones. So I decided to connect my PSTN numbers to this system. I could now use the server as my private VOIP server.

After configuring the VOIP server to my liking, I started to explore the Asterisk API and related Java and Python bindings. My first module was an interactive IVR system to manage callbacks from the survey outbound number. The callers could know who called them and remove their number from our calling lists.

In the same vein, I wanted a caller ID popup on my laptop everytime somebody would call me. Since I use Ubuntu, I wanted the notifier to be tighly integrated with the OS. I used the native notifying system called LibNotifiy. This notifying system has bindings in python and is thus interfaceable from python. Asterisk is also interfaceable from python via an API and a python module. The first module (libnotify) should be installed by default on any recent Ubuntu distribution and the second module, StarPy, can be downloaded from here: http://www.vrplumber.com/programming/starpy/

After installing the two preceding modules and lauching the following script, it will pop up a notification window each time you get a call. The configuration options are self-explanatory. The Asterisk Manager Interface and its firewall should be configured to allow access from the computer running the script. By adding the script in the startup application control panel, the script will launch at logon.

5 Thoughts on “Incoming call popup under Ubuntu and Asterisk”

I’m not sure why this wouldn’t work on Unity. Perhaps if you can let me know the errors you got I could make some suggestions, but I don’t have unity available myself. As far as I understand Unity includes Notify OSD, with which pynotify works.

Are you sure the issue is not your version of Asterisk? There was a change to the AMI API, between Asterisk 1.4 and 1.6 I think. If you are using a more modern version of Asterisk you will need to change the line

cid=event[‘callerid’]

to

cid=event[‘calleridnum’]

If you can’t get things working you could try my callPopPy, which was originally based on pyCalledMe. It has the option to use an alternative, more portable notification method. It’s perhaps a bit more difficult to set up though: