Project

General

Profile

OpenBSC with Asterisk » History » Version 49

duo_kali, 06/10/2018 05:10 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 48 duo_kali
mkdir build && cd build
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 39 duo_kali
h2. Build Osmocom OpenBSC with all stacks
139 1 manatails
140 31 duo_kali
<pre>
141 1 manatails
DEPENDENCY (use synaptic when they ask more dependency when build)
142 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 
143 12 duo_kali
144
145
cd osmo
146
git clone git://git.osmocom.org/libosmocore
147
cd libosmocore
148
autoreconf -fi
149
./configure
150
make -j5
151
sudo make install
152
153
154
cd osmo
155
git clone git://git.osmocom.org/libosmo-abis
156
cd libosmo-abis
157
autoreconf -fi
158
./configure
159
make -j5
160
sudo make install
161
162
163
cd osmo
164
git clone git://git.osmocom.org/libosmo-netif
165
cd libosmo-netif
166
autoreconf -fi
167
./configure
168
make -j5
169
sudo make install
170
171
172
cd osmo
173
git clone git://git.osmocom.org/libosmo-sccp
174
cd libosmo-sccp
175
autoreconf -fi
176
./configure
177
make -j5
178
sudo make install
179
180
181
cd osmo
182
git clone git://git.osmocom.org/libsmpp34
183
cd libsmpp34
184
autoreconf -fi
185
./configure
186
make
187
sudo make install
188
189
190
cd osmo
191
git clone git://git.osmocom.org/osmo-ggsn
192
cd osmo-ggsn
193
autoreconf -fi
194
./configure
195
make -j5
196
sudo make install
197
198
199
cd osmo
200 1 manatails
git clone git://git.osmocom.org/openbsc
201 12 duo_kali
cd openbsc/openbsc
202
autoreconf -fi
203 1 manatails
./configure --enable-smpp --enable-osmo-bsc --enable-nat
204 12 duo_kali
make -j5
205
sudo make install $$ sudo ldconfig
206
207
cd osmo
208
git clone git://git.osmocom.org/osmo-bts.git
209
cd osmo-bts
210
autoreconf -fi
211 1 manatails
./configure --enable-trx
212
make
213
sudo make install
214 31 duo_kali
sudo ldconfig
215 12 duo_kali
</pre>
216 1 manatails
217 40 duo_kali
h2. Build asterisk & osmo-sip-connector
218 38 duo_kali
219 32 duo_kali
--Install dependencies:
220 12 duo_kali
221
The extension we are about to make requires to install some additional packages.
222
sudo apt-get install libsofia-sip-ua-glib-dev
223
224 42 duo_kali
h3. #Install osmo-sip-connector
225
226 12 duo_kali
cd osmo
227
git clone git://git.osmocom.org/osmo-sip-connector.git
228
cd osmo-sip-connector
229 1 manatails
autoreconf -fi
230
./configure
231
make
232 12 duo_kali
sudo make install $$ sudo ldconfig
233
234
setting path for configuration
235
236
gedit ~/osmo/openbsc.cfg (file attached)
237
gedit ~/osmo/osmo-bts.cfg (file attached)
238
gedit ~/osmo/osmo-sip-connector.cfg (file attached)
239
240 43 duo_kali
h3. #Install Asterisk
241 42 duo_kali
242
sudo apt-get install asterisk
243 12 duo_kali
244 32 duo_kali
--Asterisk configuration
245 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.
246
Set up the sip-trunk towards osmo-sip-connector:
247
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:
248
249
cd /etc/asterisk/
250
sudo gedit sip.conf
251
252
253
[GSM]
254
type=friend
255
host=127.0.0.1
256
dtmfmode=rfc2833
257
canreinvite=no
258
disallow=all
259 1 manatails
allow=gsm
260
context=gsmsubscriber
261 12 duo_kali
port=5069   
262 1 manatails
263 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
264
265
266 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. 
267
Set up a dialplan to route calls:
268 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:
269 12 duo_kali
270
cd /etc/asterisk
271
sudo gedit extensions.conf
272
273 1 manatails
[gsmsubscriber]
274 12 duo_kali
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
275
exten=>_XXXXX,n,HangUp
276 31 duo_kali
</pre>
277 12 duo_kali
278 44 duo_kali
h1. how to run OpenBSC stacks
279 12 duo_kali
280 31 duo_kali
<pre>
281 12 duo_kali
** open terminal 
282
283
run:
284
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
285
286
287
open new terminal
288
run:
289
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
290
291
292 1 manatails
open new terminal
293 12 duo_kali
run:
294
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
295 23 duo_kali
296 12 duo_kali
297
open new terminal
298
run:
299
sudo asterisk -r
300
301
302
open new terminal
303
run:
304
osmo-trx-uhd -C ~/osmo/limesdr.cfg
305 28 duo_kali
306 12 duo_kali
open new terminal
307
run:
308
telnet localhost 4242
309
enable
310 31 duo_kali
</pre>
311 12 duo_kali
312 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)