Project

General

Profile

OpenBSC with Asterisk » History » Version 64

duo_kali, 09/13/2018 09:35 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 56 duo_kali
h2. Build UHD driver and SoapySDR, SoapyUHD 
41
(only install UHD if need UHD driver as USRP, skip UHD installation for LimeSDR)
42 38 duo_kali
43 32 duo_kali
***MAKE SURE YOU HAVE A FRESH INSTALL OR DO THIS TO REMOVE ALL UHD DRIVER FROM APT*****
44 13 duo_kali
sudo apt-get remove libuhd-dev libuhd003 uhd-host
45
46 1 manatails
#Then we start compile UHD driver (install all dependency)
47 13 duo_kali
48 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
49 1 manatails
50 12 duo_kali
51 42 duo_kali
h3. #Install UHD
52
53 12 duo_kali
git clone https://github.com/EttusResearch/uhd
54 1 manatails
cd uhd
55 12 duo_kali
git tag -l
56
...
57 1 manatails
release_003_009_004
58 12 duo_kali
release_003_009_005
59 1 manatails
release_003_010_000_000
60
61 42 duo_kali
- Example: For UHD 3.10.2.0: 
62 31 duo_kali
then type this command :  
63 12 duo_kali
64 31 duo_kali
git checkout release_003_010_002_000 (get the latest is fine)
65
66
then build: 
67
68 12 duo_kali
cd host
69
mkdir build
70
cd build 
71 1 manatails
cmake ../
72
make
73 12 duo_kali
sudo make install
74 1 manatails
sudo ldconfig
75
76
export LD_LIBRARY_PATH=/usr/local/lib
77 30 duo_kali
78
----now find UHD:
79 1 manatails
80
uhd_find_devices
81 30 duo_kali
82
83 42 duo_kali
h3. #Install SoapySDR and SoapyUHD 
84 1 manatails
85
86 12 duo_kali
git clone https://github.com/pothosware/SoapySDR.git
87
cd SoapySDR
88 24 duo_kali
mkdir build
89 12 duo_kali
cd build
90
cmake ..
91
make
92
sudo make install
93
sudo ldconfig
94 1 manatails
95 12 duo_kali
git clone https://github.com/pothosware/SoapyUHD
96 1 manatails
cd SoapyUHD
97 24 duo_kali
mkdir build
98 12 duo_kali
cd build
99 1 manatails
cmake ..
100
make
101
sudo make install
102 19 duo_kali
sudo ldconfig
103
104
105 42 duo_kali
---try run command to find LimeSDR :
106 1 manatails
107
SoapySDRUtil --find
108
109
next....
110
111 37 duo_kali
</pre>
112 1 manatails
113 39 duo_kali
h2. Build osmo-trx
114 33 duo_kali
115 37 duo_kali
<pre>
116 12 duo_kali
mkdir osmo
117 1 manatails
cd osmo
118
119 51 duo_kali
git clone https://github.com/osmocom/osmo-trx
120 12 duo_kali
cd osmo-trx
121
autoreconf -fi
122 51 duo_kali
./configure --with-lms
123 12 duo_kali
make -j5
124
make check
125
sudo make install
126
sudo ldconfig
127 1 manatails
128
129 57 duo_kali
run on terminal: 
130 12 duo_kali
131 51 duo_kali
osmo-trx-lms
132 1 manatails
133
134 31 duo_kali
next …..
135 58 duo_kali
136
For best performance, downgrade your LimeSDR-USB to firmware/gateware version: LimeSDR-USB_HW_1.3_r3.0.img and LimeSDR-USB_HW_1.4_r2.9.rbf from LimeSuite V.17.09.0
137 1 manatails
</pre>
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 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 
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 40 duo_kali
h2. Build asterisk & osmo-sip-connector
219 38 duo_kali
220 32 duo_kali
--Install dependencies:
221 12 duo_kali
222
The extension we are about to make requires to install some additional packages.
223
sudo apt-get install libsofia-sip-ua-glib-dev
224
225 42 duo_kali
h3. #Install osmo-sip-connector
226
227 12 duo_kali
cd osmo
228
git clone git://git.osmocom.org/osmo-sip-connector.git
229
cd osmo-sip-connector
230 1 manatails
autoreconf -fi
231
./configure
232
make
233 12 duo_kali
sudo make install $$ sudo ldconfig
234
235
setting path for configuration
236
237
gedit ~/osmo/openbsc.cfg (file attached)
238 1 manatails
gedit ~/osmo/osmo-bts.cfg (file attached)
239
gedit ~/osmo/osmo-sip-connector.cfg (file attached)
240
241
h3. #Install Asterisk
242 12 duo_kali
243 52 duo_kali
git clone -b 11 http://gerrit.asterisk.org/asterisk asterisk-11
244 51 duo_kali
cd asterisk-11
245
./configure
246
make
247
sudo make install
248 63 duo_kali
make samples
249 12 duo_kali
250 32 duo_kali
--Asterisk configuration
251 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.
252
Set up the sip-trunk towards osmo-sip-connector:
253 62 duo_kali
The first that has to be taken care of is the connection to osmo-sip-connector. The following lines need be appended to sip-custom-contexts.conf:
254 12 duo_kali
255
cd /etc/asterisk/
256 62 duo_kali
sudo gedit sip-custom-contexts.conf
257 12 duo_kali
258
259
[GSM]
260
type=friend
261
host=127.0.0.1
262
dtmfmode=rfc2833
263
canreinvite=no
264
disallow=all
265 1 manatails
allow=gsm
266
context=gsmsubscriber
267 12 duo_kali
port=5069   
268 1 manatails
269 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
270
271
272 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. 
273
Set up a dialplan to route calls:
274 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:
275 12 duo_kali
276
cd /etc/asterisk
277
sudo gedit extensions.conf
278
279 1 manatails
[gsmsubscriber]
280 12 duo_kali
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
281
exten=>_XXXXX,n,HangUp
282 59 duo_kali
283
notes: 5 times XXXXX, mean 5 digit number you setup on openbsc vty for msisdn. 
284 31 duo_kali
</pre>
285 12 duo_kali
286 44 duo_kali
h1. how to run OpenBSC stacks
287 12 duo_kali
288 31 duo_kali
<pre>
289 12 duo_kali
** open terminal 
290
291
run:
292
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
293
294
295
open new terminal
296
run:
297
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
298
299
300 1 manatails
open new terminal
301 12 duo_kali
run:
302
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
303
304
305 1 manatails
open new terminal
306 12 duo_kali
run:
307 64 duo_kali
sudo asterisk -cvvvvvvvv
308 12 duo_kali
309
310
open new terminal
311
run:
312 51 duo_kali
osmo-trx-lms -C ~/osmo/limesdr.cfg
313 53 duo_kali
or
314
osmo-trx-uhd -C ~/osmo/limesdr.cfg (if using usrp or other hardware used UHD)
315 28 duo_kali
316 12 duo_kali
open new terminal
317
run:
318
telnet localhost 4242
319
enable
320 31 duo_kali
</pre>
321 12 duo_kali
322 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)