Project

General

Profile

OpenBSC with Asterisk » History » Version 37

duo_kali, 06/07/2018 03:04 PM

1 34 duo_kali
{{include(Disclaimer-user-content)}}
2 31 duo_kali
3 36 duo_kali
h1. This page will describe how to install OpenBSC with Asterisk using LimeSDR (Ubuntu 16.04)
4 1 manatails
5
<pre>
6 31 duo_kali
7
** Install Dependency
8
9 12 duo_kali
sudo add-apt-repository -y ppa:myriadrf/drivers
10
sudo apt-get update
11 1 manatails
12 12 duo_kali
#install core library and build dependencies
13
sudo apt-get install git g++ cmake libsqlite3-dev
14 1 manatails
15 12 duo_kali
#install hardware support dependencies
16 1 manatails
sudo apt-get install libsoapysdr-dev libi2c-dev libusb-1.0-0-dev
17 12 duo_kali
18 26 duo_kali
#install graphics dependencies
19 1 manatails
sudo apt-get install libwxgtk3.0-dev freeglut3-dev gnuplot
20
21
22 32 duo_kali
** Install LimeSuite
23 31 duo_kali
24 12 duo_kali
git clone https://github.com/myriadrf/LimeSuite.git
25
cd LimeSuite
26
mkdir builddir && cd builddir
27 29 duo_kali
git checkout v17.12.0
28 12 duo_kali
cmake ../
29
make -j4
30
sudo make install
31 1 manatails
sudo ldconfig
32 12 duo_kali
33 27 duo_kali
cd LimeSuite/udev-rules
34 1 manatails
sudo sh ./install.sh
35
36
Type “LimeSuiteGUI” on terminal to check GUI is running
37 31 duo_kali
</pre>
38 12 duo_kali
39
40 37 duo_kali
*Now build UHD driver and SoapySDR, SoapyUHD*
41 31 duo_kali
<pre>
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
#Then we start compile UHD driver (install all dependency)
46 12 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 12 duo_kali
49
50
** Install UHD
51
git clone https://github.com/EttusResearch/uhd
52
cd uhd
53
git tag -l
54
...
55 1 manatails
release_003_009_004
56 12 duo_kali
release_003_009_005
57 1 manatails
release_003_010_000_000
58
59
# Example: For UHD 3.10.2.0: 
60 31 duo_kali
then type this command :  
61 12 duo_kali
62 31 duo_kali
git checkout release_003_010_002_000 (get the latest is fine)
63
64
then build: 
65
66 12 duo_kali
cd host
67
mkdir build
68
cd build 
69 1 manatails
cmake ../
70
make
71 12 duo_kali
sudo make install
72 1 manatails
sudo ldconfig
73 12 duo_kali
74 1 manatails
export LD_LIBRARY_PATH=/usr/local/lib
75 30 duo_kali
76 1 manatails
----now find UHD:
77 30 duo_kali
78 1 manatails
uhd_find_devices
79 30 duo_kali
80
81 12 duo_kali
** Install SoapySDR and SoapyUHD 
82 1 manatails
83
84 12 duo_kali
git clone https://github.com/pothosware/SoapySDR.git
85
cd SoapySDR
86 24 duo_kali
mkdir build
87 12 duo_kali
cd build
88
cmake ..
89
make
90
sudo make install
91
sudo ldconfig
92 1 manatails
93 12 duo_kali
git clone https://github.com/pothosware/SoapyUHD
94
cd SoapyUHD
95 24 duo_kali
mkdir build
96 12 duo_kali
cd build
97 1 manatails
cmake ..
98
make
99
sudo make install
100 19 duo_kali
sudo ldconfig
101
102
103 1 manatails
----try run command to find LimeSDR :
104
105 30 duo_kali
SoapySDRUtil --find
106 1 manatails
107
next....
108
109 37 duo_kali
</pre>
110 1 manatails
111 37 duo_kali
*Build osmo-trx*
112 33 duo_kali
113 37 duo_kali
<pre>
114 12 duo_kali
mkdir osmo
115
cd osmo
116 1 manatails
117 12 duo_kali
git clone https://github.com/osmocom/osmo-trx.git
118
cd osmo-trx
119
autoreconf -fi
120
./configure
121
make -j5
122
make check
123
sudo make install
124
sudo ldconfig
125 1 manatails
126
127
run on terminal: (too see its connect with SoapyUHD and UHD)
128 12 duo_kali
129 28 duo_kali
osmo-trx-uhd
130 1 manatails
131
132 31 duo_kali
next …..
133 1 manatails
</pre>
134
135
136 37 duo_kali
*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
sudo apt install libpcsclite-dev libtalloc-dev libortp-dev libsctp-dev libmnl-dev libdbi-dev libdbd-sqlite3 libsqlite3-dev sqlite3 libc-ares-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
./configure --enable-trx
210
make
211 1 manatails
sudo make install
212 31 duo_kali
sudo ldconfig
213 1 manatails
</pre>
214 12 duo_kali
215
216
217 37 duo_kali
*Now installing “asterisk & osmo-sip-connector"*
218 31 duo_kali
<pre>
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
sudo apt-get install asterisk
224
225 32 duo_kali
--Install osmo-sip-connector:
226 12 duo_kali
cd osmo
227
git clone git://git.osmocom.org/osmo-sip-connector.git
228
cd osmo-sip-connector
229
autoreconf -fi
230
./configure
231
make
232
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
241 32 duo_kali
--Asterisk configuration
242 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.
243
Set up the sip-trunk towards osmo-sip-connector:
244
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:
245
246
cd /etc/asterisk/
247
sudo gedit sip.conf
248
249
250
[GSM]
251
type=friend
252
host=127.0.0.1
253
dtmfmode=rfc2833
254
canreinvite=no
255
disallow=all
256 1 manatails
allow=gsm
257
context=gsmsubscriber
258 12 duo_kali
port=5069   
259 1 manatails
260 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
261
262
263 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. 
264
Set up a dialplan to route calls:
265
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:
266
267
cd /etc/asterisk
268
sudo gedit extensions.conf
269
270 1 manatails
[gsmsubscriber]
271 12 duo_kali
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
272
exten=>_XXXXX,n,HangUp
273 31 duo_kali
</pre>
274 12 duo_kali
275 37 duo_kali
*Now how to run openbsc stacks:*
276 12 duo_kali
277 31 duo_kali
<pre>
278 12 duo_kali
** open terminal 
279
280
run:
281
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
282
283
284
open new terminal
285
run:
286
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
287
288
289 1 manatails
open new terminal
290 12 duo_kali
run:
291
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
292 23 duo_kali
293 12 duo_kali
294
open new terminal
295
run:
296
sudo asterisk -r
297
298
299
open new terminal
300
run:
301
osmo-trx-uhd -C ~/osmo/limesdr.cfg
302 28 duo_kali
303 12 duo_kali
open new terminal
304
run:
305
telnet localhost 4242
306
enable
307 31 duo_kali
</pre>
308 12 duo_kali
309 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)