Installation Steps Kamailio v5.7.1
wget https://www.kamailio.org/pub/kamailio/latest/src/kamailio-5.7.0_src.tar.gz
tar -xf kamailio-5.7.0_src.tar.gz
cd kamailio-5.7.0
apt install libunistring-dev bison flex
make PREFIX="/opt/kamailio" include_modules="db_mysql tls websocket xmlrpc http_client" cfg
make Q=0 all
make install
cp pkg/kamailio/deb/debian/kamailio.service /etc/systemd/system/
cp pkg/kamailio/deb/debian/kamailio.default /etc/default/kamailio
mkdir -p /opt/kamailio/var/run/kamailio/
sed -i 's#/etc/kamailio/kamailio.cfg#/opt/kamailio/etc/kamailio/kamailio.cfg#1' /etc/systemd/system/kamailio.service
sed -i 's#/usr/sbin/kamailio#/opt/kamailio/sbin/kamailio#1' /etc/systemd/system/kamailio.service
sed -i 's#/run/kamailio/kamailio.pid#/opt/kamailio/var/run/kamailio/kamailio.pid#1' /etc/systemd/system/kamailio.service
useradd -M kamailio
chown -R kamailio:kamailio /opt/kamailio
systemctl daemon-reload
systemctl start kamailio
systemctl status kamailio
Create Database: Uncomment mysql components from the following file
vim /opt/kamailio/etc/kamailio/kamctlrc
DBENGINE=MYSQL
DBHOST=localhost
DBPORT=3306
DBNAME="kamailio"
DBUSER="kamailio"
DBRWPW="kamailio"
Now execute the following command to create kamaillio Database
/opt/kamailio/sbin/kamdbctl create
Deploy Kamailio Configuration
git clone https://github.com/hamidrhashmi/HBvideo
cd HBvideo/
cp * -r /opt/kamailio/etc/kamailio/
cd /opt/kamailio/etc/kamailio/
sed -i 's/192.168.0.132/PUBLIC-IP/g' kamailio.cfg && sed -i 's/192.168.0.132/PUBLIC-IP/g' tls.cfg
sed -i 's/kamailio.hbvoice.local/DOMAIN/g' kamailio.cfg
grep "ALTER TABLE" kamailio.cfg > update.sql
mysql -u kamailio -p kamailio < update.sql
systemctl restart kamailio
Add New SIP User
/opt/kamailio/sbin/kamctl add 12345@DOMAIN 1234543210
/opt/kamailio/sbin/kamctl add 54321@DOMAIN 1234543210
Upgradation Steps to Kamailio v5.8.1
systemctl stop kamailio
wget https://www.kamailio.org/pub/kamailio/latest/src/kamailio-5.8.1_src.tar.gz
tar -xvf kamailio-5.8.1_src.tar.gz
cd kamailio-5.7.0
apt install libunistring-dev bison flex
make PREFIX="/opt/kamailio" include_modules="db_mysql tls websocket xmlrpc http_client" cfg
make Q=0 all
make install
/opt/kamailio/sbin/kamailio -V
systemctl start kamailio
systemctl status kamailio
Enjoy 😉
Debugging Step
/opt/kamailio/sbin/kamailio -f /opt/kamailio/etc/kamailio/kamailio -D -d 2 -E
In Case you have to install some missing module use the following command
make install-modules modules=modules/xmlrpc
Good Luck 👍
No comments:
Post a Comment