How to Install Kamailio and Open5GS

·

2 min read

How to Install Kamailio and Open5GS

Prepare the System

apt update

apt upgrade -y

hostnamectl set-hostname sip.telco-sec.com

Install Dependencies

apt install -y mysql-server tcpdump screen ntp ntpdate git-core dkms gcc flex bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev bash-completion g++ autoconf rtpproxy libmnl-dev libsctp-dev libradcli-dev libradcli4

Allow SSH Root Login

sudo sed -i -e '/^#PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config

sudo systemctl restart sshd

Install Kamailio

apt install -y kamailio*

rfs@volte:/etc/kamailio$ sudo su
root@volte:/etc/kamailio# mysql_secure_installation

nano /etc/kamailio/kamailio.cfg
#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB
alias="ims.mnc001.mcc001.3gppnetwork.org"
listen=udp:192.168.1.195:5060 advertise 192.168.1.195:5060
listen=tcp:192.168.1.195:5060 advertise 192.168.1.195:5060
modparam("rtpproxy", "rtpproxy_sock", "udp:192.168.1.195:7722")
adduser --quiet --system --group --disabled-password \
        --shell /bin/false --gecos "Kamailio" \
        --home /var/run/kamailio kamailio
chown kamailio:kamailio /var/run/kamailio
sudo systemctl restart kamailio

Configure RTPProxy

vi /etc/default/rtpproxy 
# Defaults for rtpproxy

# The control socket.
#CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock"
# To listen on an UDP socket, uncomment this line:
#CONTROL_SOCK=udp:127.0.0.1:22222
CONTROL_SOCK=udp:127.0.0.1:7722

# Additional options that are passed to the daemon.
EXTRA_OPTS="-l 192.168.1.195 -d DBUG:LOG_LOCAL0"
sudo systemctl restart rtpproxy
sudo systemctl daemon-reload
sudo apt install -y debhelper default-libmysqlclient-dev gperf  libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbencode-perl libcrypt-openssl-rsa-perl libcrypt-rijndael-perl libdigest-crc-perl libdigest-hmac-perl libevent-dev libhiredis-dev libio-multiplex-perl libio-socket-inet6-perl libiptc-dev libjson-glib-dev libnet-interface-perl libpcap0.8-dev libsocket6-perl libspandsp-dev libswresample-dev libsystemd-dev libxmlrpc-core-c3-dev markdown dkms module-assistant keyutils libnfsidmap2 nfs-common rpcbind libxtables-dev libip6tc-dev libip4tc-dev

Did you find this article valuable?

Support TelcoSec by becoming a sponsor. Any amount is appreciated!