Category Archives: asterisk

Caller Id in Kodi – Redux

I posted in this post about how I arranged to get caller-Id to show up in Kodi. At that time I was still using POTS, but since then I have switched to VoIP and set up Asterisk.

I did find another plugin that would connect to Asterisk and obtain information about incoming calls. But until now it was only half way working. I finally got around to paying attention to it. It was originally provided by “hmronline” and I found it at code.google.com. It was last worked on with Dharma, and I had to do some things to get it ready for Jarvis.

The source code is now in the tarragon svn repository, under the name KodiAsterisk. On coriander, where the production Kodi lives, there is a checked out directory under /Users/wmb called kodiasterisk. For Kodi to install it it has to be zipped, so the sequence is to svn update the directory, then zip the directory as script.service.dee-kodi-asterisk.zip. Then install it within Kodi.

It attaches to asterisk on cinnamon using the Asterisk manager interface.  Authentication on the manager interface uses files in /etc/asterisk/manager.d which has one file per authorized user, containing credentials.

The code has features to

  • give a notification of the caller id
  • put up a picture of the caller
  • pause a video if one is playing
  • redirect the call (within asterisk) if a video is playing
  • indicate whether there are voice mails

I have the notification running, the picture coming up, and the video being paused. I don’t use the redirect feature. Also, since my voice mail is not on Asterisk the features of voice mail aren’t being used.

I did put pictures into a folder within /Storage/Pictures/KodiPictures. The pictures here are named with the phone number, and contain a snapshot of the caller, in jpeg. If there is no picture in the folder for a particular number nothing is put up, but the notification and pausing still occur.

 

Getting Caller-ID Notifications in Kodi

Had a notion to try to get incoming calls to show caller id on the Kodi screen. I looked around and found an add-on, called service.script.call-notifications (at github) by “mablae”, which sounds like it does what I want. It wants to get call data from one of three types of sources, one of which is named NCID (network caller ID). Looked into that and it sounds like just the thing.
NCID styles itself a client-server-gateway caller id system, and is somewhat like the callblocker thing which I built a few years back for the Raspberry Pi. But this one has the added feature that it will put caller id stuff out on the network, where users, like the Kodi add-on above, can use it. It will also do blacklisting, which was the purpose of the thing I built. And, like mine, it will run on the Raspberry Pi.
NCID says it wants to run on the Raspbian OS (a debian spin specifically for the pi). It can be compiled for other linux distros, but I thought I might as well use Raspbian. I had a spare 8GB SD Card, so I downloaded Raspbian, burned the card, brought it up on the Pi and spent a few hours getting it set up right (got rid of user “pi”, installed user “dee”, got the certificates set up right so I can ssh to it, and it can ssh to others,etc.), and then I installed the NCID code.
Installation of the code was a little unusual. It isn’t in any of the apt sources I have. I downloaded the deb files they had, and then used a program called gdebi to install them. gdebi seems to be a debian thing. I haven’t used gdebi before. I had to install it (with apt-get). Apparently it is like dpkg, but it handles dependencies, which dpkg doesn’t. Usage is just gdebi <deb pkg name>.
Had a little trouble with the modem being recognized and mapped correctly, but after a little futzing around it got added by udev as ttyACM0, and the daemon ncidd was then able to find it. A little program called ncid which is a little graphical client was able to connect, and able to detect calls. I set up ncidd to start automatically. It has a config file /etc/ncid/ncidd.conf in which I specify the device (ttyACM0) and how to hang up on blacklisted entries (I chose 2: play a fax tone first, then hangup). I left other things at default.
Continue reading Getting Caller-ID Notifications in Kodi