SIP Server Kamailio-3.2.2 installation on RedHat5 System

Source: Internet
Author: User
Kamailio is an open-source SIP server, formerly known as OpenSER. It runs C Programs on Linux/Unix platforms. It has good performance, flexibility and security. Weblinks · Homepagewithnewprojectname: http://www.kamailio.org · Home &

Kamailio is an open-source SIP server, formerly known as OpenSER. It runs C Programs on Linux/Unix platforms. It has good performance, flexibility and security.

Web links

· Home page with new project name: http://www.kamailio.org

· Home page with old project name: http://www.openser-project.org

· SourceForge.net Project page: http://sourceforge.net/projects/openser/

This article downloads the source program from the website http://www.kamailio.org and the installation of the binary installer, the reason is that the binary installation package lacks db_mysql.so library, and the use of the source program installation is not clear how to compile the kamdbctl command.

I. Installation Package

Download the installation package kamailio-3.2.2_src.tar.gz, upload it to the server/opt directory, and unzip the installation package:

# Gunzip kamailio-3.2.2_src.tar.gz

# Tar-xvf kamailio-3.2.2_src.tar

Ii. Source Code Installation

1. When using the source code for installation, ensure that the gcc compiler and some dependent packages are available in the system. If not, install the gcc compiler first. If gcc is available, go directly to the next step. The gcc installation process is provided here.

# Rpm-ivh cpp-4.1.2-48.el5.i386.rpm

# Rpm-ivh kernel-headers-2.6.18-194.el5.i386.rpm

# Rpm-ivh glibc-headers-2.5-49.i386.rpm

# Rpm-ivh glibc-devel-2.5-49.i386.rpm

# Rpm-ivh libgomp-4.4.0-6.el5.i386.rpm

# Rpm-ivh gcc-4.1.2-48.el5.i386.rpm

2. Kamailio source code compilation requires bison and flex packages. Therefore, before compiling kamailio, www.linuxidc.com needs to install these packages first:

# Rpm-ivh/home/Server/bison-2.3-2.1.i386.rpm

# Rpm-ivh/home/Server/bison-devel-2.3-2.1.i386.rpm

# Rpm-ivh/home/Server/flex-2.5.4a-41.fc6.i386.rpm

3. Modify the compilation configuration file to include the MySQL module

# Vi Makefile. vars

Add the following content:

MODS_MYSQL = on

4. Compile and install kamailio

#./Make_and_install install "standard mysql" ignore/usr/local

For detailed usage of the make_and_install command, use the command without parameters:

#./Make_and_install

Usage:

./Make_and_install [clean | compile | install | nccompile | ncinstall] "standard | standard-dep | mysql | radius | presence | stable | experimental" [ignore | stop] [installpath]

Check that the compilation and installation process is incorrect. You can use make_and_install_output.txt.

Iii. Binary Installation

Because the source code installation does not know which options can be used to generate the kamdbctl tool, the tool is directly generated using the binary installation method.

Upload the kamailio-3.2.2_linux_i386.tar.gz package to the root directory of the server and unzip the installation package:

# Gunzip kamailio-3.2.2_linux_i386.tar.gz

# Tar-xvf kamailio-3.2.2_linux_i386.tar

4. Start Kamailio Service

1. Modify the/usr/local/etc/kamailio/kamctlrc file.

DBENGINE = MYSQL
SIP_DOMAIN = pryko.com

2. Use kamctl to start the service

# Kamctl start

WARNING: database engine not found-tried 'mysql'

INFO: Starting Kamailio:

ERROR: PID file/var/run/kamailio. pid does not exist -- Kamailio start failed

[Root @ eomcr modules] # kamdbctl create

ERROR: cocould not load the script in/usr/local/lib/kamailio // kamctl/kamdbctl. mysql for database engine MYSQL

ERROR: database engine not loaded-tried 'mysql'

This is because the configuration file kamailio. cfg has not been modified, so Modify/usr/local/etc/kamailio. cfg

Add in the file header:

#! Define WITH_MYSQL

3. Restart:

# Kamctl start

If the error persists, check whether the db_mysql.so file is in/usr/local/lib/kamailio/modules.

If an error persists, it may be caused by a mysql installation problem. Check whether the following mysql installation program exists in the system:

# Rpm-qa MySQL-shared

MySQL-shared-5.1.61-1.glibc23

# Rpm-qa MySQL-devel

MySQL-devel-5.1.61-1.glibc23

Check whether the libmysqlclient. so.16 library exists in/usr/lib.

# Ll/usr/lib | grep libmysqlclient

Lrwxrwxrwx 1 root 26 02-08 17:46 libmysqlclient_r.so-> libmysqlclient_r.so.16.0.0

Lrwxrwxrwx 1 root 26 02-08 17:46 libmysqlclient_r.so.16-> libmysqlclient_r.so.16.0.0

-Rwxr-xr-x 1 root 1969708 12-20 libmysqlclient_r.so.16.0.0

Lrwxrwxrwx 1 root 24 02-08 17:46 libmysqlclient. so-> libmysqlclient. so.16.0.0

Lrwxrwxrwx 1 root 24 02-08 17:46 libmysqlclient. so.16-> libmysqlclient. so.16.0.0

-Rwxr-xr-x 1 root 1960456 12-20 libmysqlclient. so.16.0.0

If not, install the two libraries mentioned above.

If no problem exists, kamailio can be started normally and the output is as follows:

# Kamctl start

INFO: Starting Kamailio:

INFO: started (pid: 5937)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.