Configuring SIP over TLS with Kamailio 5.1.6

Download the script from asterisk source ast_tls_cert
$ chmod +x ast_tls_cert
$ ./ast_tls_cert -C pbx.mycompany.com -O "My Super Company" -d /usr/local/etc/kamailio/certificates
$ ./ast_tls_cert -m client -c /usr/local/etc/kamailio/certificates/ca.crt -k /usr/local/etc/kamailio/certificates/ca.key -C phone1.mycompany.com -O "My Super Company" -d /usr/local/etc/kamailio/certificates -o client
$ cp /usr/local/etc/kamailio/certificates/asterisk.pem /usr/local/etc/asterisk/cert.pem
$ cp /usr/local/src/kamailio-5.1.6/src/modules/tls/tls.cfg /usr/local/etc/asterisk/
$ vim /usr/local/etc/asterisk/tls.cfg
 EDIT folowing lines
 private_key = /usr/local/etc/kamailio/certificates/asterisk.key
 certificate = /usr/local/etc/kamailio/certificates/asterisk.crt
 
$ vim /usr/local/etc/asterisk/kamailio.cfg
 ADD Following lines
 
 #!define WITH_TLS
 
 #!ifdef WITH_TLS
 loadmodule "tls.so"
 #!endif
  
 #!ifdef WITH_TLS
 listen=tls:192.168.3.21:5061
 #!endif
 
 #!ifdef WITH_TLS
 enable_tls=yes
 #!endif

 #!ifdef WITH_TLS
 # ----- tls params -----
 modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
 #!endif
$ systemctl start kamailio.service
Enjoy ;)

Kamailio 5.1.6 installation Steps on CentOS 7

For DB Integration, please find the installation step on this link
For Radius Integration, Please find the installation step on this link
Download latest LTS SRC from www.kamailio.org
$ cd /usr/local/src/
$ make cfg include_modules="db_mysql dialplan acc_radius auth_radius misc_radius lcr jsonrpcs xmlrpc rls ctl tls" skip_modules=app_sqlang PREFIX="/usr/local/SIPSer"
$ make all
$ make install
$ cd /usr/local/SIPSer/etc/kamailio
$ vim kamctlrc
 uncommennt DBENGINE, DBHOST, DBPORT, DBNAME, DBRWUSER and DBRWPW
$ /usr/local/SIPSer/sbin/kamdbctl create
$ cp /usr/local/src/kamailio-5.1.6/pkg/kamailio/centos/7/kamailio.sysconfig /etc/sysconfig/kamailio
$ vim /etc/sysconfig/kamailio
 EDIT USER and GROUP
$ cp /usr/local/src/kamailio-5.1.6/pkg/kamailio/centos/7/kamailio.service /etc/systemd/system/kamailio.service
$ vim /etc/systemd/system/kamailio.service
 EDIT CFGFILE, SBINFILE, SHM_MEMORY, PKG_MEMEORY
$ systemctl start kamailio.service
$ systemctl status kamailio.service
$ export LD_LIBRARY_PATH=/usr/local/lib/
If any module needed to recompile after installation, use the following commands.
$ make install-modules modules=modules/xmlrpc

Asterisk 13 with PJSIP Installation Steps on CentOS 7

Asterisk Installation Prerequisite
$ yum groupinstall "Development Tools"
$ yum install ncurses-devel.x86_64 libuuid-devel.x86_64 libxml2-devel sqlite-devel bison libical-devel.x86_64 neon.x86_64 unixODBC-devel.x86_64 speex.x86_64 libcurl.x86_64 libcurl-devel.x86_64 openssl.x86_64 openssl-libs.x86_64 openssl-devel.x86_64 git autoconf automake libtool
janssson will installed through git
$ cd /usr/src/
$ git clone https://github.com/akheron/jansson.git
$ cd jansson
$ autoreconf –i
$ ./configure –prefix=/usr/
$ make && make install
for chan_pjsip
$ cd /usr/src/
$ git clone https://github.com/pjsip/pjproject.git
$ cd pjprojects
$ ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG'
$ make dep
$ make
$ make install
$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
for further details about pjsip issues, please consult Asterisk wiki
Asterisk Installation Steps
$ cd /usr/src/
$ wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
$ tar –xzvf asterisk-13-current.tar.gz
$ cd asterisk-13.0.0
$ ./bootstrap.sh
# For Asterisk 13 and 14...
$ ./configure --with-pjproject-bundled
# For Asterisk 15+...
$ ./configure
$ make && make install
$ make samples
$ sudo make config
$ make samples
$ chkconfig asterisk on
Start Asterisk server
$ asterisk -r
Asterisk 13.23.1, Copyright (C) 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 13.23.1 currently running on ip-10-45-3-249 (pid = 8169)
Enjoy ;)

FreeRadiusClient Installation Steps

I tried configuring freeradius with Kamailio but Kamailio gives the error that it didn't find radiusclient-ng files. So I found a workaround for that
$ wget https://github.com/FreeRADIUS/freeradius-client/archive/release_1_1_7.tar.gz
$ tar -zxvf release_1_1_7.tar.gz
$ cd freeradius-client-release_1_1_7
$ ./configure
$ make
$ make install 
$ cd /usr/local/include/
$ ln -s freeradius-client.h radiusclient-ng.h
$ cd /usr/local/lib/
$ ln -s libfreeradius-client.la libradiusclient-ng.la
$ ln -s libfreeradius-client.so.2.0.0 libradiusclient-ng.so.2.0.0
$ ln -s libfreeradius-client.so.2.0.0 libradiusclient-ng.so.2
$ ln -s libfreeradius-client.so.2.0.0 libradiusclient-ng.so
cp /home/kamailio/radiusclient-ng/etc/radiusclient-ng/dictionary dictionary
Enjoy ;)

MySQL 5.7 Installation on CentOS 7

MYSQL Server Installation step by step
$ yum remobve mariadb-libs-5.5.56-2.el7.x86_64
$ yum install net-tools libxml2-devel.x86_64 libaio.x86_64 libaio-devel.x86_64
$ wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-client-5.7.23-1.el7.x86_64.rpm
$ wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-server-5.7.23-1.el7.x86_64.rpm
$ wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-devel-5.7.23-1.el7.x86_64.rpm
$ wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-common-5.7.23-1.el7.x86_64.rpm
$ wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-libs-5.7.23-1.el7.x86_64.rpm
$ rpm -i mysql-community-common-5.7.23-1.el7.x86_64.rpm
$ rpm -i mysql-community-libs-5.7.23-1.el7.x86_64.rpm
$ rpm -i mysql-community-client-5.7.23-1.el7.x86_64.rpm
$ rpm -i mysql-community-server-5.7.23-1.el7.x86_64.rpm
$ rpm -i mysql-community-devel-5.7.23-1.el7.x86_64.rpm
$ systemctl start mysqld
$ grep 'temporary password' /var/log/mysqld.log
2018-08-27T21:52:41.002744Z 1 [Note] A temporary password is generated for root@localhost: GyD?Srgeq0IC
$ mysql_secure_installation
$ mysqladmin -u root -p version
for MySQL8 you can follow this link 

Enjoy ;)

How to resize any VMs Hard disk size

Pre-Requiste First Confirm if your Linux machine was created using LVM or not, execute the following commands pvdisplay vgdisplay lvdisplay ...