Caller ID displayed on your LinHES screen

Version 18 (jzigmyth, 06/13/2010 03:28 pm)

1 18 jzigmyth
h1. Caller ID displayed on your LinHES screen
2 1
3 2 jzigmyth
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.
4 2 jzigmyth
5 2 jzigmyth
h3. Requirements:
6 2 jzigmyth
7 3 jzigmyth
*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.  
8 2 jzigmyth
9 3 jzigmyth
*2) NCID (network caller ID) package* consisting of the ncid server daemon (ncidd) and the ncid client program (ncid)
10 1
11 2 jzigmyth
12 2 jzigmyth
13 15 jzigmyth
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).
14 2 jzigmyth
15 2 jzigmyth
h3. General outline:
16 2 jzigmyth
17 10 jzigmyth
* install make (didn't come with R6.02)
18 10 jzigmyth
* get NCID. Latest version as of 4-3-10 is 0.76
19 10 jzigmyth
* make package
20 10 jzigmyth
* make package-install
21 10 jzigmyth
* edit the configuration files for ncidd and ncid
22 10 jzigmyth
* install ncidd as a service
23 10 jzigmyth
* install ncid as a service
24 10 jzigmyth
* in that order
25 3 jzigmyth
26 3 jzigmyth
h3. Detailed outline:
27 3 jzigmyth
28 3 jzigmyth
At the time of this writing, LinHES does not have the make utilty installed by default, so we start by installing make.
29 3 jzigmyth
30 10 jzigmyth
* All as root:
31 8 jzigmyth
<pre>
32 8 jzigmyth
pacman -S make
33 8 jzigmyth
</pre>
34 3 jzigmyth
35 10 jzigmyth
* Next get the NCID source:
36 8 jzigmyth
<pre>
37 8 jzigmyth
cd /root
38 8 jzigmyth
mkdir ncidsrc
39 8 jzigmyth
cd ncidsrc
40 1
wget http://sourceforge.net/projects/ncid/files/ncid/0.76/ncid-0.76-src.tar.gz/download
41 1
tar xvzf ncid-0.76-src.tar.gz
42 8 jzigmyth
</pre>
43 1
44 9 jzigmyth
45 10 jzigmyth
* Next make and install NCID:
46 1
<pre>
47 1
cd ncid
48 1
make package
49 8 jzigmyth
make package-install
50 1
</pre>
51 10 jzigmyth
52 15 jzigmyth
* 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:
53 8 jzigmyth
<pre>
54 8 jzigmyth
#####################
55 8 jzigmyth
# TTY Configuration #
56 8 jzigmyth
#####################
57 8 jzigmyth
58 8 jzigmyth
# The default tty port: /dev/modem
59 8 jzigmyth
# set ttyport = /dev/cu.modem # Macintosh OS X
60 8 jzigmyth
# set ttyport = /dev/ttyS0
61 8 jzigmyth
set ttyport = /dev/ttyS1
62 8 jzigmyth
</pre>
63 5 jzigmyth
64 14 jzigmyth
* Next edit /etc/ncid/ncid.conf.  Change the default helper script from ncid-speak to ncid-mythtv.
65 14 jzigmyth
FROM:
66 14 jzigmyth
<pre>
67 14 jzigmyth
# default helper script
68 14 jzigmyth
set EXTPROG     ncid-speak
69 14 jzigmyth
</pre>
70 14 jzigmyth
TO:
71 1
<pre>
72 14 jzigmyth
# default helper script
73 1
set EXTPROG     ncid-mythtv
74 14 jzigmyth
</pre>
75 1
76 1
77 17 jzigmyth
* 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.
78 1
79 15 jzigmyth
/etc/sv/ncidd/run contents:
80 1
81 15 jzigmyth
<pre>
82 15 jzigmyth
#!/bin/sh
83 15 jzigmyth
exec 2>&1
84 15 jzigmyth
export TERM=linux
85 15 jzigmyth
. /etc/rc.conf
86 15 jzigmyth
. /etc/rc.d/functions
87 1
88 15 jzigmyth
which ncidd > /dev/null 2>/dev/null
89 15 jzigmyth
if [ $? = 0 ]
90 15 jzigmyth
then
91 15 jzigmyth
	stat_runit "Starting CallerID"
92 15 jzigmyth
	
93 15 jzigmyth
	exec /usr/sbin/ncidd -D 2>&1 
94 15 jzigmyth
fi
95 15 jzigmyth
</pre>
96 1
97 1
98 1
/etc/sv/ncid/run contents:
99 15 jzigmyth
100 1
<pre>
101 15 jzigmyth
#!/bin/sh
102 15 jzigmyth
exec 2>&1
103 15 jzigmyth
export TERM=linux
104 15 jzigmyth
. /etc/rc.conf
105 15 jzigmyth
. /etc/rc.d/functions
106 15 jzigmyth
107 17 jzigmyth
svwaitup -s 3 /var/service/ncidd || exit 1
108 15 jzigmyth
109 15 jzigmyth
which ncid 2>/dev/null >/dev/null
110 15 jzigmyth
111 15 jzigmyth
if [ $? = 0 ]
112 15 jzigmyth
then
113 15 jzigmyth
	if [ -f /var/service/ncidd/run ]
114 15 jzigmyth
	then
115 15 jzigmyth
		sv start ncidd
116 15 jzigmyth
	fi
117 15 jzigmyth
118 1
	stat_runit "Starting callerid client"
119 15 jzigmyth
	
120 15 jzigmyth
	exec /usr/bin/ncid --no-gui --call-prog --program ncid-mythtv
121 15 jzigmyth
fi
122 15 jzigmyth
</pre>
123 15 jzigmyth
124 15 jzigmyth
Now add the services in this order:
125 15 jzigmyth
126 15 jzigmyth
<pre>
127 15 jzigmyth
add_service.sh ncidd
128 15 jzigmyth
add_service.sh ncid
129 15 jzigmyth
</pre>
130 15 jzigmyth
131 15 jzigmyth
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.
132 15 jzigmyth
133 15 jzigmyth
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.
134 15 jzigmyth
135 17 jzigmyth
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.
136 15 jzigmyth
137 15 jzigmyth
/var/log/cidcall.log will be empty until you get a call.  All incoming calls are logged in this file.
138 15 jzigmyth
139 15 jzigmyth
140 15 jzigmyth
Extras:
141 15 jzigmyth
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.
142 15 jzigmyth
143 15 jzigmyth
h3. Optional:  
144 15 jzigmyth
145 15 jzigmyth
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.
146 16 jzigmyth
147 16 jzigmyth
148 16 jzigmyth
149 16 jzigmyth
h3. Links:
150 16 jzigmyth
151 16 jzigmyth
NCID home page
152 16 jzigmyth
http://ncid.sourceforge.net/
153 16 jzigmyth
Package Files
154 16 jzigmyth
http://sourceforge.net/projects/ncid/files/
155 16 jzigmyth
Man pages:
156 16 jzigmyth
http://ncid.sourceforge.net/man/man.html