OpenBTS: RangeNetwork Compile OpenBTS 5.0

From OnnoWiki
Revision as of 10:34, 8 May 2019 by Onnowpurbo (Talk | contribs) (Running)

Jump to: navigation, search

Sumber: https://github.com/RangeNetworks/dev/wiki


Persiapan Environment

* Siapkan Ubuntu Desktop / Server 32 bit 16.04

    • SSH terinstalasi & beroperasi
    • username openbts
    • password openbts
  • Ada sambungkan ke Internet untuk men-download source code. Pastikan sambungan tersebut KENCENG / NGEBUT :) ... 1-2Mbps OK
  • Sebaiknya IP address yang digunakan 192.168.0.21 & 192.168.0.22
  • Instalasi aplikasi pendukung
sudo apt -y install m4 autoconf autotools-dev automake libsqlite3-dev \
sqlite3 libssl-dev libssl-doc zlib1g-dev \
build-essential dh-apparmor dpkg-dev fakeroot g++ gettext \
html2text intltool-debian libalgorithm-diff-perl \
libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl \
libgettextpo0 libmail-sendmail-perl libstdc++-5-dev  \
libsys-hostname-long-perl dh-apparmor dpkg-dev fakeroot g++ gettext \
html2text intltool-debian dh-translations intltool \
libxml-parser-perl python-scour libsqlite0 libsqlite0-dev \
libodbc1 odbcinst odbcinst1debian2 unixodbc-dev git bind9 ntp ntpdate upstart

Update Git

Pastikan menggunakan git versi terakhir. Edit

vi /etc/apt/sources.list

Tambahkan

deb http://ppa.launchpad.net/git-core/ppa/ubuntu xenial main

Lakukan


sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt -y install git

Download Tool

Check versi git (pastikan > 1.8.2), misalnya

git --version
git version 2.21.0

Alternatif lain, compile git dari source code menggunakan cara


download tool development terbaru

rm -Rf /usr/local/src/dev
cd /usr/local/src
git clone https://github.com/RangeNetworks/dev.git

Download Source Code

Pada masa lalu, proses download source code menggunakan SSH secara automatis login. Ini hanya bisa dilakukan jika kita sudah generate SSH key untuk GitHub. Lakukan generate SSH key untuk GitHub sebelum melakukan perintah di bawah ini.

Saat ini, kita bisa download secara automatis tanpa perlu setup sshkey untuk github,

cd /usr/local/src/dev
./clone.sh

Build

Kita perlu memilih branch yang akan di compile menggunakan switchto.sh. Sebaiknya pilih branch MASTER terlebih dulu

$ ./switchto.sh master

atau

$ ./switchto.sh 5.0

Setelah memilih branch yang ingin di compile (sebaiknya pilih master), lakukan build

$ ./build.sh SDR1

Proses build akan memakan waktu lumayan lama & akan mendownload banyak source code dari Internet. Pastikan sambungan Internet anda benar-benar joss.

Packages yang berhasil di compile ada di directory BUILD-sometimestamp.

Install

Instalasi aplikasi pendukung

sudo apt-get install bind9 ntp ntpdate

Gunakan dpkg untuk menginstalasi package (ini akan complain depedencies):

sudo dpkg -i BUILD-timestamp/*.deb

Gunakan aptitude untuk mengatasi masalah dependencies

sudo apt-get -f install

Jika di tanya tentang overwrite file konfigurasi, anda harus menentukan. Sangat disarankan untuk overwrite semua file konfigurasi agar jalan dengan baik.

Edit interfaces

Edit file /etc/network/interfaces sesuaikan dengan jaringan anda. Isi default /etc/network/interfaces kira-kira sebagai berikut


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        pre-up iptables-restore < /etc/OpenBTS/iptables.rules
        address 192.168.0.22
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
        # dns-* options are implemented by the resolvconf package, if installed
        # Please change this if you have DNS servers on your network, or
        # /etc/bind/named.conf.options if you want DNS caching functionality.
        dns-nameservers 192.168.0.22

# Please DO NOT EDIT THIS.
# You may lose access to your device if you edit this.
auto eth0:1
iface eth0:1 inet static
    name Console
    address 192.168.0.21
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255


hack

GSM.Handover.Noise.Factor

sqlite3 /etc/OpenBTS/OpenBTS.db

masukan

INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Handover.Noise.Factor',0,0,0,'hacked');
.exit


Tambah rc.local

Edit

vi /etc/rc.local

tambahkan sebelum exit

/usr/sbin/asterisk &
cd /OpenBTS
./sipauthserve &
sleep 5
./smqueue &
sleep 5
./OpenBTS &

open regitration & test

cd /OpenBTS/
./OpenBTSCLI
config Control.LUR.OpenRegistration .*

Lakukan

sudo su
sqlite3 /var/lib/asterisk/sqlite3dir/sqlite3.db

Pada prompt

sqlite>

Ketik

INSERT INTO dialdata_table (exten, dial) VALUES ('2001', 'IMSI001010000000001');
insert into sip_buddies (name,username,callerid,ipaddr,type,context,host) values ('IMSI001010000000001','IMSI001010000000001','2001','127.0.0.1','friend','phones','dynamic');

INSERT INTO dialdata_table (exten, dial) VALUES ('2002', 'IMSI001010000000002');
insert into sip_buddies (name,username,callerid,ipaddr,type,context,host) values ('IMSI001010000000002','IMSI001010000000002','2002','127.0.0.1','friend','phones','dynamic');

.exit


Untuk memperbaiki data (misalnya ID=1)

DELETE from SIP_BUDDIES where ID = 1;
DELETE from DIALDATA_TABLE where ID = 1;

audit parameter CLI OpenBTS

Menggunakan perintah "audit" di OpenBTSCLI lakukan

OpenBTS> audit
+---------------------------------------------------------------------+
| ERROR : Invalid Values [key current-value (default)]                |
|   To use the default value again, execute: rmconfig key             |
+---------------------------------------------------------------------+
Control.LUR.FailMode "ACCEPT" ("ACCEPT")
GSM.CCCH.BS_AG_BLKS_RES "auto" ("auto")
GSM.CCCH.BS_PA_MFRMS "2" ("2")
GSM.CallerID.Source "auto" ("auto")
NodeManager.API.PhysicalStatus "disabled" ("disabled")
SMS.MIMEType "application/vnd.3gpp.sms" ("application/vnd.3gpp.sms")


Remove semua error Value

rmconfig Control.LUR.FailMode
rmconfig GSM.CCCH.BS_AG_BLKS_RES
rmconfig GSM.CCCH.BS_PA_MFRMS
rmconfig GSM.CallerID.Source
rmconfig NodeManager.API.PhysicalStatus
rmconfig SMS.MIMEType

Running

Untuk menjalankan


/usr/sbin/asterisk &
cd /OpenBTS
./sipauthserve &
sleep 5
./smqueue &
sleep 5
./OpenBTS &

Debugging

Cek

tail /var/log/syslog

Referensi

Pranala Menarik

`