PBX4Linux HOWTO

This is a simple howto to get PBX4Linux running quickly. The documentation is still essential to understand all features. You may start here if you are impatient.

Table of contents:

1. What you need
2. Downloading
3. Compile
4. Configure
5. Run PBX4Linux


1 What you need:

These parts are needed to use this pbx:
The 'mISDN' kernel driver is the next generation ISDN driver that will replace 'HiSax' driver. It is modular and provides CAPI. PBX4Linux doesn't use the CAPI interface, it interacts directly with the protocol layers of mISDN. The driver was developed for Kernel 2.6.0 or higher and may also work with kernel 2.4.xx / 2.5.xx.

To connect PBX4Linux to a telephone line, an ISDN card is needed that is supported by mISDN. Currently the supported cards are:
The HFC-S PCI cards are the cheapest ones, because they are used in mass production and offer large fifos.

To connect a telephone to PBX4Linux, a second ISDN card is needed. If no external line should be used, one card is enough of course. The card must be capable of NT-Mode. Currently only HFC-S PCI cards allow that. This mode allows to connect telephones as the card would be an NT. The NT-Mode is also supported by a library that comes with 'mISDN'.

In order to connect a telephone directly to a card, you need to:
All can be done easily by using an old NT. If you don't know what to do now, read the documentation on how to do this in details. Here is an easy way on doing it, if you wan't to start quickly:
NOTE: Ethernet cross link cables don't work, because they use differen pairs than ISDN does.

Plug one end of your new cross link cable to your ISDN card that should run in NT-Mode, and one to your telephone. If you need external power supply, connect an old NT to your ISDN card using the cross link cable, and your telephone with a NORMAL ISDN (or Ethernet) cable to your NT, using the second plug.

This is all you physically need, now get the software and get it to work.


2 Downloading:

Visit the homepage http://isdn.jolly.de and get:

3 Compile:

Begin with the kernel first. You need to do the following konfigurations:
  +------------------------------------ ISDN subsystem ------------------------------------+
  ¦  Arrow keys navigate the menu.  <Enter> selects submenus --->.  Highlighted letters    ¦
  ¦  are hotkeys.  Pressing <Y> includes, <N> excludes, <M> modularizes features.  Press   ¦
  ¦  <Esc><Esc> to exit, <?> for Help.  Legend: [*] built-in  [ ] excluded  <M> module     ¦
  ¦  < > module capable                                                                    ¦
  ¦ +------------------------------------------------------------------------------------+ ¦
  ¦ ¦             [*] ISDN support                                                       ¦ ¦
  ¦ ¦                   Old ISDN4Linux  --->                                             ¦ ¦
  ¦ ¦             ---   CAPI subsystem                                                   ¦ ¦
  ¦ ¦             <*>   CAPI2.0 support                                                  ¦ ¦
  ¦ ¦             [ ]     Verbose reason code reporting (kernel size +=7K)               ¦ ¦
  ¦ ¦             [ ]     CAPI2.0 Middleware support (EXPERIMENTAL)                      ¦ ¦
  ¦ ¦             < >     CAPI2.0 /dev/capi support                                      ¦ ¦
  ¦ ¦             ---     CAPI hardware drivers                                          ¦ ¦
  ¦ ¦                     Active AVM cards  --->                                         ¦ ¦
  ¦ ¦                     Active Eicon DIVA Server cards  --->                           ¦ ¦
  ¦ ¦                     Modular ISDN driver  --->                                      ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ +------------------------------------------------------------------------------------+ ¦
  +----------------------------------------------------------------------------------------¦
  ¦                            <Select>    < Exit >    < Help >                            ¦
  +----------------------------------------------------------------------------------------+


  +--------------------------------- Modular ISDN driver ----------------------------------+
  ¦  Arrow keys navigate the menu.  <Enter> selects submenus --->.  Highlighted letters    ¦
  ¦  are hotkeys.  Pressing <Y> includes, <N> excludes, <M> modularizes features.  Press   ¦
  ¦  <Esc><Esc> to exit, <?> for Help.  Legend: [*] built-in  [ ] excluded  <M> module     ¦
  ¦  < > module capable                                                                    ¦
  ¦ +------------------------------------------------------------------------------------+ ¦
  ¦ ¦                <M> Support modular ISDN driver                                     ¦ ¦
  ¦ ¦                [*]   Support for AVM Fritz!Cards                                   ¦ ¦
  ¦ ¦                [*]   Support for HFC PCI cards                                     ¦ ¦
  ¦ ¦                [*]   Support for Sedlbauer Speedfax+                               ¦ ¦
  ¦ ¦                [*]   Support for ...                                               ¦ ¦
  ¦ ¦                [*]   Digital Audio Processing of transparent data                  ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ ¦                                                                                    ¦ ¦
  ¦ +------------------------------------------------------------------------------------+ ¦
  +----------------------------------------------------------------------------------------¦
  ¦                            <Select>    < Exit >    < Help >                            ¦
  +----------------------------------------------------------------------------------------+
This is all you need to enable: The CAPI2.0 support and the modular ISDN driver (mISDN). Be sure to compile them as modules. Select the cards you need (maybe all, since they are only loaded when needed).

Compile your kernel as usual, reboot and test it.

At last you need to create the new "/dev/mISDN" device, if not already:
$ mknod /dev/mISDN c 46 0
In order to access mISDN driver device and have the NT-mode, install mISDNuser package.
$ tar -xvzf mISDNuser-x.xx.tar.gz

