Project

General

Profile

OpenBSC with Asterisk » History » Version 46

duo_kali, 06/07/2018 04:43 PM

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