OpenSIPS 1.11.6 LTS installation on Ubuntu Server 14.04 LTS Part 1.
This article is divided into three sections:
- Preparation
- Installation
- Basic Configuration
The focus on this part is only the installation and a very basic configuration just to see if the OpenSIPS installed properly.
Warning, you have to also follow and do the next part to finalize setups and to secure the OpenSIPS installation on Ubuntu.
Let’s do the part 1.
Preparation
Update and upgrade Ubuntu:
sudo apt-get -y update sudo apt-get -y upgrade
Install development packages:
sudo apt-get install build-essential flex bison zlib1g-dev libncurses5-dev libssl-dev libfrontier-rpc-perl libmysqlclient-dev pkg-config mysql-client
Installation
Prepare source directory:
mkdir -p ~/src cd ~/src
Get OpenSIPS 1.11.6:
wget -c http://opensips.org/pub/opensips/1.11.6/opensips-1.11.6.tar.gz
Install and compile OpenSIPS:
cd ~/src tar -zxf opensips-1.11.6.tar.gz cd opensips-1.11.6-tls TLS=1 make all TLS=1 make include_modules='db_mysql' modules sudo TLS=1 make include_modules='db_mysql' install
Verify installation:
ls -l /usr/local/sbin ls -l /usr/local/lib64/opensips/modules
For
i386
the modules directory is in/usr/local/lib/opensips
.
Basic Configuration
Setup init script for OpenSIPS:
cd ~/src/opensips-1.11.6-tls/packaging/debian/ sudo cp opensips.init /etc/init.d/ sudo chmod 755 /etc/init.d/opensips.init sudo cp opensips.default /etc/default/opensips sudo chmod 644 /etc/default/opensips sudo update-rc.d opensips.init defaults 99 sudo groupadd opensips sudo useradd -M -s /usr/sbin/nologin -g opensips opensips
Edit /etc/init.d/opensips.init
, and change these parts:
- Search for
PATH
and add/usr/local/sbin
toPATH
. Eg:PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
- Search for
DAEMON
and changeDAEMON=/usr/sbin/opensips
toDAEMON=/usr/local/sbin/opensips
- Search for
/etc/opensips/opensips.cfg
and then change it to/usr/local/etc/opensips/opensips.cfg
sudo vi /etc/init.d/opensips.init
Configure init script by editing /etc/default/opensips
. Change RUN_OPENSIPS=no
to RUN_OPENSIPS=yes
, this will make /etc/init.d/opensips.init
actually run OpenSIPS daemon.
sudo vi /etc/default/opensips
Next, update sample opensips.cfg
for the first time:
- Search for
CUSTOMIZE ME
, it should be only 1 line, its thelisten
option. Change the default IP127.0.0.1
to your server IP address, or0.0.0.0
for all IP in your server:listen=udp:0.0.0.0:5060
-
Add one line just after above
listen
line to define and allow access to TCP:listen=tcp:0.0.0.0:5060
-
Followed by changing
disable_tcp
option fromyes
tono
:disable_tcp=no
sudo vi /usr/local/etc/opensips/opensips.cfg
Start OpenSIPS:
sudo /etc/init.d/opensips.init start
Verify if OpenSIPS is running:
ps ax | grep opensips netstat -lnptu | grep opensips tail -f /var/log/syslog | grep opensips
Author
This article is written by Anton Raharja.
Update:
Hi Anton, great job. Your articles have been my primary reference for setting up Opensips successfully.
LikeLike
cool, glad its helpful
LikeLike