0% found this document useful (0 votes)
465 views9 pages

Kamailio Version IMS

The document provides steps to install IMS-Kamailio on Debian 8.8. It includes installing prerequisites like packages and tools. It then covers installing and configuring RTPENGINE, MySQL, Kamailio 5.0.4 and creating databases for P-CSCF, I-CSCF and S-CSCF. Finally, it discusses installing and configuring FHoSS for OpenIMSCore. The overall process allows setting up an IMS core based on Kamailio and related components on Debian.

Uploaded by

Deepthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
465 views9 pages

Kamailio Version IMS

The document provides steps to install IMS-Kamailio on Debian 8.8. It includes installing prerequisites like packages and tools. It then covers installing and configuring RTPENGINE, MySQL, Kamailio 5.0.4 and creating databases for P-CSCF, I-CSCF and S-CSCF. Finally, it discusses installing and configuring FHoSS for OpenIMSCore. The overall process allows setting up an IMS core based on Kamailio and related components on Debian.

Uploaded by

Deepthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

IMS-Kamailio-Installation in Debian-8.

Step 1: Prerequisites:

To be able to follow the guidelines from this document you need 'root' access.

The following packages are required before proceeding to the next steps.

 # apt-get install git-core vim gcc flex bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev
libxml2-dev libpcre3-dev dpkg dpkg-dev debhelper iptables-dev libcurl4-openssl-dev libpcre3-dev
libxmlrpc-core-c3-dev markdown libavcodec-dev libavfilter-dev libavformat-dev libevent-dev libglib2.0-
dev libhiredis-dev libjson-glib-dev libpcap0.8-dev libbencode-perl libcrypt-rijndael-perl libdigest-hmac-
perl libio-socket-inet6-perl libsocket6-perl gedit bind9 dkms

 # apt-get install gir1.2-json-1.0 json-glib-tools kamailio-json-modules libjson-c-dev libjson-c2 libjson-glib-


1.0-0 libjson-glib-1.0-0-dbg libjson-glib-1.0-common libjson-glib-dev libev-dev libev-perl libev4 libevent-
2.0-5 libevent-core-2.0-5 libevent-dev libevent-extra-2.0-5 libevent-openssl-2.0-5 libevent-pthreads-2.0-5

 # apt-get install libmariadbclient-dev ( if use mariadb)

Step 2: Installation of RTPENGINE following steps are:

First of all Clone the RTPengine project from GitHub. To clone the RTPengine use below command.

 # cd /usr/local/src

 # git clone https://github.com/sipwise/rtpengine.git rtpengine

Then enter into rtpengine directory and run ./debian/flavors/no_ngcp in order to remove any NGCP dependencies

 # cd rtpengine/

 # git checkout mr5.5

 # ./debian/flavors/no_ngcp

Then we need to run the dpkg-buildpackage command. But I got lot of dependencies.. here is the list.

 # dpkg-buildpackage

And next come back to parent directory.

 # cd /usr/local/src

Let’s Install those deb files..

 # dpkg -i ngcp-rtpengine-daemon_5.4.0.0+0~mr5.4.0.0_amd64.deb

 # dpkg -i ngcp-rtpengine-iptables_5.4.0.0+0~mr5.4.0.0_amd64.deb

 # dpkg -i ngcp-rtpengine-dbg_5.4.0.0+0~mr5.4.0.0_amd64.deb
 # dpkg -i ngcp-rtpengine-recording-daemon_5.5.3.0+0~mr5.5.3.0_amd64.deb

 # dpkg -i ngcp-rtpengine-kernel-source_5.5.3.0+0~mr5.5.3.0_all.deb

 # dpkg -i ngcp-rtpengine-kernel-dkms_5.5.3.0+0~mr5.5.3.0_all.deb

 # dpkg -i ngcp-rtpengine-utils_5.5.3.0+0~mr5.5.3.0_all.deb

Now Installation is completed need to run the rtp engine. We need to edit the /etc/rtpengine/rtpengine.conf

 # cp rtpengine.sample.conf rtpengine.conf

 # nano /etc/rtpengine/rtpengine.conf

Replace the interface=192.168.1.9 your ip address and save

next run these commands…

 # modprobe xt_RTPENGINE

 # iptables -I INPUT -p udp -j RTPENGINE --id 0

 # /usr/sbin/rtpengine --table=0 --interface=192.168.1.9(your ipadress) --listen-ng=127.0.0.1:2223 --tos=184


--pidfile=/var/run/rtpengine.pid --no-fallback

Check running process

 # ps -aux | grep rtpengine

Step 3: Installation of Mysql:


 # apt-get install mysql-server-5.5
 Mysql root password is 'root'(your choice)
