HowTo install sipX 3.4 on Gentoo

From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia

Jump to: navigation, search
Important note: Ebuilds prior to 3.2 suffered from a problem that related to an incompatibility between pcre-3.9 used by Apache 2.0 and pcre >4.5 used by sipX. Starting with releases 3.2 / 3.4 we use the new Apache 2.2, which solves this problem. However, Apache 2.2 is still hard masked (see below on how to emerge it anyway).

Contents

USE Flags

The following USE flags are used. Adapt /etc/make.conf accordingly.

File: USE flags in /etc/make.conf
USE="minimal -perl -python -alsa apache2 libwww postgres -X -gnome -kde -qt -gtk java"

Note: "-alsa" disables building sipXmediaLib with local audio support. Local audio is not needed for a sipXpbx server. sipXmediaLib is also used with sipXphone and sipXezPhone, where local audio must be enabled. "doc" enables building doxygen developer documentation.

Note: Use flags "minimal -perl -python" were added so that subversion would build with the still hard masked Apache 2.2. We assume this will be fixed before it is finally released.

Install Layman

Gentoo uses a program called Layman to manage portage tree overlays. If you do not yet have it installed, you will need to before you can setup the sipX overlay.

Code: Install Layman
emerge --ask app-portage/layman

Be sure the follow the post-installation instructions to complete setup.

The sipX overlay is a Subversion overlay. To use it, you will also need to have Subversion installed.

Code: Install Subversion
emerge --ask subversion

Setup the sipX Overlay

You can use Layman to install the sipX overlay on your system.

Code: Install sipx Overlay
layman -a sipx

Unmask Masked Packages

File: /etc/portage/package.unmask - Enable Hard Masked Packages
 =net-www/apache-2.2.4
File: /etc/portage/package.keywords - Enable Masked Packages
 =www-apache/mod_cplusplus-1.5.2 ~x86
 =net-misc/sipxportlib-3.4.0 ~x86
 =net-misc/sipxtacklib-3.4.0 ~x86
 =net-misc/sipxcommserverlib-3.4.0 ~x86
 =net-misc/sipxmedialib-3.4.0 ~x86
 =net-misc/sipxmediaadapterlib-3.4.0 ~x86
 =net-misc/sipxcalllib-3.4.0 ~x86
 =net-misc/sipxvxml-3.4.0 ~x86
 =net-misc/sipxpublisher-3.4.0 ~x86
 =net-misc/sipxproxy-3.4.0 ~x86
 =net-misc/sipxregistry-3.4.0 ~x86
 =net-misc/sipxconfig-3.4.0 ~x86
 =net-misc/sipxpbx-3.4.0 ~x86

 =net-www/apache-2.2.4
 =dev-libs/apr-util-1.2.8

Emerge sipXpbx

Now you are ready to emerge the sipXpbx package. This will emerge all required packages. This can be a very long list, depending on what you already have installed on your machine.

All SIPfoundry sipXpbx development ebuilds are masked with the ~x86 keyword. Make sure they are unmasked (see above).

Code: Emerge sipXpbx
 emerge -av net-misc/sipxpbx

 # or, if you're re-emerging without unmerging first
 emerge -av sipxportlib sipxtacklib sipxmedialib sipxmediaadapterlib sipxcalllib sipxcommserverlib
 emerge -av sipxvxml sipxregistry sipxproxy sipxpublisher sipxconfig sipxpbx

Create self-signed SSL Server Key and Certificate

The sipX Configuration Server requires a certificate for authentication purposes. The following describes how to generate a self signed cert - the easiest way and for test purposes secure enough.

Code: Generate valid SSL certificate
mkdir /etc/sipxpbx/sslkeys && cd /etc/sipxpbx/sslkeys
/usr/bin/ssl-cert/gen-ssl-keys.sh
  enter the data as requested (anything works):
     - CA Common Name (DNS name for CA): Enter anything but NOT the DNS name of your server, e.g. ca.domain.tld
     - SIP Domain Name: Enter your domain name for which DNS SRV is setup for SIP
     - Server Common Name (DNS name for Server): Enter fully qualified hostname of your sipX server
/usr/bin/ssl-cert/install-cert.sh

NOTE: You may need to specify the hostname when executing install-cert.sh.


Initialize and Configure the PostgreSQL Database

If this is a brand new installation of PostgreSQL, then the database cluster needs to be initialised as follows:

Code: Initial Setup
emerge --config dev-db/postgresql

Start and add PostgreSQL to the default runlevel

In order to start Postgres anytime when the system is booted execute the following:

Code: Start and add Postgres to the startup script
/etc/init.d/postgresql start
rc-update add postgresql default

Creating the database and starting sipX

To drop an existing database do the following:

Code: Drop the database
# make sure sipxpbx is not currently running
/etc/init.d/sipxpbx stop
/usr/bin/sipxconfig.sh --database drop

To create the database do the following:

Code: Create the database
/usr/bin/sipxconfig.sh --setup

Update the environment:

Code: Update the environment
env-update && source /etc/profile

To start sipXpbx do the following:

Option 1: using the sipXpbx init script

Code: Starting sipX
/etc/init.d/sipxpbx start

Option 2: using the preliminary Gentoo runscript

The preliminary Gentoo runscript takes care of the runtime dependency with postgresql and the configured TFTP server (if any). It will start both postgresql and in.tftpd (if configured to do so in /etc/conf.d/sipxpbx).

NOTE: The paths below are not standard 'layman' paths. They should be more like /usr/portage/local/layman/sipx/net-misc/sipxpbx... Also, the example conf.d/sipxpbx file seems to be missing from the overlay. --sj

Note: Messages on startup are not yet finished. You will see less output by the script than with the original one.

Code: Starting sipX
# move the original script away for reference
mv /etc/init.d/sipxpbx /etc/init.d/sipxpbx.orig

# create links for the preliminary runscript and config file
ln -s /usr/local/portage/net-misc/sipxpbx/files/conf.d/sipxpbx /etc/conf.d/sipxpbx
ln -s /usr/local/portage/net-misc/sipxpbx/files/init.d/sipxpbx /etc/init.d/sipxpbx

/etc/init.d/sipxpbx start

There should be no errors reported during startup.

Alternatively you can only start configServer:

Code: Start sipXconfig only
su sipx
/usr/bin/sipxconfig.sh

Login to the sipXconfig Web interface: Point your Web browser to http://sipx.your.domain. Set a password for user superadmin and log in.

OpenBSD TFTP server

To provision your phones automatically via sipXpbx configserver you need to setup a tftp server.

Code: Emerge OpenBSD TFTP server
emerge -av net-ftp/tftp-hpa

Make sure the path is set to the configserver tftproot directory before you start the tftp server.

File: /etc/conf.d/in.tftpd
# set tftproot to sipxconfig tftproot directory
INTFTPD_PATH="/var/sipxdata/configserver/phone/profile/tftproot/"

The Gentoo initscript will eventually take care of this (check for in.tftpd and start it if not running). For now, make sure in.tftpd gets started at boot.

Code: Start OpenBSD TFTP server
/etc/init.d/in.tftpd start
# add in.tftpd to the default runlevel
rc-update add in.tftpd default

Troubleshooting

Personal tools