Caller ID displayed on your LinHES screen

In order to get your TV to display caller ID info while watching MythTV, you need to install NCID (network caller ID). NCID consists of the ncid server daemon (ncidd) and the ncid client program (ncid). The modem connects to the server and it makes the caller ID info available to all the clients on the network.

Requirements:

1) Caller ID capable modem. This can be an external serial modem, external USB modem or internal modem, but it must have caller ID capabilities. USB and internal modems may need other drivers installed to work. NCID can also get Caller ID info from a voip system or a YAC server.

2) NCID (network caller ID) package consisting of the ncid server daemon (ncidd) and the ncid client program (ncid)

This article will focus on installing the server and the client on your stand alone LinHES 6.02 box using an external serial modem (US Robotics V.92).

General outline:

  • install make (didn't come with R6.02)
  • get NCID. Latest version as of 4-3-10 is 0.76
  • make package
  • make package-install
  • edit the configuration files for ncidd and ncid
  • install ncidd as a service
  • install ncid as a service
  • in that order

Detailed outline:

At the time of this writing, LinHES does not have the make utilty installed by default, so we start by installing make.

  • All as root:
    pacman -S make
    
  • Next get the NCID source:
    cd /root
    mkdir ncidsrc
    cd ncidsrc
    wget http://sourceforge.net/projects/ncid/files/ncid/0.76/ncid-0.76-src.tar.gz/download
    tar xvzf ncid-0.76-src.tar.gz
    
  • Next make and install NCID:
    cd ncid
    make package
    make package-install
    
  • Next edit the ncidd daemon config file to tell ncidd where your modem lives. Mine is connected to ttyS1 (COM2) because I have a serial port IR receiver connected to to ttyS0 (COM1). It is best to specify your ttySx explicitly so edit /etc/ncid/ncidd.conf and set it to the ttySx that your modem is connected to:
    #####################
    # TTY Configuration #
    #####################
    
    # The default tty port: /dev/modem
    # set ttyport = /dev/cu.modem # Macintosh OS X
    # set ttyport = /dev/ttyS0
    set ttyport = /dev/ttyS1
    
  • Next edit /etc/ncid/ncid.conf. Change the default helper script from ncid-speak to ncid-mythtv.
    FROM:
    # default helper script
    set EXTPROG     ncid-speak
    

    TO:
    # default helper script
    set EXTPROG     ncid-mythtv
    
  • To install the ncidd server and the ncid client as services you need to create a run script for each of them. Be sure to make the scripts executable. R6.02 already had run and finish scripts in place (thanks devs!) but the finish scripts are unnecessary and can be deleted. At least one of the run scripts needs to be modified. Check them against the scripts below and edit them to match what is here.

/etc/sv/ncidd/run contents:

#!/bin/sh
exec 2>&1
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions

which ncidd > /dev/null 2>/dev/null
if [ $? = 0 ]
then
    stat_runit "Starting CallerID" 

    exec /usr/sbin/ncidd -D 2>&1 
fi

/etc/sv/ncid/run contents:

#!/bin/sh
exec 2>&1
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions

svwaitup -s 3 /var/service/ncidd || exit 1

which ncid 2>/dev/null >/dev/null

if [ $? = 0 ]
then
    if [ -f /var/service/ncidd/run ]
    then
        sv start ncidd
    fi

    stat_runit "Starting callerid client" 

    exec /usr/bin/ncid --no-gui --call-prog --program ncid-mythtv
fi

Now add the services in this order:

add_service.sh ncidd
add_service.sh ncid

That's it. Start watching a recording and give yourself a call! The Caller ID info does not display if a menu is on the screen, only while video is being displayed. You can adjust the time that the caller id info display stays on the screen independent of the other pop display boxes. It is the "UDP Notify OSD time-out" setting In the "Playback OSD" menu of the frontend setup screens.

If you run top, you should see ncidd listed as well as tclsh. For some reason ncid shows up as tclsh, I don't know why.

There are two log files you can look at. /var/log/ncidd.log This file will grow astronomically fast if ncidd is pointed at a serial port that is not available, as the daemon dies and the supervisor restarts it continuously. If you see this file growing huge immediately, stop the service with "sv stop ncidd" and start looking for problems. It also grows (but at a much slower rate) if the port is good but doesn't have a modem attached.

/var/log/cidcall.log will be empty until you get a call. All incoming calls are logged in this file.

Extras:
There is a Windows ncid client. If you have the ncid server running on your Myth box, you can run clients on other machines. You can install the Windows client and it will display all calls received in a window. You can also install the Linux client on your other Linux machines to see the calls coming in there, too.

Optional:

You can also edit the /etc/ncid/ncidd.alias file to change what name is diplayed with a given phone number, so you can have your friends nicknames displayed instead of the name that comes over the caller ID info from the phone company. Directions are in the file.

R6.03 Update:

If you have this installed under R6.02 and then upgrade to R6.03, R6.03 will overwrite the /etc/sv/ncid/run file and the /etc/sv/ncidd/run file with default files that don't work. Just recreate the files as show above and you will be back in business.

Links:

NCID home page
http://ncid.sourceforge.net/
Package Files
http://sourceforge.net/projects/ncid/files/
Man pages:
http://ncid.sourceforge.net/man/man.html