Difference between revisions of "Kamailio: Instalasi"

From OnnoWiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Siapkan Repository==
 
==Siapkan Repository==
  
Lakukan
+
Edit sources.list
  
  apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfb40d3e6508ea4c8
+
  vi /etc/apt/sources.list
  
atau
+
Untuk bionic
  
  curl http://deb.kamailio.org/kamailiodebkey.gpg | apt-key add -
+
  deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse
 +
deb http://deb.kamailio.org/kamailio bionic main
 +
deb-src http://deb.kamailio.org/kamailio bionic main
  
Edit
+
Untuk focal
  
  vi /etc/apt/sources.list
+
  deb http://archive.ubuntu.com/ubuntu focal main universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu focal-security main universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu focal-updates main universe multiverse
 +
deb http://deb.kamailio.org/kamailio55 focal main
 +
deb-src http://deb.kamailio.org/kamailio55 focal main
  
dengan
 
  
deb http://deb.kamailio.org/kamailio xenial main
+
Tambahkan key
deb-src http://deb.kamailio.org/kamailio xenial main
 
  
 +
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfb40d3e6508ea4c8
 +
curl http://deb.kamailio.org/kamailiodebkey.gpg | apt-key add -
  
Lakukan
+
Update repo
  
  apt-get update
+
  apt update
  
 
==Instalasi==
 
==Instalasi==
  
 
  apt-get -y install kamailio kamailio-extra-modules kamailio-ims-modules \
 
  apt-get -y install kamailio kamailio-extra-modules kamailio-ims-modules \
  kamailio-mysql-modules kamailio-nth kamailio-presence-modules \
+
  kamailio-mysql-modules kamailio-presence-modules \
 
  kamailio-tls-modules kamailio-websocket-modules kamailio-xml-modules \
 
  kamailio-tls-modules kamailio-websocket-modules kamailio-xml-modules \
 
  kamailio-xmpp-modules
 
  kamailio-xmpp-modules
 
  
 
==Perbaiki Konfigurasi==
 
==Perbaiki Konfigurasi==
Line 54: Line 61:
  
  
==Dengan MySQL==
+
==Siapkan Database Percona==
 
 
Instalasi
 
  
  sudo apt-get intall mysql-server
+
  cd /usr/local/src
 +
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
 +
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
 +
apt update
 +
apt -y install percona-server-server-5.7
  
(asumsi username root, password 123456)
+
Set password root percona, kalau masih dalam proses belajar bisa menggunakan 123456
  
 
Edit
 
Edit
  
 
  vi /etc/kamailio/kamctlrc
 
  vi /etc/kamailio/kamctlrc
 
atau
 
 
vi /etc/kamailio/kamctl
 
  
 
Pastikan
 
Pastikan
  
  SIP_DOMAIN=192.168.0.xxx    # IP anda
+
  SIP_DOMAIN=192.168.0.xxx    # IPv4 atau
 +
SIP_DOMAIN=[2345::xxxx]    # IPv6
 
  DBENGINE=MYSQL
 
  DBENGINE=MYSQL
 
  DBHOST=localhost
 
  DBHOST=localhost
 +
DBPORT=3306
 
  DBNAME=kamailio
 
  DBNAME=kamailio
 
  DBRWUSER="root"
 
  DBRWUSER="root"
Line 81: Line 88:
 
  DBROPW="123456"    # password root
 
  DBROPW="123456"    # password root
 
  ALIASES_TYPE="DB"
 
  ALIASES_TYPE="DB"
  CTLENGINE="FIFO"
+
  # CTLENGINE="FIFO"
 
  VERBOSE=1
 
  VERBOSE=1
 
  PID_FILE=/var/run/kamailio/kamailio.pid
 
  PID_FILE=/var/run/kamailio/kamailio.pid
Line 92: Line 99:
  
 
  service kamailio restart
 
  service kamailio restart
 
  
 
==Menggunakan TLS==
 
==Menggunakan TLS==
Line 114: Line 120:
  
 
  kamctl db show subscriber
 
  kamctl db show subscriber
 +
 +
 +
==Monitoring Kamailio==
 +
 +
kamctl db show subscriber
 +
kamctl monitor
 +
kamctl online

Latest revision as of 14:19, 13 May 2022

Siapkan Repository

Edit sources.list

vi /etc/apt/sources.list

Untuk bionic

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse
deb http://deb.kamailio.org/kamailio bionic main
deb-src http://deb.kamailio.org/kamailio bionic main

Untuk focal

deb http://archive.ubuntu.com/ubuntu focal main universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-security main universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-updates main universe multiverse
deb http://deb.kamailio.org/kamailio55 focal main
deb-src http://deb.kamailio.org/kamailio55 focal main


Tambahkan key

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfb40d3e6508ea4c8
curl http://deb.kamailio.org/kamailiodebkey.gpg | apt-key add -

Update repo

apt update

Instalasi

apt-get -y install kamailio kamailio-extra-modules kamailio-ims-modules \
kamailio-mysql-modules kamailio-presence-modules \
kamailio-tls-modules kamailio-websocket-modules kamailio-xml-modules \
kamailio-xmpp-modules

Perbaiki Konfigurasi

Edit

vi /etc/default/kamailio

Pastikan

RUN_KAMAILIO=yes
USER=root
GROUP=root
CFGFILE=/etc/kamailio/kamailio.cfg
DUMP_CORE=yes

Restart

/etc/init.d/kamailio restart

atau

service kamailio restart


Siapkan Database Percona

cd /usr/local/src
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
apt update
apt -y install percona-server-server-5.7

Set password root percona, kalau masih dalam proses belajar bisa menggunakan 123456

Edit

vi /etc/kamailio/kamctlrc

Pastikan

SIP_DOMAIN=192.168.0.xxx    # IPv4 atau
SIP_DOMAIN=[2345::xxxx]     # IPv6
DBENGINE=MYSQL
DBHOST=localhost
DBPORT=3306
DBNAME=kamailio
DBRWUSER="root"
DBRWPW="123456"    # password root
DBROUSER="root"
DBROPW="123456"    # password root
ALIASES_TYPE="DB"
# CTLENGINE="FIFO"
VERBOSE=1
PID_FILE=/var/run/kamailio/kamailio.pid

Buat Database

kamdbctl create

Restart

service kamailio restart

Menggunakan TLS

Edit

/etc/kamailio/kamailio.cfg 

Masukan

#!define WITH_TLS

Restart

service kamailio restart


Manajemen User

kamctl add 123456 123456passwd
kamctl db show subscriber


Monitoring Kamailio

kamctl db show subscriber
kamctl monitor
kamctl online