Difference between revisions of "Network Caller ID (NCID)"

From MythTV Official Wiki
Jump to: navigation, search
(Initial Document)
Line 10: Line 10:
 
== [http://ncid.sourceforge.net Network Caller ID (NCID)] ==
 
== [http://ncid.sourceforge.net Network Caller ID (NCID)] ==
  
Network Caller ID is a freeware package that can be obtained from [http://ncid.sourceforge.net SourceForge].  It contains both the client and server package.
+
Network Caller ID is a freeware package that can be obtained from [http://ncid.sourceforge.net SourceForge].  It contains both the client and server package.  Configuring the server side of the package is outside the scope of this document.  This document focuses on the client configuration and its integration with MythTV.
 +
 
 +
Download the source for NCID and built it on each of the Frontend systems that you have.  If they are all the same architecture, then you can just build it on one and copy the tar file over to the others.  If you are running an RPM based distribution (like Fedora Core), try building your own RPM for your architecture and install it on each of the clients.
 +
 
 +
== The NCID Client on a MythTV Frontend ==
 +
 
 +
If you use the RPM method of installation, you will need to disable the server daemon and enable the client daemon on startup.  For some reason, the authors have the server daemon automatically enabled and the client daemon automatically disabled.
 +
<pre>
 +
#> chkconfig --level 345 ncidd off
 +
#> chkconfig --level 345 ncid on
 +
</pre>
 +
 
 +
The other catch is that, although there is an /etc/ncid/ncid.conf file, that file appears to be nothing more than a place holder under the RPM distribution.  '''You need to edit /etc/init.d/ncid''' in order for the client to do what we want it to:
 +
<pre>
 +
#!/bin/sh
 +
#
 +
# ncid          Start/Stop Network Caller ID client
 +
#
 +
# chkconfig: 2345 96 05
 +
# description: the ncid client sends the CID to an external program
 +
 
 +
# Source function library.
 +
. /etc/rc.d/init.d/functions
 +
 
 +
# Source networking configuration.
 +
. /etc/sysconfig/network
 +
 
 +
# Check that networking is up.
 +
[ ${NETWORKING} = "no" ] && exit 0
 +
 
 +
RETVAL=0
 +
prog="ncid"
 +
shell="tclsh"
 +
extprog="ncid-mythtv"
 +
opts="--no-gui -r 0 -C -P $extprog"
 +
...
 +
</pre>
 +
As seen above, the "extprog" has been set to "ncid-mythtv".  NCID has a plug-in to talk to mythtv via mythtvosd.  Save the updated init.d file.
 +
 
 +
The only other piece is to actually update the plugin "ncid-mythtv".  At some point in time, the option "--template" became a required option to "mythtvosd" and the "ncid-mythtv" plugin was not updated to reflect this new requirement.
 +
 
 +
With that said, edit /usr/share/ncid/ncid-mythtv and make the code at the end of the file look like:
 +
<pre>
 +
...
 +
if [ -n "$CIDNMBR" ]
 +
then
 +
    # Display Caller ID information
 +
    mythtvosd --template="cid" \
 +
              --caller_name="$CIDNAME" \
 +
              --caller_number="$CIDNMBR" \
 +
              --caller_date="$CIDDATE" \
 +
              --caller_time="$CIDTIME"
 +
else
 +
    # Display Message
 +
    mythtvosd --template="alert" --alert_text="$CIDNAME"
 +
fi
 +
 
 +
exit 0
 +
</pre>
 +
 
 +
Start the daemon:
 +
<pre>
 +
#> /etc/init.d/ncid start
 +
</pre>
 +
 
 +
And, with that, your MythTV FrontEnd will display incoming caller id information on the screen any time you are watching LiveTV or watching a Recording, all without having a phone line run to the box.  It will not display information when you are in the menus, watching a DVD Video in MythVideo, or at any other time.

Revision as of 04:29, 4 February 2007

Caller ID

Caller ID is defines as "The service that allows someone being called to see the caller's name and phone number." MythTV does not have the capability if displaying Caller ID information, but, with the right tools, this can be made to work.


Displaying Arbitrary Text On The MythTV Screen

As part of the entire MythTV bundle, there is a small script called myth2osd which allows for displaying any kind of text on the screen. Note that this only works when LiveTV, Recordings, or Videos are being displayed; it will not display anything when the menus are up.

Network Caller ID (NCID)

Network Caller ID is a freeware package that can be obtained from SourceForge. It contains both the client and server package. Configuring the server side of the package is outside the scope of this document. This document focuses on the client configuration and its integration with MythTV.

Download the source for NCID and built it on each of the Frontend systems that you have. If they are all the same architecture, then you can just build it on one and copy the tar file over to the others. If you are running an RPM based distribution (like Fedora Core), try building your own RPM for your architecture and install it on each of the clients.

The NCID Client on a MythTV Frontend

If you use the RPM method of installation, you will need to disable the server daemon and enable the client daemon on startup. For some reason, the authors have the server daemon automatically enabled and the client daemon automatically disabled.

#> chkconfig --level 345 ncidd off
#> chkconfig --level 345 ncid on

The other catch is that, although there is an /etc/ncid/ncid.conf file, that file appears to be nothing more than a place holder under the RPM distribution. You need to edit /etc/init.d/ncid in order for the client to do what we want it to:

#!/bin/sh
#
# ncid          Start/Stop Network Caller ID client
#
# chkconfig: 2345 96 05
# description: the ncid client sends the CID to an external program

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

RETVAL=0
prog="ncid"
shell="tclsh"
extprog="ncid-mythtv"
opts="--no-gui -r 0 -C -P $extprog"
...

As seen above, the "extprog" has been set to "ncid-mythtv". NCID has a plug-in to talk to mythtv via mythtvosd. Save the updated init.d file.

The only other piece is to actually update the plugin "ncid-mythtv". At some point in time, the option "--template" became a required option to "mythtvosd" and the "ncid-mythtv" plugin was not updated to reflect this new requirement.

With that said, edit /usr/share/ncid/ncid-mythtv and make the code at the end of the file look like:

...
if [ -n "$CIDNMBR" ]
then
    # Display Caller ID information
    mythtvosd --template="cid" \
              --caller_name="$CIDNAME" \
              --caller_number="$CIDNMBR" \
              --caller_date="$CIDDATE" \
              --caller_time="$CIDTIME"
else
    # Display Message
    mythtvosd --template="alert" --alert_text="$CIDNAME"
fi

exit 0

Start the daemon:

#> /etc/init.d/ncid start

And, with that, your MythTV FrontEnd will display incoming caller id information on the screen any time you are watching LiveTV or watching a Recording, all without having a phone line run to the box. It will not display information when you are in the menus, watching a DVD Video in MythVideo, or at any other time.