Project

General

Profile

OpenBSC with Asterisk » History » Version 32

duo_kali, 06/07/2018 02:38 PM

1 31 duo_kali
DISCLAIMER
2 1 manatails
3 31 duo_kali
This page is user-contributed information, and not official documentation by the Osmocom project
4 1 manatails
5 32 duo_kali
h1. LimeSDR BUILD OpenBSC with ASTERISK (Ubuntu 16.04)
6 1 manatails
7
<pre>
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 12 duo_kali
#install core library and build dependencies
15
sudo apt-get install git g++ cmake libsqlite3-dev
16 1 manatails
17 12 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 26 duo_kali
#install graphics dependencies
21 1 manatails
sudo apt-get install libwxgtk3.0-dev freeglut3-dev gnuplot
22
23
24 32 duo_kali
** 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 12 duo_kali
41
42 31 duo_kali
Now build UHD driver and SoapySDR, SoapyUHD
43
<pre>
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
#Then we start compile UHD driver (install all dependency)
48 12 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 12 duo_kali
51
52
** Install UHD
53
git clone https://github.com/EttusResearch/uhd
54
cd uhd
55
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
# 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 12 duo_kali
76 1 manatails
export LD_LIBRARY_PATH=/usr/local/lib
77 30 duo_kali
78 1 manatails
----now find UHD:
79 30 duo_kali
80 1 manatails
uhd_find_devices
81 30 duo_kali
82
83 12 duo_kali
** 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
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 1 manatails
----try run command to find LimeSDR :
106
107 30 duo_kali
SoapySDRUtil --find
108 1 manatails
109
next....
110 19 duo_kali
111 31 duo_kali
</pre>
112 1 manatails
113 32 duo_kali
h1. NOW BUILD OSMO-TRX
114 1 manatails
115 31 duo_kali
<pre>
116 12 duo_kali
mkdir osmo
117
cd osmo
118 1 manatails
119 12 duo_kali
git clone https://github.com/osmocom/osmo-trx.git
120
cd osmo-trx
121
autoreconf -fi
122
./configure
123
make -j5
124
make check
125
sudo make install
126
sudo ldconfig
127 1 manatails
128
129
run on terminal: (too see its connect with SoapyUHD and UHD)
130 12 duo_kali
131 28 duo_kali
osmo-trx-uhd
132 1 manatails
133
134
next …..
135 31 duo_kali
</pre>
136 1 manatails
137
138 32 duo_kali
h1. OSMOCOM OpenBSC building 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
sudo apt install libpcsclite-dev libtalloc-dev libortp-dev libsctp-dev libmnl-dev libdbi-dev libdbd-sqlite3 libsqlite3-dev sqlite3 libc-ares-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
./configure --enable-trx
212
make
213 1 manatails
sudo make install
214 22 duo_kali
sudo ldconfig
215 31 duo_kali
</pre>
216 12 duo_kali
217
218
219 32 duo_kali
NOW INSTALLING “ASTERISK & OSMO-SIP-CONNECTOR"
220 31 duo_kali
<pre>
221 32 duo_kali
--Install dependencies:
222 12 duo_kali
223
The extension we are about to make requires to install some additional packages.
224
sudo apt-get install libsofia-sip-ua-glib-dev
225
sudo apt-get install asterisk
226
227 32 duo_kali
--Install osmo-sip-connector:
228 12 duo_kali
cd osmo
229
git clone git://git.osmocom.org/osmo-sip-connector.git
230
cd osmo-sip-connector
231
autoreconf -fi
232
./configure
233
make
234
sudo make install $$ sudo ldconfig
235
236
setting path for configuration
237
238
gedit ~/osmo/openbsc.cfg (file attached)
239
gedit ~/osmo/osmo-bts.cfg (file attached)
240
gedit ~/osmo/osmo-sip-connector.cfg (file attached)
241
242
243 32 duo_kali
--Asterisk configuration
244 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.
245
Set up the sip-trunk towards osmo-sip-connector:
246
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:
247
248
cd /etc/asterisk/
249
sudo gedit sip.conf
250
251
252
[GSM]
253
type=friend
254
host=127.0.0.1
255
dtmfmode=rfc2833
256
canreinvite=no
257
disallow=all
258 1 manatails
allow=gsm
259
context=gsmsubscriber
260 12 duo_kali
port=5069   
261 1 manatails
262 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
263
264
265 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. 
266
Set up a dialplan to route calls:
267
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:
268
269
cd /etc/asterisk
270
sudo gedit extensions.conf
271
272
[gsmsubscriber]
273
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
274
exten=>_XXXXX,n,HangUp
275 31 duo_kali
</pre>
276 12 duo_kali
277 31 duo_kali
NOW HOW TO RUN OPENBSC STACKS:
278 12 duo_kali
279 31 duo_kali
<pre>
280 12 duo_kali
** open terminal 
281
282
run:
283
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
284
285
286
open new terminal
287
run:
288
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
289
290
291 1 manatails
open new terminal
292 12 duo_kali
run:
293
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
294 23 duo_kali
295 12 duo_kali
296
open new terminal
297
run:
298
sudo asterisk -r
299
300
301
open new terminal
302
run:
303
osmo-trx-uhd -C ~/osmo/limesdr.cfg
304 28 duo_kali
305 12 duo_kali
open new terminal
306
run:
307
telnet localhost 4242
308
enable
309 31 duo_kali
</pre>
310 12 duo_kali
311 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)