README.OpenPRI
==============

Last updated: 3 March 2009


Introduction
------------

The Voicetronix Primary Rate ISDN (PRI) card unites Sangoma's ISDN technology
with the common API used by all other Voicetronix cards.  To use them, the
Sangoma Wanpipe drivers must be installed before compiling the Voicetronix
driver package.


Wanpipe Driver Installation
---------------------------

As of this writing, the current recommended Wanpipe driver is version 3.1.15,
available from the downloads area of the Voicetronix website:
http://www.voicetronix.com/Downloads/wanpipe/

It has been tested on Debian GNU/Linux 5.0 (Lenny).

Before attempting the installation, a number of packages are required.

	i.	C and C++ development tools (gcc, g++)
	ii.	make
	iii.	ncurses library
	iv.	awk
	v.	flex
	vi.	patch
	vii.	yacc
	viii.	libz
	ix.	libpci (also known as pciutils)
	x.	linux kernel headers

Note that most of the linux distributions will have binary versions of all these packages, 
albeit with different names. See Appendix A for exact package names for Debian.

Now you are ready to downloaded the wanpipe driver, unpack the archive, change into its 
directory and under the root user run:

# ./Setup install

For most questions, 'y' or the default option should be sufficient.  You will
require the custom compilation mode (option 9) and then select only AFT_TE1.
After this script completes, all further configuration of Wanpipe is performed
by utilities provided in the vpb-driver package.


VPB Driver Installation
-----------------------

If you have not already done so, unpack the vpb-driver archive, then change into
its directory and run as root user the commands:

# ./configure --with-pri 
# make
# make install

OR

$ ./configure --with-pri --enable-caslog 
# make
# make install

The --enable-caslog option should be used with the Voicetronix logger
application in CAS mode, or any other application requiring voice
activity detection.


Final Steps
-----------

Still working as the root user, use the VpbConfigurator script to
generate configuration files for both the Wanpipe and VPB drivers:

# ./src/utils/VpbConfigurator

This script will detect the cards you have in the system and ask questions for
anything it is unable to detect.  You will need to know in advance:

- your country code
  This is the code used for dialling your country from overseas.  For
  example, if you are in Australia it will be 61, if you are in the UK
  it will be 44, if you are in the US it will be 1, and so on.  If you
  don't know it, you can look for it here:
  http://en.wikipedia.org/wiki/List_of_country_calling_codes
- type of PRI connection
  This will be one of E1, T1, or J1.  E1 is the standard used throughout
  Europe, Australia, and some other places.  T1 is predominantly used in
  the USA, and J1 is used in Japan.
- mode of PRI connection
  This will be either client or network mode.  Most connections are client
  mode, unless you are connecting to equipment that would otherwise expect
  to be connected to a PRI line coming directly from a Telco.  If in doubt
  try client mode.

VpbConfigurator will write the files /etc/vpb/vpb.conf and
/etc/vpb/openpri.conf. These files may be modified for user specific
requirements.  See README.VpbConfig for available options.

You may now load the Wanpipe kernel modules:

# wanrouter start

You should see some initialisation messages reported to the system log file
(/var/log/messages or /var/log/syslog depending on your distro), and the OpenPRI
card(s) should appear in the output of "wanrouter status":

# wanrouter status

Devices currently active:
        wanpipe1


Wanpipe Config:

Device name | Protocol Map | Adapter  | IRQ | Slot/IO | If's | CLK | Baud rate |
wanpipe1    | N/A          | A101/2   | 201 | 14      | 3    | EXT | 0         |

Wanrouter Status:

Device name | Protocol | Station | Status        |
wanpipe1    | AFT HDLC | N/A     | Connected     |


You are now ready to start developing your CT software, or installing
pre-developed software such as CT Server (available from Voicetronix).

A.1 Debian Lenny
----------------
A number of packages are required before installing the OpenPRI driver.
Just install the following packages after a minimal stndard server NET install.

	i. 	gcc
	ii.	g++
	iii.	make
	iv.	libncurses5-dev
	v.	original-awk
	vi.	flex
	vii.	patch
	viii.	bison
	ix.	zlib1g-dev
	x.	pciutils-dev
	xi.	module-assistant

To set up your linux kernel headers correctly run

# module-assistant prepare

	
