HowTo install sipX 3.0.1 on Gentoo

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

Jump to: navigation, search

Contents

Build Status Stable Version 3.0.1

The source tarballs are downloaded from http://www.sipfoundry.org/pub/sipX/3.0/SRC.

Build Status Stable Branch
Package 
x86 
amd64
platform
Remarks
sipXportLib
OK
-
-
issue with Apache-2.0's built-in libpcre-3.9, see below Install libpcre
sipXtackLib
OK
-
-
-
sipXcommserverLib
OK
-
-
See sipXcommserver Configuration below
sipXproxy
OK
-
-
-
sipXregistry
OK
-
-
-
sipXpublisher
OK
-
-
-
sipXmediaLib
OK
-
-
-
sipXmediaAdapterLib
OK
-
-
-
sipXcallLib
OK
-
-
-
sipXvxml
OK
-
-
-
sipXconfig
OK
-
-
See sipXconfig Configuration below
sipXpbx
OK
-
-
-

Critical Pre-Installation Steps

Hostname

Your machine NEEDS to have a fully qualified hostname. We propose to use sipxpbx.your.domain, however, you could use a different name.

Code: Set Hostname in /etc/hostname
echo sipxpbx > /etc/hostname
Code: Set Fully Qualified Domain Name in /etc/hosts
echo 'your.ip.address sipxpbx.your.domain sipxpbx' >> /etc/hosts

We further recommend you choose a fixed IP address for this machine. Make proper settings in /etc/conf.d/net and /etc/resolv.conf.

Code: Verify domain and host names
domainname -f    (outputs fully qualified name)
domainname -d    (outputs domain name)
hostname         (outputs hostname)

DNS Setup

Make sure the machine is setup in DNS. This requires the editing of the configuration of your domain's DNS server and is critically important. Both a Windows or Linux based DNS server can be used (please refer to the Windows Server manual for configuration instructions). The alias 'sipuaconfig' is used to identify the sipX Configuration Server and is required by sipXphone so that when the phone boots it can find the domain's sipX configuration server to register.

sipX uses DNS SRV records, which allows you to establish a SIP service for your domain. In addition, DNS SRV is a powerful mechanism for load balancing and fail over and is typically used for scalable and resilient Web server installations. See DNS man pages for additional information.

File: /etc/bind/pri/your-primary.zone
sipxpbx         A       ip.add.re.ss
sipuaconfig     CNAME   sipxpbx

_sip._udp       IN      SRV     100     1       5060    sipxpbx
_sip._tcp       IN      SRV     200     1       5060    sipxpbx
_sips._tcp      IN      SRV     300     1       5060    sipxpbx

If DNS resolution of the sipx server hostname does not work properly, the following error will be experienced when you start sipXpbx:

sipXpbx: Check hostname
sipXpbx:    Hostname hostname is not qualified.

Check that DNS is working

Code: Verify DNS name resolution using Linux
ping sipxpbx
ping sipxpbx.your.domain
ping sipuaconfig

# Install dig: emerge --ask net-dns/bind-tools
dig -t A sipxpbx.your.domain
dig -t SRV _sip._tcp.your.domain
dig -t SRV _sip._udp.your.domain
dig -t SRV _sips._tcp.your.domain
Code: Verify DNS name resolution using Windows
# Open a DOS Window 
ping sipxpbx
ping sipxpbx.your.domain
ping sipuaconfig


 nslookup
 >set q=srv
 _sip._tcp.your.domain
 _sip._udp.your.domain
 _sips._tcp.your.domain 

USE Flags

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

File: USE flags in /etc/make.conf
-alsa apache2 libwww postgres -doc -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, where local audio must be enabled.

Note: "-doc" disables building doxygen developer documentation.

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 -o file:///tmp/overlay.xml -a sipx

libPCRE

Apache uses it's own copy of libPCRE which is version 3.9 for the 2.0 series. Refer to ASF Bugzilla for a detailed description of the issue (http://issues.apache.org/bugzilla/show_bug.cgi?id=27550). Apache 2.2 will solve this issue.

This issue will prevent you from loging in to the voicemail portal. Other functionality is not affected.

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.

SIPfoundry sipXpbx ebuilds are no longer masked for the stable version 3.0.1. The Apache module mod_cplusplus is the only dependency that is still masked and therefore needs to be unmasked in the /etc/portage/package.keywords file before emerging sipXpbx.

File: /etc/portage/package.keywords
echo '=www-apache/mod_cplusplus-1.5.2 ~x86' >> /etc/portage/package.keywords
Code: Emerge sipXpbx
emerge -av net-misc/sipxpbx

sipXcommserver Configuration

SSL Key and Certificate

The sipX Configuration Server requires a digital certificate for authentication purposes. If you have an SSL server key and certificate you would like to use for the sipx server, install it into the /etc/sipxpbx/ssl directory:

File: SSL Server Key and Certificate
/etc/sipxpbx/ssl/ssl.crt
/etc/sipxpbx/ssl/ssl.key

For a test environment, the creation of self-signed certificates is sufficient (option 1). A certificate from a recognized authority should be used on a production server.

Option 1: Create self-signed SSL Server Key and Certificate

The following describes how to generate a self signed cert - the easiest way and for test purposes secure enough.

Note: JAVA_HOME MUST be set for the following steps to work.

Code: Generate valid SSL certificate
mkdir $HOME/sslkeys
cd $HOME/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
     - SIP domain name: The domain name of your installation
     - Full DNS name for the server: Enter fully qualified hostname of your sipX server
/usr/bin/ssl-cert/install-cert.sh server-01

Option 2: Install SSL Server Key and Certificate received from an authorized CA

See here http://www.sipfoundry.org/sipXpbx/doc/install/guide.html for instructions on how to obtain and install a certificate from a recognized certificate authority.

PostgreSQL

see here when you upgrade from version 7.4.x to version 8.0

Initialize and Configure the PostgreSQL Database

The database can be initialized as follows (only if this is a brand new installation of PostgreSQL):

Code: Initial Setup
ebuild /usr/portage/dev-db/postgresql/postgresql-8.0.1-r4.ebuild config

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

Create the sipXpbx SIPXCONFIG Database

The commands below to create the SIPXCONFIG database in PostgreSQL assume the database server is up and running.

Code: Create PostgreSQL Database SIPXCONFIG
/usr/bin/sipxconfig.sh --setup

Update Environment

Update the environment to add the sipX components to your path:

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

sipXpbx

Start sipXpbx

The sipXpbx start script will transform the configuration files in /etc/sipxpbx.

Code: Start sipXpbx
/etc/init.d/sipxpbx start

Note: There is no Gentoo initscript for sipXpbx yet. The service must be started manually on every boot.

  • Wait for all processes to start, then access the web GUI at http://sipxpbx
  • Set the password for user superadmin
  • Log in with user superadmin and the password you just set


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

Starting sipXpbx after a reboot

sipX needs to be started manually because right now there is no Gentoo initscript available.

Code: Start sipXpbx manually
/etc/init.d/sipxpbx start
Personal tools