Enable access to mysql from remote hosts (very generous and dangerous in real world):
 # mysql -u root -p
 GRANT ALL ON *.* TO root IDENTIFIED BY 'root'; ('root' is password)
 quit;

Replace bind-address in /etc/mysql/my.cnf to your ip-address address (instead of 127.0.0.1) to enable remote access

Restart mysql and check via command "tail -F /var/log/syslog" for errors
 # /etc/init.d/mysql stop
 # /etc/init.d/mysql start

Step 4: Kamailio-5.0.4:
First of all, you have to create a directory on the file system where the sources will be stored.
 # mkdir -p /usr/local/src/kamailio-5.0
 # cd /usr/local/src/kamailio-5.0
 git source of kamailio download link: https://www.kamailio.org/pub/kamailio/5.0.4/

kamailio-5.0.4_src.tar.gz file is downloaded. And extract the same folder.


Rename this file kamailio-5.0.4 to kamailio use below commands
 # tar xvzf kamailio-5.0.4_src.tar.gz

 # mv kamailio-5.0.4 kamailio

(OR)

Download the sources from GIT using the following commands.

 # cd usr/local/src/kamailio-5.0
 # cd kamailio/
 # git clone --depth 1 --no-single-branch git://git.kamailio.org/kamailio kamailio

 # git checkout -b 5.04 origin/5.0

Tuning Makefiles:

The first step is to generate build config files.

 # make cfg

To set include_modules variable to the extra modules to be included for compilation when building Makefile cfg:
 # make includeinclude_modules=”db_mysql ims_usrloc_pcscf ims_registrar_pcscf ims_auth ims_charging
ims_icscf ims_isc ims_qos ims_registrar_scscf ims_usrloc_scscf ims_dialog cdp cdp_avp pua outbound rr
ctl jsonrpcs presence xmlrpc evapi json” cfg

Compile Kamailio:
Once you added the mysql module to the list of enabled modules, you can compile Kamailio:
 # make all
 if any sctp errors : apt-get install libsctp-dev lksctp-tools

Install Kamailio:
 # make install
What And Where Was Installed
The binaries and executable scripts were installed in:
 /usr/local/sbin
These are:
 kamailio - Kamailio SIP server
 kamdbctl - script to create and manage the Databases
 kamctl - script to manage and control Kamailio SIP server
 kamcmd - CLI - command line tool to interface with Kamailio SIP server
To be able to use the binaries from command line, make sure that /usr/local/sbin is set in PATH environment
variable. You can check that with echo $PATH. If not and you are using bash, open /root/.bash_profile and at the
end add:
 # PATH=$PATH:/usr/local/sbin
 # export PATH

Create the directory for pid files:

 # mkdir -p /var/run/kamailio_pcscf/

 # mkdir -p /var/run/kamailio_icscf/
 # mkdir -p /var/run/kamailio_scscf/

Default setting is to run Kamailio as user kamailio and group kamailio. For that you need to create the user:

 # adduser --quiet --system --group --disabled-password \

--shell /bin/false --gecos "Kamailio" \

--home /var/run/kamailio kamailio

Step 5: Creating Mysql Database for PCSCF, ICSCF and SCSCF following commands below:
 # mysql -u root -p
 CREATE DATABASE `pcscf`;
 CREATE DATABASE `icscf`;
 CREATE DATABASE `scscf`;

To create the MySQL database, you have to use the database setup script. First edit following below files to set the
database server type:

 # nano /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/ims_usrloc_pcscf-create.sql
modifications are:
 add at the top: USE pcscf;
 change: INSERT INTO to REPLACE INTO
 insert before CREATE TABLE `location`;
 DROP TABLE IF EXISTS `location`;
 # nano /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/ims_usrloc_scscf-create.sql
modifications are:
 add at the top: USE scscf;
 Ex. change: INSERT INTO to REPLACE INTO
◦ insert before CREATE TABLE `contact`;
◦ DROP TABLE IF EXISTS `contact`; Similar changes to all tables.
 # cp /usr/local/src/kamailio-5.0/kamailio/misc/examples/icscf/icscf.sql /usr/local/src/kamailio-
5.0/kamailio/utils/kamctl/mysql/
 # nano /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/icscf.sql
▪ add at the top: USE icscf;

Create the tables:


 # nano /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/standard-create.sql
▪ add at the top: USE pcscf;

 # mysql -u root -p < /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/standard-create.sql


 # mysql -u root -p < /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/ims_usrloc_pcscf-create.sql
 # nano /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/standard-create.sql
▪ add at the top: USE scscf;
 # mysql -u root -p < /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/standard-create.sql
 # mysql -u root -p < /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/ims_usrloc_scscf-create.sql

 # nano /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/presence-create.sql
