What is OpenSIPS?

Before go for OpenSIPs installation with PostgreSQL on CentOS, we need to understand about OpenSIPS. OpenSIPS is an open source software implementation of the Session Initiation Protocol for Voice over IP that can be used to handle voice, text and video communication. OpenSIPS is a multi-functional, multi-purpose signaling SIP server that can act as SIP Router/Switch, SIP Registrar, Application Server, Redirect Server, Load Balancer, Back-to-Back User Agent, Presence Server, IM Server, Session Border Controller, SIP Front-End, NAT traversal Server, IP Gateway (SMS, XMPP) and others. OpenSIPS is highly flexible, has an application interface and modules for effective application building, and high scalability

How do we help businesses with our OpenSIPs Services?

We are renowned as a leading OpenSIPs development company. We provide various services to harness the power of this VoIP development platform. We use this multi-functional SIP server to build different types of scalable and robust telephony platforms. 

We also provide maintenance, support, customization, custom development, and deployment services for different OpenSIPs projects with our team of expert OpenSIPs developers.

To know more about our services in this leading VoIP development technology, Click Here.

We also have helped businesses with our consultancy services and support for OpenSIPs installation with PostgreSQL on CenOS

– This blog will describe the steps to install current stable release Opensips-2.1 with PostgreSQL on CentOS.


1) Install the Dependencies

– Update the source repository and package indexes to install the latest available packages
# yum update– Install the required packages for opensips
# yum install gcc-c++ bison lynx subversion flex git curl-devel libxslt libxml2-devel wget ncurses-devel libxml2-dev libmemcached libexpat1-devel unixODBC unixODBC-devel postgresql-devel

2) Download Opensips-2.1

# cd /usr/local/src
# git clone https://github.com/OpenSIPS/opensips.git -b 2.1 opensips_2_1
# cd opensips_2_1/

3)Compile Opensips

# make all-Open the configuration interface:
# make menuconfig-The text-based user interface will look like this:

– Press Right arrow key on the first option and goto the following sub menu:

– Pressing right arrow key will display list of modules where we need to select the modules along with module ‘db_postgres’ which we want to install:

– Once the modules’ selection is done, press left arrow key to go back to previous menu Select “Save Changes” and press enter. A list of suggested libraries and packages will show up at the bottom of the screen for help.

– Press left arrow key again to go back to main menu. Select “Compile And Install OpenSIPS” and press Enter. If everything goes well opensips will be installed successfully.

– Now install Opensips:
# make install

4)Create .pgpass file for PostgreSQL authentication

# cd /root
# touch ~/.pgpass
# vim .pgpass
localhost:5432:opensips:postgres:password
# chmod 0600 /root/.pgpass
[/vc_column_text][vc_column_text disable_pattern=”true” align=”left” margin_bottom=”0″]

5) Copy default and the int.d startup scripts to relevant directories

# cp opensips.init /etc/init.d/opensips–  Edit init script and change below variables:
# vim /etc/init.d/opensips
DAEMON=/usr/local/sbin/opensips
CFGFILE=/usr/local/etc/opensips/opensips.cfg

6) DB Credentials Configurations

– Go to /usr/local/etc/opensips directory ,open the file opensipsctlrc and set below database parameters.

7) Creating the Database

# /usr/local/sbin/opensipsdbctl create

– If you want to create a different database other than defined in DBNAME, you can run

# /usr/local/sbin/opensipsdbctl create your_custom_db_name

PGSQL password for root:
INFO: test server charset
INFO: creating database opensips …
INFO: Core OpenSIPS tables succesfully created.
Install presence related tables? (y/n): y
INFO: creating presence tables into opensips …
INFO: Presence tables succesfully created.
Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist? (y/n): y
INFO: creating extra tables into opensips …
INFO: Extra tables succesfully created.

8) Start/Stop Opensips service

# /etc/init.d/opensips start
# /etc/init.d/opensips stop
– We can check Opensips is running or not by the command
# netstat -pan |grep opensips

udp 0 0 192.168.1.88:5060 0.0.0.0:* 3359/opensips
udp 0 0 192.168.1.88:5060 0.0.0.0:* 3305/opensips

If you are interested in knowing more about our OpenSIPs services or if you want to take help from experts for any of your OpenSIPs projects, contact us.