Project

General

Profile

OpenBSC with Asterisk » History » Version 69

duo_kali, 12/30/2021 03:52 AM

1 34 duo_kali
{{include(Disclaimer-user-content)}}
2 31 duo_kali
3 38 duo_kali
{{>toc}}
4
5 41 duo_kali
h1. How to install OpenBSC with Asterisk using LimeSDR (Ubuntu 16.04)
6 1 manatails
7 45 duo_kali
h2. Build LimeSDR software and dependency
8 31 duo_kali
9
** Install Dependency
10
11 12 duo_kali
sudo add-apt-repository -y ppa:myriadrf/drivers
12
sudo apt-get update
13 1 manatails
14 42 duo_kali
-install core library and build dependencies
15 12 duo_kali
sudo apt-get install git g++ cmake libsqlite3-dev
16 1 manatails
17 42 duo_kali
-install hardware support dependencies
18 1 manatails
sudo apt-get install libsoapysdr-dev libi2c-dev libusb-1.0-0-dev
19 12 duo_kali
20 42 duo_kali
-install graphics dependencies
21 1 manatails
sudo apt-get install libwxgtk3.0-dev freeglut3-dev gnuplot
22
23 68 duo_kali
-install other dependency
24 69 duo_kali
sudo apt-get install libghc-gnutls-dev libmnl-dev libsctp-dev
25 1 manatails
26 42 duo_kali
h3. #Install LimeSuite
27 31 duo_kali
28 12 duo_kali
git clone https://github.com/myriadrf/LimeSuite.git
29
cd LimeSuite
30 50 duo_kali
mkdir buildir && cd buildir
31 12 duo_kali
cmake ../
32
make -j4
33
sudo make install
34 1 manatails
sudo ldconfig
35 12 duo_kali
36 1 manatails
cd LimeSuite/udev-rules
37 51 duo_kali
sudo sh ./install.sh
38 1 manatails
39 31 duo_kali
Type “LimeSuiteGUI” on terminal to check GUI is running
40 1 manatails
</pre>
41
42 56 duo_kali
h2. Build UHD driver and SoapySDR, SoapyUHD 
43
(only install UHD if need UHD driver as USRP, skip UHD installation for LimeSDR)
44 38 duo_kali
45 32 duo_kali
***MAKE SURE YOU HAVE A FRESH INSTALL OR DO THIS TO REMOVE ALL UHD DRIVER FROM APT*****
46 13 duo_kali
sudo apt-get remove libuhd-dev libuhd003 uhd-host
47
48 1 manatails
#Then we start compile UHD driver (install all dependency)
49 13 duo_kali
50 25 duo_kali
sudo apt-get -y install git swig cmake doxygen build-essential libboost-all-dev libtool libusb-1.0-0 libusb-1.0-0-dev libudev-dev libncurses5-dev libfftw3-bin libfftw3-dev libfftw3-doc libcppunit-1.13-0v5 libcppunit-dev libcppunit-doc ncurses-bin cpufrequtils python-numpy python-numpy-doc python-numpy-dbg python-scipy python-docutils qt4-bin-dbg qt4-default qt4-doc libqt4-dev libqt4-dev-bin python-qt4 python-qt4-dbg python-qt4-dev python-qt4-doc python-qt4-doc libqwt6abi1 libfftw3-bin libfftw3-dev libfftw3-doc ncurses-bin libncurses5 libncurses5-dev libncurses5-dbg libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk3.0 git-core libqt4-dev python-numpy ccache python-opengl libgsl-dev python-cheetah python-mako python-lxml doxygen qt4-default qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libzmq-dev libzmq1 python-requests python-sphinx libcomedi-dev python-zmq  python3-dbg libgps-dev python3-dev python3-pip python3-tk python3-lxml python3-six
51 1 manatails
52 12 duo_kali
53 42 duo_kali
h3. #Install UHD
54
55 12 duo_kali
git clone https://github.com/EttusResearch/uhd
56 1 manatails
cd uhd
57 12 duo_kali
git tag -l
58
...
59 1 manatails
release_003_009_004
60 12 duo_kali
release_003_009_005
61 1 manatails
release_003_010_000_000
62
63 42 duo_kali
- Example: For UHD 3.10.2.0: 
64 31 duo_kali
then type this command :  
65 12 duo_kali
66 31 duo_kali
git checkout release_003_010_002_000 (get the latest is fine)
67
68
then build: 
69
70 12 duo_kali
cd host
71
mkdir build
72
cd build 
73 1 manatails
cmake ../
74
make
75 12 duo_kali
sudo make install
76 1 manatails
sudo ldconfig
77
78
export LD_LIBRARY_PATH=/usr/local/lib
79 30 duo_kali
80
----now find UHD:
81 1 manatails
82
uhd_find_devices
83 30 duo_kali
84
85 42 duo_kali
h3. #Install SoapySDR and SoapyUHD 
86 1 manatails
87
88 12 duo_kali
git clone https://github.com/pothosware/SoapySDR.git
89
cd SoapySDR
90 24 duo_kali
mkdir build
91 12 duo_kali
cd build
92
cmake ..
93
make
94
sudo make install
95
sudo ldconfig
96 1 manatails
97 12 duo_kali
git clone https://github.com/pothosware/SoapyUHD
98 1 manatails
cd SoapyUHD
99 24 duo_kali
mkdir build
100 12 duo_kali
cd build
101 1 manatails
cmake ..
102
make
103
sudo make install
104 19 duo_kali
sudo ldconfig
105
106
107 42 duo_kali
---try run command to find LimeSDR :
108 1 manatails
109
SoapySDRUtil --find
110
111
next....
112
113 37 duo_kali
</pre>
114 1 manatails
115 39 duo_kali
h2. Build osmo-trx
116 33 duo_kali
117 37 duo_kali
<pre>
118 12 duo_kali
mkdir osmo
119 1 manatails
cd osmo
120
121 51 duo_kali
git clone https://github.com/osmocom/osmo-trx
122 12 duo_kali
cd osmo-trx
123
autoreconf -fi
124 51 duo_kali
./configure --with-lms
125 12 duo_kali
make -j5
126
make check
127
sudo make install
128
sudo ldconfig
129 1 manatails
130
131 57 duo_kali
run on terminal: 
132 12 duo_kali
133 51 duo_kali
osmo-trx-lms
134 1 manatails
135
136 31 duo_kali
next …..
137 58 duo_kali
138
For best performance, downgrade your LimeSDR-USB to firmware/gateware version: LimeSDR-USB_HW_1.3_r3.0.img and LimeSDR-USB_HW_1.4_r2.9.rbf from LimeSuite V.17.09.0
139 1 manatails
</pre>
140
141 39 duo_kali
h2. Build Osmocom OpenBSC with all stacks
142 1 manatails
143 31 duo_kali
<pre>
144 1 manatails
DEPENDENCY (use synaptic when they ask more dependency when build)
145 49 duo_kali
sudo apt install libpcsclite-dev libtalloc-dev libortp-dev libsctp-dev libmnl-dev libdbi-dev libdbd-sqlite3 libsqlite3-dev sqlite3 libc-ares-dev libxml2-dev libssl-dev 
146 12 duo_kali
147
148
cd osmo
149
git clone git://git.osmocom.org/libosmocore
150
cd libosmocore
151
autoreconf -fi
152
./configure
153
make -j5
154
sudo make install
155 68 duo_kali
156
When installing libosmocore execute ./configure many people will encounter No package 'talloc' found such a mistake , because they can not talloc, Here is the solution
157
158
$ wget https://www.samba.org/ftp/talloc/talloc-2.1.7.tar.gz
159
$ tar -zxvf talloc-2.1.7.tar.gz
160
$ cd talloc-2.1.7/
161
$ ./configure
162
$ make
163
$ sudo make install
164 12 duo_kali
165
166
cd osmo
167
git clone git://git.osmocom.org/libosmo-abis
168
cd libosmo-abis
169
autoreconf -fi
170
./configure
171
make -j5
172
sudo make install
173
174
175
cd osmo
176
git clone git://git.osmocom.org/libosmo-netif
177
cd libosmo-netif
178
autoreconf -fi
179
./configure
180
make -j5
181
sudo make install
182
183
184
cd osmo
185
git clone git://git.osmocom.org/libosmo-sccp
186
cd libosmo-sccp
187
autoreconf -fi
188
./configure
189
make -j5
190
sudo make install
191
192
193
cd osmo
194
git clone git://git.osmocom.org/libsmpp34
195
cd libsmpp34
196
autoreconf -fi
197
./configure
198
make
199
sudo make install
200
201
202
cd osmo
203
git clone git://git.osmocom.org/osmo-ggsn
204
cd osmo-ggsn
205
autoreconf -fi
206
./configure
207
make -j5
208
sudo make install
209
210
211
cd osmo
212 1 manatails
git clone git://git.osmocom.org/openbsc
213 12 duo_kali
cd openbsc/openbsc
214
autoreconf -fi
215 1 manatails
./configure --enable-smpp --enable-osmo-bsc --enable-nat
216 12 duo_kali
make -j5
217
sudo make install $$ sudo ldconfig
218
219
cd osmo
220
git clone git://git.osmocom.org/osmo-bts.git
221
cd osmo-bts
222
autoreconf -fi
223 1 manatails
./configure --enable-trx
224
make
225
sudo make install
226 31 duo_kali
sudo ldconfig
227 12 duo_kali
</pre>
228 1 manatails
229 40 duo_kali
h2. Build asterisk & osmo-sip-connector
230 38 duo_kali
231 32 duo_kali
--Install dependencies:
232 12 duo_kali
233
The extension we are about to make requires to install some additional packages.
234
sudo apt-get install libsofia-sip-ua-glib-dev
235
236 42 duo_kali
h3. #Install osmo-sip-connector
237
238 12 duo_kali
cd osmo
239
git clone git://git.osmocom.org/osmo-sip-connector.git
240
cd osmo-sip-connector
241 1 manatails
autoreconf -fi
242
./configure
243
make
244 12 duo_kali
sudo make install $$ sudo ldconfig
245
246
setting path for configuration
247
248 67 laforge
gedit ~/osmo/openbsc.cfg (file attachment:openbsc.cfg)
249
gedit ~/osmo/osmo-bts.cfg (file attachment:osmo-bts.cfg)
250
gedit ~/osmo/osmo-sip-connector.cfg (file attachment:osmo-sip-connector.cfg)
251 1 manatails
252
h3. #Install Asterisk
253 12 duo_kali
254 52 duo_kali
git clone -b 11 http://gerrit.asterisk.org/asterisk asterisk-11
255 51 duo_kali
cd asterisk-11
256
./configure
257
make
258
sudo make install
259 63 duo_kali
make samples
260 12 duo_kali
261 32 duo_kali
--Asterisk configuration
262 12 duo_kali
The following section will discuss a minimal Asterisk configuration that is able to route calls between mobile phones. The described case assumes a freshly installed Asterisk with virgin configuration files. In the following we will edit extensions.conf and sip.conf which can be found in the /etc/asterisk directory. The example below is not special to GSM, its rather a normal SIP-trunk configuration.
263
Set up the sip-trunk towards osmo-sip-connector:
264 62 duo_kali
The first that has to be taken care of is the connection to osmo-sip-connector. The following lines need be appended to sip-custom-contexts.conf:
265 12 duo_kali
266
cd /etc/asterisk/
267 62 duo_kali
sudo gedit sip-custom-contexts.conf
268 12 duo_kali
269
270
[GSM]
271
type=friend
272
host=127.0.0.1
273
dtmfmode=rfc2833
274
canreinvite=no
275
disallow=all
276 1 manatails
allow=gsm
277
context=gsmsubscriber
278 12 duo_kali
port=5069   
279 1 manatails
280 18 duo_kali
281
282 12 duo_kali
The connection is named GSM, this name will be used later to reference the connection when routing outgoing calls. The context name “gsmsubscriber” references the context where mobile originated calls are routed into the dialplan. 
283
Set up a dialplan to route calls:
284 1 manatails
Now Asterisk and osmo-sip-connector are connected. The following example introduces a very basic dialplan configuration to route calls between mobile phones. The following example can be added to extensions.conf:
285 12 duo_kali
286
cd /etc/asterisk
287
sudo gedit extensions.conf
288
289 1 manatails
[gsmsubscriber]
290 12 duo_kali
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
291
exten=>_XXXXX,n,HangUp
292 59 duo_kali
293 66 duo_kali
note 1: 5 times XXXXX, mean 5 digit number you setup on openbsc vty for msisdn. 
294
note 2: add this line at the very bottom of sip.conf if you dont have one "#include sip-custom-contexts.conf"
295 31 duo_kali
</pre>
296 12 duo_kali
297 44 duo_kali
h1. how to run OpenBSC stacks
298 12 duo_kali
299 31 duo_kali
<pre>
300 12 duo_kali
** open terminal 
301
302
run:
303
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
304
305
306
open new terminal
307
run:
308
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
309
310
311 1 manatails
open new terminal
312 12 duo_kali
run:
313
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
314
315
316 1 manatails
open new terminal
317 12 duo_kali
run:
318 64 duo_kali
sudo asterisk -cvvvvvvvv
319 12 duo_kali
320
321
open new terminal
322
run:
323 51 duo_kali
osmo-trx-lms -C ~/osmo/limesdr.cfg
324 53 duo_kali
or
325
osmo-trx-uhd -C ~/osmo/limesdr.cfg (if using usrp or other hardware used UHD)
326 28 duo_kali
327 12 duo_kali
open new terminal
328
run:
329
telnet localhost 4242
330
enable
331 31 duo_kali
</pre>
332 12 duo_kali
333 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)