Asterisk Installation on IPCop

This guide refers to Asterisk version 1.4.19.1 and IPCop version 1.4.18

Index

Why

IPCop Firewall is a compact GNU/Linux distro
with a simple (and multilanguage) installer
integrated support for several traditional modems, ISDN and ADSL
a respectable choice of addons
and a graphic interface, also multilanguage, allows configuration of the numerous features.

The modest hardware resources needed, the relative simplicity of configuration and maintenance
and the general compactness of the system
makes it a good platform for creating a cheap telephone system.

Preparing

It’s not possible to compile Asterisk directly on the already running IPCop system
because the compiler is not available: IPCop is a firewall, it does not include development tools.
It’s necessary to recreate the entire distro, using another Linux box with the suitable instruments.

This has been executed on Debian Etch, as the root user.
Assure to have about 2.1GB of free space on the disk drive.
Documentation to compile IPCop on other distros is available here

  • Satisfy the dependencies:
    apt-get install bzip2 realpath cvs make
  • Download the IPCop sources:
    wget http://switch.dl.sourceforge.net/sourceforge/ipcop/ipcop-1.4.18-sources.tgz
    those sources are mainly scripts which simplifies the IPCop creation.
  • Uncompress the sources:
    tar xzvf ipcop-1.4.18-sources.tgz
  • Access the sources folder: (the next commands, from now on, will be executed from this folder)
    cd ipcop-1.4.18
  • Download the IPCop packages:
    ./make.sh getothersrc
    A 278M file will be downloaded.
    It’s possible to interrupt the download whenever, pressing CTRL+C: the next execution will resume the file, using another Sourceforge mirror
  • Download the toolchain:
    ./make.sh gettoolchain
    It’s the environment to compile IPCop
  • IPCop creation:
    ./make.sh build
    This step, on an 800MHz Athlon with 512MB of RAM required around 9 hours
    while on a 3GHz Pentium 4 with 2GB of RAM required around 3 hours

Various IPCop images will be created, among which the ISO image ipcop-1.4.18-install-cd.i386.iso

Compiling Asterisk

Here is available, from the IPCop web site, the documentation to compile additional packages.

The compilation of each component of IPCop is driven by a corresponding file, in the lfs folder.
To include Asterisk in the creation of the ISO, the lfs/asterisk should be created

  • Copy this file in the lfs folder of IPCop:
    cp asterisk <ipcop>/lfs/

The compilation of Asterisk in the IPCop toolchain will require Wget:

  • Copy this file in the lfs folder of IPCop:
    cp wget <ipcop>/lfs/

To enable the compilation of the two newly created packages
edit the make.sh file adding at the end of the buildipcop() function the following:
ipcopmake wget
ipcopmake asterisk

the result should be as this file.

  • Recompile the whole, with the command:
    ./make.sh build
    This time it will require much less time: only the two new packages will be compiled

The two newly created packages will NOT be automatically included in the ISO:
it’s necessary to write the name of their files, each one, in the src/ROOTFILES.i386 file

  • Add the names of the files of Wget and Asterisk in the file for the ISO creation:
    cat log/wget-1.11 >> src/ROOTFILES.i386
    cat log/asterisk-1.4.19.1 >> src/ROOTFILES.i386
    remove the beginning “+” char, resulting a file like this

To execute Asterisk at boot time, it’s first necessary to create an un’init script

  • Copy this file in the build/etc/rc.d folder of IPCop:
    cp rc.asterisk <ipcop>/build/etc/rc.d/
  • Give it execution permission:
    chmod +x <ipcop>/build/etc/rc.d/rc.asterisk

and edit the <ipcop>/etc/rc.d/rc.sysinit file to use it:
by adding etc/rc.d/rc.asterisk start to the end of the file, resulting this.

Note that also the etc/rc.d/rc.asterisk file should be present in the src/ROOTFILES.i386 ISO creation file

  • Rebuild the whole, with the command:
    ./make.sh build
    The resulting ipcop-1.4.18-install-cd.i386.iso file will include Wget and Asterisk which will be executed at boot time.

Download ISO

Download here the resulting ISO: IPCop 1.4.18 i386 with Asterisk 1.4.19.1
The official Asterisk release announcement is here: http://www.asterisk.org/node/48471
The MD5 digest is 11f7d4c7eaa85772b02335211f485960

  • Asterisk is started at boot time
  • The Asterisk init script is /etc/rc.d/rc.asterisk
  • The configuration files of Asterisk, in /etc/asterisk, are the default ones
  • Login the Asterisk command line interface with the command: asterisk -r
  • Wget 1.11 is also included

Download IPCop Asterisk Addon

Download here the Asterisk 1.4.19.1 package as an IPCop 1.4.18 i386 addon
The official Asterisk release announcement is here: http://www.asterisk.org/node/48471
The MD5 digest is 8d5a4371af7a065dce403fbf089e4c98

  • Copy it on the already running IPCop 1.4.18 system
  • Uncompress and execute the installation script install with the command: ./install -i
    Asterisk 1.4.19.1 will be installed, together with it’s configuration files
    and the init script for boot time execution
  • The Asterisk init script is /etc/rc.d/rc.asterisk
  • The configuration files of Asterisk, in /etc/asterisk, are the default ones
  • Login the Asterisk command line interface with the command: asterisk -r
  • Uninstall Asterisk with the install script, with the command: ./install -u

Suggestions

  • Remember to open the corresponding network ports of the protocols which are going to be used: for example port 5060 (udp) and ports from 10000 to 20000 (udp) for SIP, port 4569 (udp) for IAX2 and port 1720 (tcp) and from 10000 to 20000 (tcp and udp) for H.323
    by using the IPCop graphic interface at the Firewall -> External Access page
  • Teach logrotate to manage the Asterisk log files
    if you foresee that those are going to grow up till affecting the system operativity
  • Optimize the traffic, configuring the QOS / Traffic Shaping features of IPCop
    by using the IPCop graphic interface at the Services -> Traffic Shaping page
  • Rebuild the Kernel of IPCop to include, for example, the zaptel module
    if you foresee to use dedicated hardware

Italian Flag

This guide is also available in Italian


AddThis social bookmarking image button
Creative Commons License

One Response to “Asterisk Installation on IPCop”

Leave a Reply