Project

General

Profile

OpenBSC with Asterisk » History » Version 33

duo_kali, 06/07/2018 02:48 PM

1 33 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
111
112 33 duo_kali
BUILD OSMO-TRX
113 31 duo_kali
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
next …..
133 31 duo_kali
</pre>
134 1 manatails
135
136 32 duo_kali
h1. OSMOCOM OpenBSC building 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 22 duo_kali
sudo ldconfig
213 31 duo_kali
</pre>
214 12 duo_kali
215
216
217 32 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
[gsmsubscriber]
271
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
272
exten=>_XXXXX,n,HangUp
273 31 duo_kali
</pre>
274 12 duo_kali
275 31 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)