RTPEngine Installation on Amazon AMI

First, resolve the dependencies
$ yum install pkgconfig.x86_64 glib2-devel.x86_64 zlib-devel.x86_64 xmlrpc-c-devel.x86_64 libcurl.x86_64 libevent-devel.x86_64 iptables-devel.x86_64 kernel-headers.x86_64 kernel-devel.x86_64 gcc libpcap-devel.x86_64 hiredis-devel.x86_64 json-glib-devel.x86_64
$ sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
$ sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
$ yum install ffmpeg ffmpeg-devel -y
Download latest rtpengine from here.
$ cd /usr/local/src/
$ wget https://github.com/sipwise/rtpengine/archive/mr4.4.1.1.tar.gz
$ tar -zxvf mr4.4.1.1.tar.gz
$ cd rtpengine-mr4.4.1.1/daemon/
$ make
$ ln -s /usr/local/src/rtpengine-mr4.4.1.1/daemon/rtpengine /usr/bin/
$ cd ../iptables-extension/
$ make
$ cp libxt_RTPENGINE.so /lib64/xtables/
$ cd ../kernel-module/
$ make
$ cp xt_RTPENGINE.ko /lib/modules/4.4.8-20.46.amzn1.x86_64/updates/
$ depmod -a
$ modprobe xt_RTPENGINE
Installation complete.
But if faced the following error then
/usr/src/kernels/4.4.11-23.53.amzn1.x86_64/build: No such file or directory
disable selinux $ setenforce 0 and do the following steps
$ cd  /usr/src/kernels/4.4.11-23.53.amzn1.x86_64/
$ unlink build
$ ln -s /usr/src/kernels/4.4.11-23.53.amzn1.x86_64/ build
Start RTPEngine
$ rtpengine -p /var/run/rtpengine.pid -i <Private IP>\!<Public IP> -n 127.0.0.1:22222 -c 127.0.0.1:22223 -m 10000 -M 15000 -E -L 7 --offer-timeout 45 -s 20 -d 3 --tos 184 --no-fallback -b http://127.0.0.1:8000/xmlrpc -x 1
Enjoy ;)

Get Free SSL/TLS Certifcates

Download certbot from here.
$ wget https://github.com/certbot/certbot/archive/v0.8.0.tar.gz
$ tar -zxvf v0.8.0.tar.gz
$ cd certbot-0.8.0
$ ./certbot-auto
It give an error on AmazonAMI
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/certbot/main.py", line 11, in <module>
    import zope.component
  File "/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/zope/component/__init__.py", line 16, in <module>
    from zope.interface import Interface
ImportError: No module named interface
To resolve this use
$ unset PYTHON_INSTALL_LAYOUT

OpenSIPs installation on AmazonAMI

Need to install the dependencies first
yum install redhat-lsb-core mysql56-devel.x86_64 pcre-devel.x86_64 libmicrohttpd-devel.x86_64 lksctp-tools-devel.x86_64 ncurses-devel.x86_64 libxml2-devel.x86_64
yum groupinstall 'Development Tools'
to use redis
wget https://github.com/redis/hiredis/archive/v0.13.3.tar.gz
make
make install
Now your are good to install opensips

How To Change Timezone to Karachi (GMT+5) on CetnOS

There are a series of time zone files located at /usr/share/zoneinfo and active timezone used on your system is in the /etc/localtime file. You can change the current time to Paksitan Standard Time (PKT/GMT+5) by follwoing commands.
$ date
Thu  4 Feb 05:54:51 UTC 2016
$ mv /etc/localtime /etc/localtime.bkp
$ ln -s /usr/share/zoneinfo/Asia/Karachi /etc/localtime
$ date
Thu  4 Feb 10:55:12 PKT 2016
$
you can also configure other timezone by locating in following directory /usr/share/zoneinfo/Etc/GMT+5

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 ...