FreeBSD port for sipXecs 3.6
From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia
Contents |
FreeBSD port for sipXecs 3.6
Introduction
This page is currently a stub that presents a rough outline of how to run sipXecs on FreeBSD. Mike Durian provided a port of sipXecs 3.6 on FreeBSD that is available in the FreeBSD ports collection under net/sipx....
I don't know much about FreeBSD at all, but here are some steps you can take to install sipXecs on FreeBSD. The following was done using FreeBSD 6.2 installed from CD on i386 hardware.
Installation of FreeBSD 6.2
I picked a simple CD based install of a developer system. I gave the system a fixed IP address and registered the hostname with the local DNS server.
After installation:
pkg_add -r nano pkg_add -r cvsup-without-gui
Update the ports collection:
Edit the file /usr/share/examples/cvsup/ports-supfile and replace CHANGE_THIS.FreeBSD.org to one of the FreeBSD mirror servers. Then run:
/usr/local/bin/cvsup -L 2 -h cvsup.FreeBSD.org /usr/share/examples/cvsup/ports-supfile
Building sipXecs 3.6 using the ports collection
sipXecs release 3.6 is depracated and succeeded by release 3.8. However, the following describes how to build it using the original FreeBSD port included in the official FreeBSD ports collection.
cd /usr/ports/net/sipxpbx make install
This will take some time (measured in hours) as it pulls in and builds all of sipXecs and all its dependencies. The Java source files have to be manually copied to /usr/ports/distfiles as per the instructions in the error message that appears if they are not there.
Add the following lines to /etc/rc.conf:
postgresql_enable="YES" apache2_enable="YES" sipxpbx_enable="YES"
Update /usr/local/etc/apache2/httpd.conf:
User sipx
Group sipx
DocumentRoot /usr/local/www/sipX/doc
The <Directory > instance should match
<Directory "/usr/local/www/sipX/doc">
Add these lines at the end:
<IfModule ssl_module>
Include /usr/local/etc/sipxpbx/httpd-sipxchange-common-ssl.conf
</IfModule>
Include /usr/local/etc/sipxpbx/httpd-sipxchange-common.conf
Include /usr/local/etc/sipxpbx/httpd-sipxchange-configserver.conf
Update /usr/local/etc/odbcinst.ini
[PostgreSQL]
Description = PostgreSQL driver
Driver = /usr/local/lib/libodbcpsql.so
Setup = /usr/local/lib/libodbcpsqlS.so
FileUsage = 1
Threading = 2
Update /boot/loader.conf
kern.ipc.shmmax=134217728
kern.ipc.shmall=65536
kern.ipc.semmni=40
kern.ipc.semmns=240
kern.ipc.semume=40
kern.ipc.semmnu=120
Initialize DB:
/usr/local/etc/rc.d/postgresql initdb
Generate certificate:
mkdir sslkeys cd sslkeys /usr/local/bin/ssl-cert/gen-ssl-keys.sh /usr/local/bin/ssl-cert/install-cert.sh
Edit /etc/hosts file: (Using a fixed IP address amd hostname bsd)
127.0.0.1 localhost 192.168.1.130 bsd.example.com bsd 192.168.1.130 bsd.example.com.
Start Apache:
bsd# /usr/local/etc/rc.d/apache2 start Performing sanity check on apache2 configuration: Segmentation fault (core dumped) Starting apache2. Segmentation fault (core dumped)
Start sipXecs: The postgres errors are benign and caused by testing for a running postgresql service while it has not yet been started. The sipXpbx start script will start postgresql on its own. Fixing the permission errors is necessary though as described further down for sipXconfig to work.
/usr/local/etc/rc.d/sipxpbx start
bsd# /usr/local/etc/rc.d/sipxpbx start
Checking TLS/SSL configuration:Success
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Initializing configuration database...
pg_ctl: PID file "/usr/local/pgsql/data/postmaster.pid" does not exist
Is postmaster running?
Configuration database initializedChecking /etc/hosts file:Success
Checking watchdog:Success
Checking keepalive:Success
Checking sipproxy:Success
Checking sipauthproxy:Success
Checking sipregistrar:Success
Checking sipxconfig:Failure
Checking sipstatus:Success
Checking sipXvxml:Success
Checking sipxpark:Success
Checking sipxpresence:Success
sipXpbx:
sipXpbx: sipXpbx configuration problems found: echo
sipXpbx:
sipXpbx: Check sipxconfig
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/config.defs.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/proxy-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/registrar-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/sipxpresence-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/authproxy-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/sipxpark-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/status-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/callresolver-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/sipxdialog-config.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/status-plugin.xml.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/authrules.xml.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/fallbackrules.xml.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/mappingrules.xml.in.
sipXpbx: WARNING: user sipx requires write access to file /usr/local/etc/sipxpbx/forwardingrules.xml.in.
sipXpbx:
Attempting to start despite configuration problems
sipxpbx
bsd# /usr/local/etc/rc.d/sipxpbx status Checking watchdog: Running Checking keepalive: Running Checking sipproxy: Running Checking sipauthproxy: Running Checking sipregistrar: Running Checking sipxconfig: Running Checking sipstatus: Running Checking sipXvxml: Running Checking sipxpark: Running Checking sipxpresence: Running
Fixing file permissions:
cd /usr/local/etc/sipxpbx chown sipx config.defs chown sipx proxy-config.in chown sipx registrar-config.in chown sipx sipxpresence-config.in chown sipx authproxy-config.in chown sipx sipxpark-config.in chown sipx status-config.in chown sipx callresolver-config.in chown sipx sipxdialog-config.in chown sipx status-plugin.xml.in chown sipx authrules.xml.in chown sipx fallbackrules.xml.in chown sipx mappingrules.xml.in chown sipx forwardingrules.xml.in
and
chown sipx ssl chown sipx ssl/authorities
Testing sipXconfig standalone:
su - sipx /usr/local/bin/sipxconfig.sh
sipXconfig should now start with all error output directed to the console. Wait for about 1 minute and if no errors are printed navigate your browser to:
http://<hostname>:8443/sipxconfig/app
Retrieving profiles for Phones
sipXconfig generates configuration profiles for supported phones and gateways. They can be retried via FTP. The user's sipx home directory is set to the tftproot directory where sipXconfig deposits profiles. Therefore, phones need to be configured to retrieve profiles from the sipXecs server using the username sipx and the corresponding password.
Conclusion
Apache core dumps when loading the mod_cplusplus or libmod_sipxauth module. This prevents process management, replication, as well as media server from working. However, after fixing the permission problems that remained after installation, this port seems to work quite nicely. I don't have time to debug the Apache problem and given that mod_cplusplus and libmod_sipxauth are both no longer required starting with the sipXecs release 3.8, it does not seem worth the time.
