How to install OpenSIPS on Ubuntu 17.04

How to install OpenSIPS on Ubuntu 17.04

The OpenSIPS is a GPL implementation of a multi-functionality SIP server that targets to deliver a high-level technical solution. It is used in professional SIP server platforms with more performance, security and quality. This tutorial explains the installation procedure of OpenSIPS on Ubuntu 17.04.

Installation procedure

To start the installation procedure, add the repo by executing the following command.

root@linuxhelp1:~# add-apt-repository ppa:eugenesan/ppa
This repository contains collection of customized, updated, ported and backported
packages for two last LTS releases and latest pre-LTS release.
Packages for older releases relocated to ppa:eugenesan/archive or deleted.

+-------------------------------------------------------------------------------------+
| Disclaimer:
+-------------------------------------------------------------------------------------+
* Packages in this a nd related PPAs are for personal use only.
  They developed specifically for several custom environments and may not work for you.
* Usage of packages in this PPA, in some forms, might contradict licenses of software
  packaged in this and related PPAs. End users and administrator are responsible for
  runtime licensing and possible legal consequences.
* Some packages provided with their dependencies while some might require additional
  Ubuntu repositories and external PPAs. Below is the list of
.
.
.
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox ' /tmp/tmp58gcy2yp/pubring.gpg'  created
gpg: /tmp/tmp58gcy2yp/trustdb.gpg: trustdb created
gpg: key E61380B28313A596: public key " Launchpad synergy+"  imported
gpg: Total number processed: 1
gpg:imported: 1
OK

The repositories are added to the target system. Update the repo by updating the apt-get update command.

root@linuxhelp1:~# apt-get update
Get:1 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty InRelease [15.4 kB]
Hit:2 http://in.archive.ubuntu.com/ubuntu zesty InRelease
Hit:3 http://security.ubuntu.com/ubuntu zesty-security InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu zesty-updates InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu zesty-backports InRelease
Get:6 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main amd64 Packages [1,100 B]
Get:7 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main i386 Packages [1,108 B]
Get:8 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main Translation-en [1,288 B]
Fetched 18.9 kB in 1s (12.3 kB/s)
Reading package lists... Done

To install the OpenSIPS, execute the following apt-get install command and press y to continue with the installation procedure.

root@linuxhelp1:~# apt-get install opensips -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
opensips-b2bua-module opensips-berkeley-module opensips-carrierroute-module opensips-compression-module opensips-console
opensips-cpl-module opensips-dbhttp-module opensips-dialplan-module opensips-emergency-module opensips-geoip-module
opensips-http-modules opensips-identity-module opensips-jabber-module opensips-json-module opensips-ldap-modules
opensips-lua-module opensips-memcached-module opensips-mysql-module opensips-perl-modules opensips-postgres-module
opensips-presence-modules opensips-rabbitmq-module opensips-radius-modules opensips-redis-module opensips-regex-module
opensips-restclient-module opensips-sctp-module opensips-snmpstats-module opensips-sqlite-module opensips-tls-module
opensips-wss-module opensips-tlsmgm-module opensips-unixodbc-module opensips-xmlrpc-module opensips-xmpp-module
The following NEW packages will be installed:
opensips
0 upgraded, 1 newly installed, 0 to remove and 92 not upgraded.
Need to get 2,804 kB of archives.
After this operation, 8,707 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu zesty/universe amd64 opensips amd64 2.2.2-3 [2,804 kB]
Fetched 2,804 kB in 6s (403 kB/s)
Selecting previously unselected package opensips.
(Reading database ... 168833 files and directories currently installed.)
Preparing to unpack .../opensips_2.2.2-3_amd64.deb ...
Unpacking opensips (2.2.2-3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up opensips (2.2.2-3) ...
Created symlink /etc/systemd/system/multi-user.target.wants/opensips.service &rarr  /lib/systemd/system/opensips.service.
Processing triggers for systemd (232-21ubuntu2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for ureadahead (0.100.0-19) ...

The application has been successfully installed. To know more about the options used in the OpenSIPS run the following command.

root@linuxhelp1:~# opensips -help
version: opensips 2.2.2 (x86_64/linux)
Usage: opensips -l address [-l address ...] [options]
Options:
-f fileConfiguration file (default /etc/opensips/opensips.cfg)
-cCheck configuration file for errors
-CSimilar to ' -c'  but in addition checks the flags of exported
functions from included route blocks
-l addressListen on the specified address/interface (multiple -l
mean listening on more addresses).The address format is
[proto:]addr[:port], where proto=udp|tcp and
addr= host|ip_address|interface_name. E.g: -l locahost,
-l udp:127.0.0.1:5080, -l eth0:5062 The default behavior
is to listen on all the interfaces.
-n processes Number of child processes to fork per interface
(default: 8)
-rUse dns to check if is necessary to add a " received=" 
field to a via
-RSame as `-r` but use reverse dns 
(to use both use `-rR`)
-vTurn on " via:"  host checking when forwarding replies
-dDebugging mode (multiple -d increase the level)
-DDo not fork into daemon mode
-FDaemon mode, but leave main process foreground
-ELog to stderr
-N processes Number of tcp child processes (default: equal to `-n`)
-W methodpoll method
-VVersion number
-hThis help message
-b nrMaximum receive buffer size which will not be exceeded by
auto-probing procedure even ifOS allows
-m nrSize of shared memory allocated in Megabytes
-M nrSize of pkg memory allocated in Megabytes
-w dirChange the working directory to " dir"  (default " /" )
-t dirChroot to " dir" 
-u uidChange uid
-g gidChange gid
-P fileCreate a pid file
-G fileCreate a pgid file

For removing the package, execute the following remove command and press y to continue with the uninstall procedure.

root@linuxhelp1:~# apt-get remove opensips -y
Reading package lists... Done
Building dependency tre
Reading state information... Done
The following packages will be REMOVED:
opensips
0 upgraded, 0 newly installed, 1 to remove and 92 not upgraded.
After this operation, 8,707 kB disk space will be freed.
(Reading database ... 169131 files and directories currently installed.)
Removing opensips (2.2.2-3) ...
Processing triggers for man-db (2.7.6.1-2) ...

Wasn' t that an easy installation procedure? OpenSIPS is IETF RFC3261 compliant.

Tag : OpenSIPS
FAQ
Q
How to install OpenSIPS on Ubuntu?
A
execute the following apt-get install command
# apt-get install opensips -y
Q
how to add the repo for OpenSIPS in ubuntu?
A
add the repo by executing the following command.
# add-apt-repository ppa:eugenesan/ppa
Q
what are all the key skill for OpenSIPS application?
A
• the high throughput - tens of thousands of CPS, millions of ‏simultaneous calls (see official tests)
• the flexibility of routing and integration - routing script for implementing custom ro
Q
How does one change the FROM Header in OpenSIPS ?
A
change the FROM Header in OpenSIPS
Use the uac_replace_from() function in the uac module
Q
where to get the documentation for OpenSPS?
A
please refer the following link for OpenSPS
"https://www.opensips.org/Documentation/Manuals".