FreeBSD Install

Last edited: Wed Feb 10, 2010

If NCID does not work, see INSTALL for some simple tests.
If using sip2ncid, see Setup-ncidsip
If using ncidsip, see Setup-ncidsip

COMPILE:

    - See Install

INSTALL:

	- install tcl/tk
	- make sure tcl calls tcl?.? and wish calls wish?.?,
	  otherwise modify the TCLSH and WISH variables in ncid

    - The NCID package normally installs in /usr/local:
    - If a binary package is available:
        Copy ncid-VERSION.freebsd.tgz to the FreeBSD computer, then:
            tar -xzvf ncid-VERSION-freebsd.tgz -C /
            EXAMPLE: tar -xzvf ncid-0.64-freebsd.tgz -C /
    - install NCID package:
        - if there is no binary package, you need to compile the source:
            Copy ncid-VERSION-src.tar.gz to the FreeBSD computer, then:
            tar -xzvf ncid-VERSION-src.tar.gz
            gmake freebsd (compiles for /usr/local, see top of Makefile)
            gmake freebsd-install

    If you want to use ncidsip:

    - Download, compile, and install the IO-Interface module from CPAN
    - Download, compile, and install the Net-Pcap module from CPAN

CONFIGURE:

    The ncidd.conf file is used to configure ncidd.

    - The default modem port in ncidd is /dev/modem.  This is just a
      symbolic link to the real modem port.
    - You should set the modem in ncidd.conf, if you are not using
      /dev/modem.  Use one of cuaa0, cuaa2, cuaa3, cuaa4 in /dev which
      corresponds to COM1, COM2, COM3, COM4
    - If you are using COM1 then you would add this line to ncidd.conf:
        set modem = /dev/cuaa0
    - If you are using a gateway instead of a local modem,
      you need to set noserial to 1:
        set noserial = 1
    - If you are using a local modem with or without a gateway
        set noserial = 0  (this is the default)

STARTUP:

    - If you are running the server and client on the same computer
      and using a modem:
        /usr/local/etc/rc.d/ncidd onestart
        ncid &

    - If you are running the server and using a SIP gateway:
        /usr/local/etc/rc.d/rc.d/ncidd onestart
        /usr/local/etc/rc.d/rc.d/sip2ncid onestart
        ncid &

    - If you are running the server and using a YAC gateway:
        /usr/local/etc/rc.d/rc.d/ncidd onestart
        /usr/local/etc/rc.d/rc.d/yac2ncid onestart
        ncid &

    - Call yourself and see if it works, if not, stop the gateway used:
        /usr/local/etc/rc.d/rc.d/sip2ncid onestop
      stop the server:
        /usr/local/etc/rc.d/rc.d/ncidd onestop
      and continue reading the test sections.

    - If everything is OK, enable the NCID server, gateways, and
      client modules, your are using, to autostart at boot:

    NOTE: ncid normally starts in the GUI mode and there is no
          ncid.rc script to start or stop it.  There are rc.d
          scripts for starting ncid with output modules, for
          example: ncid-page, ncid-kpopup, etc.

START/STOP/STATUS:

Use the /usr/local/etc/rc.d/ncid* scripts to start any of the daemons.
The rc.d commands are: start, stop, restart, reload, and status.  The
client can also be started using the output module name instead of ncid.
All output modules can be run at the same time.

Here are examples:

    sudo /usr/local/etc/rc.d/ncidd start
    sudo /usr/local/etc/rc.d/ncidd reload
    sudo /usr/local/etc/rc.d/sip2ncid restart
    sudo /usr/local/etc/rc.d/ncid-speak stop
    sudo /usr/local/etc/rc.d/ncid-page status
    sudo /usr/local/etc/rc.d/ncid-kpopup rcvar

If a service is not enabled, you must prefix one to the commands;
start becomes onestart, stop becomes onestop, and so forth.

