Project

General

Profile

OpenBSC with Asterisk » History » Version 36

duo_kali, 06/07/2018 02:55 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 31 duo_kali
Now build UHD driver and SoapySDR, SoapyUHD
41
<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
110 33 duo_kali
BUILD OSMO-TRX
111 31 duo_kali
112 12 duo_kali
mkdir osmo
113
cd osmo
114 1 manatails
115 12 duo_kali
git clone https://github.com/osmocom/osmo-trx.git
116
cd osmo-trx
117
autoreconf -fi
118
./configure
119
make -j5
120
make check
121
sudo make install
122
sudo ldconfig
123 1 manatails
124
125
run on terminal: (too see its connect with SoapyUHD and UHD)
126 12 duo_kali
127 28 duo_kali
osmo-trx-uhd
128 1 manatails
129
130
next …..
131 31 duo_kali
</pre>
132 1 manatails
133
134 32 duo_kali
h1. OSMOCOM OpenBSC building with all stacks 
135 1 manatails
136 31 duo_kali
<pre>
137 1 manatails
DEPENDENCY (use synaptic when they ask more dependency when build)
138
sudo apt install libpcsclite-dev libtalloc-dev libortp-dev libsctp-dev libmnl-dev libdbi-dev libdbd-sqlite3 libsqlite3-dev sqlite3 libc-ares-dev 
139 12 duo_kali
140
141
cd osmo
142
git clone git://git.osmocom.org/libosmocore
143
cd libosmocore
144
autoreconf -fi
145
./configure
146
make -j5
147
sudo make install
148
149
150
cd osmo
151
git clone git://git.osmocom.org/libosmo-abis
152
cd libosmo-abis
153
autoreconf -fi
154
./configure
155
make -j5
156
sudo make install
157
158
159
cd osmo
160
git clone git://git.osmocom.org/libosmo-netif
161
cd libosmo-netif
162
autoreconf -fi
163
./configure
164
make -j5
165
sudo make install
166
167
168
cd osmo
169
git clone git://git.osmocom.org/libosmo-sccp
170
cd libosmo-sccp
171
autoreconf -fi
172
./configure
173
make -j5
174
sudo make install
175
176
177
cd osmo
178
git clone git://git.osmocom.org/libsmpp34
179
cd libsmpp34
180
autoreconf -fi
181
./configure
182
make
183
sudo make install
184
185
186
cd osmo
187
git clone git://git.osmocom.org/osmo-ggsn
188
cd osmo-ggsn
189
autoreconf -fi
190
./configure
191
make -j5
192
sudo make install
193
194
195
cd osmo
196 1 manatails
git clone git://git.osmocom.org/openbsc
197 12 duo_kali
cd openbsc/openbsc
198
autoreconf -fi
199 1 manatails
./configure --enable-smpp --enable-osmo-bsc --enable-nat
200 12 duo_kali
make -j5
201
sudo make install $$ sudo ldconfig
202
203
cd osmo
204
git clone git://git.osmocom.org/osmo-bts.git
205
cd osmo-bts
206
autoreconf -fi
207
./configure --enable-trx
208
make
209 1 manatails
sudo make install
210 22 duo_kali
sudo ldconfig
211 31 duo_kali
</pre>
212 12 duo_kali
213
214
215 32 duo_kali
NOW INSTALLING “ASTERISK & OSMO-SIP-CONNECTOR"
216 31 duo_kali
<pre>
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
sudo apt-get install asterisk
222
223 32 duo_kali
--Install osmo-sip-connector:
224 12 duo_kali
cd osmo
225
git clone git://git.osmocom.org/osmo-sip-connector.git
226
cd osmo-sip-connector
227
autoreconf -fi
228
./configure
229
make
230
sudo make install $$ sudo ldconfig
231
232
setting path for configuration
233
234
gedit ~/osmo/openbsc.cfg (file attached)
235
gedit ~/osmo/osmo-bts.cfg (file attached)
236
gedit ~/osmo/osmo-sip-connector.cfg (file attached)
237
238
239 32 duo_kali
--Asterisk configuration
240 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.
241
Set up the sip-trunk towards osmo-sip-connector:
242
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:
243
244
cd /etc/asterisk/
245
sudo gedit sip.conf
246
247
248
[GSM]
249
type=friend
250
host=127.0.0.1
251
dtmfmode=rfc2833
252
canreinvite=no
253
disallow=all
254 1 manatails
allow=gsm
255
context=gsmsubscriber
256 12 duo_kali
port=5069   
257 1 manatails
258 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
259
260
261 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. 
262
Set up a dialplan to route calls:
263
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:
264
265
cd /etc/asterisk
266
sudo gedit extensions.conf
267
268
[gsmsubscriber]
269
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
270
exten=>_XXXXX,n,HangUp
271 31 duo_kali
</pre>
272 12 duo_kali
273 31 duo_kali
NOW HOW TO RUN OPENBSC STACKS:
274 12 duo_kali
275 31 duo_kali
<pre>
276 12 duo_kali
** open terminal 
277
278
run:
279
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
280
281
282
open new terminal
283
run:
284
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
285
286
287 1 manatails
open new terminal
288 12 duo_kali
run:
289
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
290 23 duo_kali
291 12 duo_kali
292
open new terminal
293
run:
294
sudo asterisk -r
295
296
297
open new terminal
298
run:
299
osmo-trx-uhd -C ~/osmo/limesdr.cfg
300 28 duo_kali
301 12 duo_kali
open new terminal
302
run:
303
telnet localhost 4242
304
enable
305 31 duo_kali
</pre>
306 12 duo_kali
307 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)