Installing OPENSIPS from Source code on Debian Ubuntu 20.04/18.04

Installing OPENSIPS from source code on Ubuntu 14.04:

Description : 
OpenSIPS is a multi-functional, multi-purpose signaling SIP server – it can act as SIP Router/Switch, SIP Registrar, Application Server, Redirect Server, Load Balancer / Dispatcher, Back-to-Back User Agent, Presence Server, IM Server, Session Border Controller, SIP Front-End, NAT Traversal Server, IP Gateway (SMS, XMPP) and others.

1) First of all Install Necessary Dependencies to install opensips, here is the set of Dependencies please install these Dependencies

apt-get install build-essential openssl bison flex
apt-get install mysql-server
apt-get install libmysqlclient-dev
apt-get install libncurses5-dev libncursesw5-dev

2) Now Download the tar file of Latest OPENSIPS from opensips download page.

wget http://opensips.org/pub/opensips/latest/src/opensips-1.11.3-latest_src.tar.gz

3) Now extract the tar file and enter into the extracted Directory

tar -zxvf opensips-1.11.3-latest_src.tar.gz
cd opensips-1.11.3-latest_src

4) Now install the opensips using make all and make install commands. Opensips come along few modules, but you can install as many as modules by adding that specific module at the installation time. Here I am trying to install extra MYSQL Database module. 

make all include_modules=”db_mysql” modules
make install include_modules=”db_mysql” modules

5) Then Create one directory for Opensips under /var/run/ folder

mkdir /var/run/opensips

6) Now copy opensips default file to /etc/default/ folder. Opensips default file is located under <opensips-source>/packaging/debian Folder, and file name is opensips.default, Copy this file to /etc/default folder

root@Venkey:/usr/src/opensips-1.11.3-tls# ls packaging/debian/
changelog  control    opensips.default  opensips.examples  opensips.postinst       patches
compat     copyright  opensips.dirs     opensips.init      opensips.README.Debian  rules

cp packaging/debian/opensips.default /etc/default/opensips

7) Also copy the Opensips init file to /etc/init.d/ folder

cp packaging/debian/opensips.init /etc/init.d/opensips

8) Now edit the opensips default file change RUN_OPENSIPS to yes and made necessary changes to that file.

# Set to yes to enable opensips, once configured properly.
RUN_OPENSIPS=yes
# Amount of shared memory to allocate for the running OpenSIPS server (in Mb)
S_MEMORY=256

9) Now edit the opensips init file 

DAEMON=/usr/sbin/opensips
RUN_OPENSIPS=yes

10) Make sure Daemon is located in given Path
11) Give execution permission to the init.d file, so normal user can also run Opensips(optional)

chmod +x /etc/init.d/opensips

12) Add opensips user

useradd opensips

13) Now add the opensips to startup applications, so opensips will automatically start when you logging in.

update-rc.d opensips defaults 99

14) That’s it, Now restart the OPENSIPS server using below command.

/etc/opensips/init.d restart

15) Verify if OPENSIPS running or not :

ps -ef | grep opensips

Now make as many as changes to opensips.cfg configuration file to work with opensips Server.
If you have any further doubt’s please fire a comment below or you can contact me through Contact Form.

Venkatesh

Hi Guys, I am Venkatesh. I am a programmer and an Open Source enthusiast. I write about programming and technology on this blog.

You may also like...

Leave a Reply