Project

General

Profile

OpenBSC with Asterisk » History » Version 55

duo_kali, 09/04/2018 03:00 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
24 42 duo_kali
h3. #Install LimeSuite
25 31 duo_kali
26 12 duo_kali
git clone https://github.com/myriadrf/LimeSuite.git
27
cd LimeSuite
28 50 duo_kali
mkdir buildir && cd buildir
29 12 duo_kali
cmake ../
30
make -j4
31
sudo make install
32 1 manatails
sudo ldconfig
33 12 duo_kali
34 1 manatails
cd LimeSuite/udev-rules
35 51 duo_kali
sudo sh ./install.sh
36 1 manatails
37 31 duo_kali
Type “LimeSuiteGUI” on terminal to check GUI is running
38 1 manatails
</pre>
39
40 55 duo_kali
h2. Build UHD driver and SoapySDR, SoapyUHD (only install UHD if need UHD driver as USRP, skip UHD installation for LimeSDR)
41 38 duo_kali
42 32 duo_kali
***MAKE SURE YOU HAVE A FRESH INSTALL OR DO THIS TO REMOVE ALL UHD DRIVER FROM APT*****
43 13 duo_kali
sudo apt-get remove libuhd-dev libuhd003 uhd-host
44
45 1 manatails
#Then we start compile UHD driver (install all dependency)
46 13 duo_kali
47 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
48 1 manatails
49 12 duo_kali
50 42 duo_kali
h3. #Install UHD
51
52 12 duo_kali
git clone https://github.com/EttusResearch/uhd
53 1 manatails
cd uhd
54 12 duo_kali
git tag -l
55
...
56 1 manatails
release_003_009_004
57 12 duo_kali
release_003_009_005
58 1 manatails
release_003_010_000_000
59
60 42 duo_kali
- Example: For UHD 3.10.2.0: 
61 31 duo_kali
then type this command :  
62 12 duo_kali
63 31 duo_kali
git checkout release_003_010_002_000 (get the latest is fine)
64
65
then build: 
66
67 12 duo_kali
cd host
68
mkdir build
69
cd build 
70 1 manatails
cmake ../
71
make
72 12 duo_kali
sudo make install
73 1 manatails
sudo ldconfig
74
75
export LD_LIBRARY_PATH=/usr/local/lib
76 30 duo_kali
77
----now find UHD:
78 1 manatails
79
uhd_find_devices
80 30 duo_kali
81
82 42 duo_kali
h3. #Install SoapySDR and SoapyUHD 
83 1 manatails
84
85 12 duo_kali
git clone https://github.com/pothosware/SoapySDR.git
86
cd SoapySDR
87 24 duo_kali
mkdir build
88 12 duo_kali
cd build
89
cmake ..
90
make
91
sudo make install
92
sudo ldconfig
93 1 manatails
94 12 duo_kali
git clone https://github.com/pothosware/SoapyUHD
95 1 manatails
cd SoapyUHD
96 24 duo_kali
mkdir build
97 12 duo_kali
cd build
98 1 manatails
cmake ..
99
make
100
sudo make install
101 19 duo_kali
sudo ldconfig
102
103
104 42 duo_kali
---try run command to find LimeSDR :
105 1 manatails
106
SoapySDRUtil --find
107
108
next....
109
110 37 duo_kali
</pre>
111 1 manatails
112 39 duo_kali
h2. Build osmo-trx
113 33 duo_kali
114 37 duo_kali
<pre>
115 12 duo_kali
mkdir osmo
116 1 manatails
cd osmo
117
118 51 duo_kali
git clone https://github.com/osmocom/osmo-trx
119 12 duo_kali
cd osmo-trx
120
autoreconf -fi
121 51 duo_kali
./configure --with-lms
122 12 duo_kali
make -j5
123
make check
124
sudo make install
125
sudo ldconfig
126 1 manatails
127
128
run on terminal: (too see its connect with SoapyUHD and UHD)
129 12 duo_kali
130 51 duo_kali
osmo-trx-lms
131 1 manatails
132
133 31 duo_kali
next …..
134 1 manatails
</pre>
135
136 39 duo_kali
h2. Build Osmocom OpenBSC with all stacks
137 1 manatails
138 31 duo_kali
<pre>
139 1 manatails
DEPENDENCY (use synaptic when they ask more dependency when build)
140 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 
141 12 duo_kali
142
143
cd osmo
144
git clone git://git.osmocom.org/libosmocore
145
cd libosmocore
146
autoreconf -fi
147
./configure
148
make -j5
149
sudo make install
150
151
152
cd osmo
153
git clone git://git.osmocom.org/libosmo-abis
154
cd libosmo-abis
155
autoreconf -fi
156
./configure
157
make -j5
158
sudo make install
159
160
161
cd osmo
162
git clone git://git.osmocom.org/libosmo-netif
163
cd libosmo-netif
164
autoreconf -fi
165
./configure
166
make -j5
167
sudo make install
168
169
170
cd osmo
171
git clone git://git.osmocom.org/libosmo-sccp
172
cd libosmo-sccp
173
autoreconf -fi
174
./configure
175
make -j5
176
sudo make install
177
178
179
cd osmo
180
git clone git://git.osmocom.org/libsmpp34
181
cd libsmpp34
182
autoreconf -fi
183
./configure
184
make
185
sudo make install
186
187
188
cd osmo
189
git clone git://git.osmocom.org/osmo-ggsn
190
cd osmo-ggsn
191
autoreconf -fi
192
./configure
193
make -j5
194
sudo make install
195
196
197
cd osmo
198 1 manatails
git clone git://git.osmocom.org/openbsc
199 12 duo_kali
cd openbsc/openbsc
200
autoreconf -fi
201 1 manatails
./configure --enable-smpp --enable-osmo-bsc --enable-nat
202 12 duo_kali
make -j5
203
sudo make install $$ sudo ldconfig
204
205
cd osmo
206
git clone git://git.osmocom.org/osmo-bts.git
207
cd osmo-bts
208
autoreconf -fi
209 1 manatails
./configure --enable-trx
210
make
211
sudo make install
212 31 duo_kali
sudo ldconfig
213 12 duo_kali
</pre>
214 1 manatails
215 40 duo_kali
h2. Build asterisk & osmo-sip-connector
216 38 duo_kali
217 32 duo_kali
--Install dependencies:
218 12 duo_kali
219
The extension we are about to make requires to install some additional packages.
220
sudo apt-get install libsofia-sip-ua-glib-dev
221
222 42 duo_kali
h3. #Install osmo-sip-connector
223
224 12 duo_kali
cd osmo
225
git clone git://git.osmocom.org/osmo-sip-connector.git
226
cd osmo-sip-connector
227 1 manatails
autoreconf -fi
228
./configure
229
make
230 12 duo_kali
sudo make install $$ sudo ldconfig
231
232
setting path for configuration
233
234
gedit ~/osmo/openbsc.cfg (file attached)
235 1 manatails
gedit ~/osmo/osmo-bts.cfg (file attached)
236
gedit ~/osmo/osmo-sip-connector.cfg (file attached)
237
238
h3. #Install Asterisk
239 12 duo_kali
240 52 duo_kali
git clone -b 11 http://gerrit.asterisk.org/asterisk asterisk-11
241 51 duo_kali
cd asterisk-11
242
./configure
243
make
244
sudo make install
245 12 duo_kali
246 32 duo_kali
--Asterisk configuration
247 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.
248
Set up the sip-trunk towards osmo-sip-connector:
249
The first that has to be taken care of is the connection to osmo-sip-connector. The following lines need be appended to sip.conf:
250
251
cd /etc/asterisk/
252
sudo gedit sip.conf
253
254
255
[GSM]
256
type=friend
257
host=127.0.0.1
258
dtmfmode=rfc2833
259
canreinvite=no
260
disallow=all
261 1 manatails
allow=gsm
262
context=gsmsubscriber
263 12 duo_kali
port=5069   
264 1 manatails
265 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
266
267
268 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. 
269
Set up a dialplan to route calls:
270 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:
271 12 duo_kali
272
cd /etc/asterisk
273
sudo gedit extensions.conf
274
275 1 manatails
[gsmsubscriber]
276 12 duo_kali
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
277
exten=>_XXXXX,n,HangUp
278 31 duo_kali
</pre>
279 12 duo_kali
280 44 duo_kali
h1. how to run OpenBSC stacks
281 12 duo_kali
282 31 duo_kali
<pre>
283 12 duo_kali
** open terminal 
284
285
run:
286
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
287
288
289
open new terminal
290
run:
291
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
292
293
294 1 manatails
open new terminal
295 12 duo_kali
run:
296
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
297
298
299 1 manatails
open new terminal
300 12 duo_kali
run:
301
sudo asterisk -r
302
303
304
open new terminal
305
run:
306 51 duo_kali
osmo-trx-lms -C ~/osmo/limesdr.cfg
307 53 duo_kali
or
308
osmo-trx-uhd -C ~/osmo/limesdr.cfg (if using usrp or other hardware used UHD)
309 28 duo_kali
310 12 duo_kali
open new terminal
311
run:
312
telnet localhost 4242
313
enable
314 31 duo_kali
</pre>
315 12 duo_kali
316 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)