Installing OpenSIPS v1.6.1 on CentOS 5 64bit
Smartvox Limited can help you at any stage of setting up your VoIP services - from installing CentOS on your server through to installing and configuring OpenSIPS. We also have a wealth of experience in systems integration and networking to get your OpenSIPS server working smoothly with your existing VoIP infrastructure.However, if you want to do it all yourself, here is a set of instructions that should help. Installing OpenSIPS v1.6.1 on CentOS 5 64 bit is very straightforward. All the dependencies can be installed using YUM. The packages required will depend on the modules that you intend to use from OpenSIPS. This page describes what must be installed to use OpenSIPS with local MySQL support.
 
Assumptions about the base system used for the installation
The information given here is based on experience of installing OpenSIPS on a Dell SC1435 with AMD Opteron processors. CentOS version 5.2 x86_64 was installed from discs made using ISO images downloaded from one of the CentOS mirror sites.You can check your installed version of CentOS using the following commands:
| cat /etc/redhat-release | Shows the CentOS release version number |
| uname -m | Shows if you have the x86_64 version |
| cat /proc/cpuinfo | Shows the type of processor on your machine |
Packages assumed to already be installed on the base system
You may find it useful to run the "yum list" or "yum info [package_name]" commands at the Linux prompt to check what packages are already installed and which version. By the way, on my server there was also a package for mysql.i386 already installed. |
 
Update and install various packages using YUM
Install the missing packages using the "yum install" command at the Linux prompt. It is probably best to be logged in as root for this.|
Packages required by OpenSIPS yum install gcc yum install bison yum install flex yum install zlib-devel yum install openssl-devel Dependencies of openssl-devel When you attempt to install openssl-devel, it warns you that several other packages and updates are necessary. These dependencies are added automatically, so little effort is required - just confirm that it is ok to install the dependencies and updates. Updating krb5-libs Installing e2fsprogs-devel Installing keyutils-libs-devel Installing krb5-devel Installing libselinux-devel Installing libsepol-devel Updating krb5-workstation |
 
Install MySQL local server and MySQL headers
|
Install mysql-server.x86_64 Suggested version: 5.0.45-7.el5 Command: yum install mysql-server.x86_64 Then install mysql headers Command: yum install mysql-devel.x86_64 |
 
Get a copy of the OpenSIPS source files
|
OpenSIPS Suggested version: opensips-1.6.1-notls_src.tar.gz Download site: http://opensips.org/pub/opensips/1.6.1/src Unzip: tar -xzf opensips-1.6.1-notls_src.tar.gz Suggested location to copy the source files after unzipping the tarball: /usr/src/opensips |
 
Fix the makefile to include the db_mysql module
|
OpenSIPS You should now have all the unzipped files in /usr/src/opensips and have made this your current directory To enable MySQL server support, edit the file called "Makefile" and locate the section of the file that sets a list of excluded modules. It looks like this:
Simply remove the entry for db_mysql, so it now looks like this:
|
 
Compile and install OpenSIPS
|
Use make to compile and install OpenSIPS You should still be in the directory /usr/src/opensips to run these commands: make clean make make install I got some warnings about "old-style function definitions" in file lex.yy.c, but I ignored them. |
 
Test that OpenSIPS runs ok
|
Try running OpenSIPS At the Linux command prompt, type: opensipsctl start You should see something like this:
Another test you can use to check if OpenSIPS is actually running, is this: ps ax | grep opensips You should see something like this:
|
 
And finally...
|
Create automated startup scripts The sample startup script for Fedora (/usr/src/opensips/packaging/fedora/opensips.init) is quite close to being suitable for CentOS. Before you try it, copy it to /etc/init.d and set its permissions to make it executable. Rename it opensips and make the following changes to the script: Change the Source function library from /etc/rc.d/init.d/functions to /etc/init.d/functions Make sure the correct paths are set for your config file and your program. For example, you will probably want to set the variable oser like this: oser=/usr/local/sbin/opensips Add a path statement: PATH=/sbin:/bin:/usr/local/sbin:/usr/local/bin On the line that starts the daemon, remove "| tail -1" and instead get the line to look like this: daemon $oser $OPTIONS >/dev/null 2>/dev/null Test it from the command line, using commands such as: /etc/init.d/opensips start /etc/init.d/opensips status /etc/init.d/opensips stop Hint: if you are having inexplicable problems getting it to start, you may need to manually delete the file /var/lock/subsys/opensips Once you are sure it works, you can set it to run automatically like this: Edit the startup script /etc/init.d/opensips and edit the comment line (approx third line): # chkconfig: - 85 15 Change it to # chkconfig: 345 96 15 At the Linux command prompt, type: chkconfig --add opensips Reboot the server to check that opensips starts automatically. Start writing your own opensips.cfg config file A default config file is deposited by the installation process in /usr/local/etc/opensips. Additional sample files are dropped in the directory /usr/src/opensips/examples. There are many online guides and "cook books" to help you with programming. For example: http://www.opensips.org/index.php?n=Resources.DocsCookbooks Another option would be to purchase a copy of the new book by Flavio E. Goncalves: http://www.packtpub.com/building-telephony-systems-with-opensips-1-6/book The same book is available from Amazon too. Or the previous edition is available here: http://www.amazon.co.uk/Building-Telephony-Systems-OpenSER-Goncalves/dp/1847193730 However, the recommended option is to save yourself the time and frustration of learning a whole new technology - just contact Smartvox and ask us to quote for setting up your proxy server. We have years of experience working with ITSP solutions for NAT traversal, user registration, failover and redundancy, integration with Application Servers, re-direction to voicemail on no answer or busy etc, etc. |