▪ add at the top: USE scscf;
 # mysql -u root -p < /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/presence-create.sql
 # nano /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/icscf.sql
▪ add at the top: USE icscf;
 # mysql -u root -p < /usr/local/src/kamailio-5.0/kamailio/utils/kamctl/mysql/icscf.mysql.sql

adapt permissions/privileges of users:


 # mysql -u root -p
 grant delete,insert,select,update on pcscf.* to [email protected] identified by 'pcscf';
 grant delete,insert,select,update on icscf.* to [email protected] identified by 'icscf';
 grant delete,insert,select,update on scscf.* to scscf@(p-server adress) identified by 'scscf'; (this is not
required for single server)
 grant delete,insert,select,update on scscf.* to [email protected] identified by 'scscf';

Step 6: Installation of FHoSS


-----------------------------------------
Precondition for FHoSS:
install Java JDK and ant (required for OpenIMSCore FHoSS)
 # apt-get install openjdk-7-jdk
 # apt-get install ant

Download FHoSS
 # apt-get install subversion

Create working directories for OpenIMSCore:


 # mkdir /opt/OpenIMSCore
 # cd /opt/OpenIMSCore

Download:
 # svn checkout svn://svn.code.sf.net/p/openimscore/code/FHoSS/trunk

Rename the trunk folder use command below:


 # mv trunk/ FHoSS

compile:
 # cd FHoSS
 # ant compile deploy

adapt all configuration files:

from kamailio source get configurator.sh file


 directory:/opt/OpenIMSCore/FHoSS/deploy
 copy configurator.sh to this directory and mark it executable
 # chmod +x configurator.sh
 # ./configurator.sh
Domain Name:koffee-ims.in
IP Address:10.0.0.9(your ip adress)
File to change ["all" for everything, "exit" to quit]:all
changing: c3p0.properties DiameterPeerHSS.xml hibernate.properties hss.properties log4j.properties

 directory: /opt/OpenIMSCore/FHoSS/scripts
 cd ../scripts; cp ../deploy/configurator.sh .; ./configurator.sh
 # chmod +x configurator.sh
 # ./configurator.sh
Domain Name:koffee-ims.in
IP Address:10.0.0.9(your ip address)
File to change ["all" for everything, "exit" to quit]:all
changing: hss_db_migrate_dsai.sql hss_db.sql userdata.sql

 directory: /opt/OpenIMSCore/FHoSS/config
 cd ../scripts; cp ../deploy/configurator.sh .; ./configurator.sh
 # chmod +x configurator.sh
 # ./configurator.sh
Domain Name:koffee-ims.in
IP Address:10.0.0.9(your ip address)
File to change ["all" for everything, "exit" to quit]:all
changing: hss_db_migrate_dsai.sql hss_db.sql userdata.sql

Prepare mysql database:


In case of OpenIMSCore update drop old databases: hss_db
 # mysql -u root -p
 drop database hss_db;
 quit;

Create new HSS database: go to directory /opt/OpenIMSCore


 # mysql -u root -p < FHoSS/scripts/hss_db.sql
 # mysql -u root -p < FHoSS/scripts/userdata.sql

Modify mysql access rights at first time installation (not covered by configurator):
 # mysql -u root -p
 grant delete,insert,select,update on hss_db.* to [email protected] identified by 'hss';

check database with MySQL Workbench if domain names are okay in various entries and privileges
(or)
manually: e.g.
 show databases;
 use hss_db;
 select * from impu;

Prepare script-file, last modifications and start ...

 copy startup.sh to hss.sh in root directory


 # cp /opt/OpenIMSCore/FHoSS/deploy/startup.sh /root/hss.sh
and add to hss.sh:
 cd /opt/OpenIMSCore/FHoSS/deploy
 JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"

start HSS from /root: # ./hss.sh

access the web-interface of HSS:


 http://192.168.1.9:8080/hss.web.console/
 user: hssAdmin
 password: hss
Step 7: Bind Server Setup:

Go to the following path folder


 # cd /etc/bind

edit dnszone file:


Ex: koffee-ims.dnszone file
 # gedit koffee-ims.dnszone
chaneges in required servers ip addresses

add following lines at the end of named.conf file


 # gedit named.conf
zone "koffee-ims.in" {
type master;
file "/etc/bind/koffee-ims.dnszone";
notify no;
};

Step 8: Edit configure IMS files:

first copy from kamailio source in example folder to /usr/local/etc/


modify pcscf, icscf and scscf configuration-files accordingly
- set the ip addresses