$ cd mISDNuser

$ make
Two libraries will be created:
Be sure to use the same directory where you will uncompress the PBX. The paths to the libraries are relative in the Makefile of the PBX. If you choose different locations, you must edit the Makefile.

Compile PBX4Linux:

$ tar -xvzf pbx4linux_xxxxxxxx.tar.gz

$ cd pbx4linux
Edit the 'Makefile'. At the line "WITH-H323", write '#' in front of it to comment it out. You will need it later when you like to add H.323 support. But first get the PBX running without H.323.

Compile and install the PBX:
$ make

$ make install
Configuration files, documents and data files will be installed by default at: "/usr/local/pbx" Edit the "Makefile" in order to choose a different location. Don't worry about your old configuration files, you might already have from older version. New files will only be installed, if they don't exist already. If they don't exist, default configuration files will be installed. The binaries are installed at "/usr/local/bin" by default.

Please refer to www.openh323.org for installation instruction of OpenH323.


4 Configuration:

Begin with creating an rc-script that is used to start and stop mISDN driver. Follow the instruction there. 'genrc' will ask for the locations of the modules. If you have problems with that, refer to the documentation. Run it with:
$ genrc
Be sure that the mISDN-modules are loaded. The first thing will be to query the current available isdn ports:
$ pbx query
** PBX4Linux **  Version 2.0 (Dec 2003)

Port  1: NT-mode BRI S/T interface port (for phones)
Port  2: TE-mode BRI S/T interface line (for phone lines)
 -> Interface is port-to-point
 -> Protocol: DSS1 (Euro ISDN)
$
In this case there are two ISDN cards available with mISDN driver. The first card runs in NT-mode and the second in TE-mode. The NT-mode must not have any protocol. The TE-mode must have DSS1 protocol loaded. PBX4Linux will give notice if something is not correct here.

You need to edit "options.conf" which is found in the installation directory ("/usr/src/pbx"). Three things are importaint here to make PBX4Linux run. Add the "ulaw" keyword in case PBX4Linux should run as u-LAW. (USA) In Europe we all use a-LAW encoded audio streams.
Versions < 3.0: Edit the "if_nt" and "if_te" option. The parameters must be as shown from the query option. In the case above we use port 1 for NT-mode and port 2 for TE-mode. (use "if_nt 1" and "if_te 2")
Versions >= 3.0: Edit the "port" option. The parameter must be as shown from the query option. In the case above we use port 1 for NT-mode and port 2 for TE-mode. (add two lines: "port 1" and "port 2")

Versions < 3.0: Edit "numbering_int.conf" which is found in the installation directory ("/usr/src/pbx"). It will define what an internal phone can dial. For this tutorial we just want to dial external, dial internal, and dial test mode. Don't delete anything from this file, just consider the following dialing codes:
0	outdial
200	internal
201	internal
99	test

Edit "numbering_ext.conf" which is found in the installation directory ("/usr/src/pbx"). It will define how external calls are routed. It has the same format as "numering_int.conf". The extension 200 must be reached from extern:
1234	internal 200


Versions >= 3.0: Edit "routing.conf" which is found in the installation directory ("/usr/src/pbx"). It will define all numbers that can be dialed from external or internal phones. For this tutorial we just want to dial external, dial internal, and dial test mode. Don't delete anything from this file, just consider the following dialing codes:
[extern]
dialing=1234	: intern extension=200

[intern]
dialing=0	: outdial
dialing=200	: intern
dialing=201	: intern
dialing=99	: test
In both version we dial '0' to make an external calls. '200' will make an internal call to extension '200', '201' respectively. Dialing '99' will dial the test mode.
When an external call is received, the destination number is 'dialed' by the caller. For a normal multipoint ISDN line you will get some "MSN" numbers from your provider. In our case one is "1234". This number will be mapped to the internal extension 200. Other numbers may be used for other entensions or functions.

The last thing is to create and configure the extension. In our case we want to give our internal phone the extension number '200'. Because we have only one internal port available in this example, we need to give only the port number "1". Now incomming calls will ring on internal port "1". Our external phone number is "1234". The extension will then use it as outgoing caller ID for external calls. Run the genextension tool:
$ genextension 201 1 1234
The result and many more options are in "extensions/200/settings" which is found in the installation directory ("/usr/src/pbx").

Also be sure to program extension number '200' in your ISDN telephone for incomming and outgoing calls.


5 Run PBX4Linux:

$ pbx fork
Now PBX4Linux will start. Just enter "pbx" without any option for a list of options. If libraries or modules are missing, or errors in config files are found, you will now get notice about it.

Pick up your phone and see if you get a dial tone. If you don't hear anything, check cabeling and be sure to be connected to your internal ISDN port. If you hear an announcement, you might have not set the correct extension number '200'. Check MSN number of your telephone.

If you get a dial tone, dial "995". The test mode with test #5 will be called. You should now hear the 'call on hold' music. Now hang up and try to dial externally using prefix '0'. Call somebody who calls you back for incomming call test.

$ pbxadmin state
This tool is usefull to get an overview of what PBX4Linux is doing. It also shows the state of all calls and ISDN ports. Some hotkeys in the bottom line will change detail level.
This was too fast and you still have problems? Read the documenation and drop me a mail with improved guide.