/weblog/how-to-install-opensips-fedora

How to Install OpenSIPS on Fedora

Saturday, June 20, 2009

OpenSIPS LogoMy introduction to OpenSIPS began shortly after the fork of the OpenSIPS project. I was in search for a load balancing solution for an Asterisk IP-PBX server cluster and I read that OpenSIPS was able to handle tens of thousands of SIP users, and an equal amount of calls; it must be powerful and advanced. After doing some research, I concluded that it was, in fact, both.

Why am I even bothering with OpenSIPS when there's Asterisk? Asterisk is a great platform, but it's not a true SIP proxy and Asterisk does not scale equally as well as OpenSIPS does. A single OpenSIPS box can handle more registrations and call setups, than a large cluster of Asterisk boxes can.

I decided to share some details on how to get OpenSIPS installed on Fedora 10 (Linux) and configured with MySQL support for persistent data storage.

Why Fedora 10?

I chose Fedora for my OpenSIPS installation because Fedora forms the basis of the Redhat Enterprise eco-system which most of my clients run in their server farms and simply, I feel comfortable with the Redhat platform.

After reading the OpenSIPS INSTALL file, I made sure I had all the required packages, which in my case, were:
gcc, bison, flex, zlib, zlib-devel, mysql-server and mysql-devel.

Your installation of Fedora may or may not have all of these packages but it is easy to add them with the yum command. In my particular case, I think I had to install bison, zlib-devel, and mysql-devel. I also made sure I had all the necessary gcc packages. A quick way to cover all the gcc packages is by typing as root:

yum install gcc*

I began the OpenSIPS installation by changing to /usr/src/ and used wget to download the OpenSIPS 1.5.1 package.

cd /usr/src/
wget http://opensips.org/pub/opensips/1.5.1/src/opensips-1.5.1-tls_src.tar.gz

I normally download the package with TLS support regardless if I need TLS support. The next step is to "untar" the opensips file and change to the new OpenSIPS directory.

tar -xzvf opensips-1.5.1-tls_src.tar.gz
cd opensips-1.5.1-tls

I only had a painless edit of the Makefile to do plus two additional simple commands to install OpenSIPS with its MySQL module. Remove the string db_mysql from the following section of the Makefile.

exclude_modules?= jabber cpl-c xmpp rls mi_xmlrpc xcap_client \
db_mysql db_postgres db_unixodbc db_oracle db_berkeley \
avp_radius auth_radius group_radius uri_radius \
osp perl snmpstats perlvdb peering carrierroute mmgeoip \
presence presence_xml presence_mwi presence_dialoginfo \
pua pua_bla pua_mi pua_usrloc pua_xmpp pua_dialoginfo \
ldap h350 identity regex


then run these commands:

make all
make install

My configuration directory was /usr/local/etc/opensips though I prefer my configures all to be located in the /etc directory. Not to mess with a project's defaults, I created a symbolic link.

ln -s /usr/local/etc/opensips /etc/opensips

To get OpenSIPS to start on Fedora when the computer boots, you will need an init script and to set OpenSIPS' runlevel. This is easily accomplished by:

cp /usr/src/opensips-1.5.1-tls/packaging/fedora/opensips.init /etc/init.d/
chkconfig --add opensips
chkconfig --level 2345 opensips on

The last step is to see OpenSIPS start up with its default configuration.

service opensips start

At this point, you should have a basic working OpenSIPS SIP Proxy that should be a good starting point for any further SIP implementations. Here are some further OpenSIPS resources:

Interested in having Advantia help with you OpenSIPS installation?

Our purpose is to help. Click HERE to contact Advantia with all of your OpenSIPS' project needs