P-CSCF:
-------
- use modified files: pcscf.cfg, kamailio.cfg, distpacher.list, and pcscf.xml with Ip addresses and domain name.
Example: In pcscf.cfg file:
listen=udp:115.98.3.93:5060
alias=pcscf.koffee-ims.in
#!define PCSCF_URL "sip:pcscf.koffee-ims.in"
#!subst "/NETWORKNAME/koffee-ims.in/"
#!subst "/HOSTNAME/pcscf.koffee-ims.in/"
#!define DB_URL "con1=>mysql://pcscf:[email protected]/pcscf"
#!define SQLOPS_DBURL "pcscf=>mysql://pcscf:[email protected]/pcscf"

In pcscf.xml file:
FQDN="pcscf.koffee-ims.in"
Realm="koffee-ims.in"
<Peer FQDN="pcrf.kofee-ims.in" Realm="koffee-ims.in" port="3868"/>
<Acceptor port="3871" bind="115.98.3.93"/>
<DefaultRoute FQDN="pcrf.koffee-ims.in" metric="10"/>

In distpatcher.list file:
1 sip:115.98.3.93:6060

In kamailio.cfg file:
modparam("ims_usrloc_pcscf", "db_url", "mysql://root:[email protected]/pcscf")
modparam("pua", "db_url", "mysql://scscf:[email protected]/scscf")
mpath="/usr/local/src/kamailio-5.0/kamailio/src/modules/"

I-CSCF:
-------
- use modified files: icscf.cfg, icscf.xml and kamailio.cfg with Ip addresses and domain name.
Example: In icscf.cfg file:
listen=udp:115.98.3.93:4060
alias=icscf.koffee-ims.in
#!define NETWORKNAME "koffee-ims.in"
#!define HOSTNAME "icscf.koffee-ims.in"
#!define DB_URL "mysql://icscf:[email protected]/icscf"

In icscf.xml file;
FQDN="icscf.koffee-ims.in"
Realm="koffee-ims.in"
<Peer FQDN="hss.koffee-ims.in" Realm="koffee-ims.in" port="3868"/>
<Acceptor port="3869" bind="115.98.3.93"/>
<DefaultRoute FQDN="hss.koffee-ims.in" metric="10"/>

In kamailio.cfg file:
listen=tcp:115.98.3.93:4060
mpath="/usr/local/src/kamailio-5.0/kamailio/src/modules/"

S-CSCF
------
- use modified files: scscf.cfg , scscf.xml, distpacher.list, and kamailio.cfg with Ip addresses and domain name.
Example: In scscf.cfg file:
listen=udp:115.98.3.93:6060
#!define NETWORKNAME "koffee-ims.in"
#!define HOSTNAME "scscf.koffee-ims.in"
#!define URI "sip:scscf.koffee-ims.in"
alias=scscf.koffee-ims.in
alias=koffee-ims.in
#!define ENUM_SUFFIX "koffee-ims.in."
#!define DB_URL "mysql://scscf:[email protected]/scscf"

In scscf.xml file:
FQDN="scscf.koffee-ims.in"
Realm="koffee-ims.in"
<Peer FQDN="hss.koffee-ims.in" Realm="koffee-ims.in" port="3868"/>
<Acceptor port="3870" bind="115.98.3.93"/>
<DefaultRoute FQDN="hss.koffee-ims.in" metric="10"/>

In kamailio.cfg file:
mpath="/usr/local/src/kamailio-5.0/kamailio/src/modules/"

Step 9: changes in all servers in hosts file...


 nano /etc/hosts

103.211.109.229 pcscf.apsfl-ims.in pcscf


103.211.109.230 icscf.apsfl-ims.in icscf
103.211.109.231 scscf.apsfl-ims.in scscf
103.211.109.228 hss.apsfl-ims.in hss
103.211.109.228 presence.apsfl-ims.in presence

and in HSS server for login changes in the hss.conf file.


 nano /etc/apache2/sites-enabled/hss.conf (and)
 nano /etc/apache2/sites-available/hss.conf
add these two line are:
ProxyPass / http://103.211.109.228:8080/
ProxyPassReverse / http://103.211.109.228:8080/
Now run the IMS:

before running set resolv.conf file... /etc/resolv.conf

ipaddress and gateway...

Just run the initims.sh script,


in this script-file runs bind server, RTPENGINE and kamailio pid file creation.
Initims.sh run command is
firtst give a executable permissions use bellow command:
 # chmod +x initims.sh
 # ./initims.sh

Now run the IMS configuration files:


p-cscf:
 # kamailio -f /usr/local/etc/pcscf/kamailio.cfg
i-cscf:
 # kamailio -f /usr/local/etc/icscf/kamailio.cfg
s-cscf:
 # kamailio -f /usr/local/etc/scscf/kamailio.cfg

in client pc set the dns setting in network configuration


prefered dnd server:- “192.168.1.9”(ims proxy server ip)
alternate dnd server:-”191.168.0.1”(main server ip)

You might also like