AUTOSTART:

    If you want NCID services to start automatically at boot, you need to
    add an enable line /etc/rc.conf.local for each service you want started.
    If /etc/rc.conf.local does not exist, create it.

    Here is the list of of rc scripts and their enable lines:

        /usr/local/etc/rc.d/     /etc/rc.conf.local
        --------------------     ------------------
        ncidd                    ncidd_enable="YES"
        sip2ncid                 sip2ncid_enable="YES"
        yac2ncid                 yac2ncid_enable="YES"
        ncidsip                  ncidsip_enable="YES"
        ncid-page                ncidpage_enable="YES"
        ncid-kpopup              ncidkpopup_enable="YES"
        ncid-samba               ncidsamba_enable="YES"
        ncid-speak               ncidspeak_enable="YES"
        ncid-yac                 ncidyack_enable="YES"

TEST USING A MODEM:

    - The easiest way to test the setup is to run ncidd in debug mode,
      it will stay attached to the terminal and not go into daemon mode:
        ncidd -D
      to get more information, add the verbose flag:
        ncidd -Dv3
      to also look at the alias structure
        ncidd -Dv5

    - The last three lines will be similar to:
        Modem set for CallerID.
        Network Port: 3333
        Wrote pid 20996 in pidfile: /var/run/ncidd.pid
    - If last line says: ERROR
      try the CID strings in ncidd.conf or in doc/CID-init

    - Call yourself and you should see that the Caller ID lines.
    - If you only see RING for each ring, the modem does not support
      Caller ID.  You should see the Caller ID lines between the
      first and second RING.
    - If you see: /dev/ttyS1: No such file or directory
      you need to set sttyclocal in ncidd.conf

    - At any point, you can use command lines options to vary
      things like modem init and CID init.

    - Once it works, start in this order:
        /usr/local/etc/rc.d/ncidd onencidd
        ncid &

TEST USING A DEVICE (like the NetCallerID box):

    Start (in this order):
        /usr/local/etc/rc.d/ncidd onestart
        ncid &

    Call yourself

    if you have problems, start ncidd in debug mode:
        - ncidd -D
    to get more information, add the verbose flag:
        ncidd -Dv3
    to also look at the alias structure
        ncidd -Dv5
    The last three lines will be similar to:
        CallerID TTY port initialized.
        Network Port: 3333
        Wrote pid 20996 in pidfile: /var/run/ncidd.pid

    Once you solve any problems, restart ncidd normally

TEST USING sip2ncid:

    Review sip2ncid to see how to set up your network for SIP Invite packets.

    Start (in this order):
        /usr/local/etc/rc.d/rc.d/ncidd onestart
        /usr/local/etc/rc.d/rc.d/sip2ncid onestart
        ncid &

    Call yourself

    if you have problems, start ncidd in debug mode:
        - ncidd -D
    to get more information, add the verbose flag:
        ncidd -Dv3
    to also look at the alias structure
        ncidd -Dv5
    The last three lines will be similar to:
        CallerID only from CID gateways
        Network Port: 3333
        Wrote pid 20996 in pidfile: /var/run/ncidd.pid

    Once you solve any problems, restart ncidd normally

TEST USING yac2ncid:
        May need to add options to the configure file.

    Start (in this order):
        /usr/local/etc/rc.d/ncidd onestart
        /usr/local/etc/rc.d/yac2ncid onestart
        ncid &

    Call yourself

    if you have problems, start ncidd in debug mode:
        - ncidd -D
    to get more information, add the verbose flag:
        ncidd -Dv3
    to also look at the alias structure
        ncidd -Dv5
    The last three lines will be similar to:
        CallerID only from CID gateways
        Network Port: 3333
        Wrote pid 20996 in pidfile: /var/run/ncidd.pid

    Once you solve any problems, restart ncidd normally

GMAKE NOTE:

    - The NCID source package requires gmake.

	- The optional GNU getopt is installed from /usr/ports/devel/libgnugetopt:
        cd /usr/ports/devel/gmake
        make all install

GETOPT NOTE:

	- NCID will build as is.  It uses the included getopt_long(),

      If you would like to use the optional GNU getopt,
	  ncidd.h and getopt.c needs to have the __FreeBSD__
      removed and the following needs to be done:

	  The optional GNU getopt is installed from /usr/ports/devel/libgnugetopt:
        cd /usr/ports/devel/libgnugetopt
        make all install

	  The Makefile needs these two lines included for GNU getopt:
		MFLAGS = -I/usr/local/include
		LDFLAGS = -L/usr/local/lib -lgnugetopt
