Project

General

Profile

OpenBSC with Asterisk » History » Version 34

duo_kali, 06/07/2018 02:50 PM

1 34 duo_kali
{{include(Disclaimer-user-content)}}
2 31 duo_kali
3 1 manatails
4 32 duo_kali
h1. LimeSDR BUILD OpenBSC with ASTERISK (Ubuntu 16.04)
5 1 manatails
6
<pre>
7 31 duo_kali
8
** Install Dependency
9
10 12 duo_kali
sudo add-apt-repository -y ppa:myriadrf/drivers
11
sudo apt-get update
12 1 manatails
13 12 duo_kali
#install core library and build dependencies
14
sudo apt-get install git g++ cmake libsqlite3-dev
15 1 manatails
16 12 duo_kali
#install hardware support dependencies
17 1 manatails
sudo apt-get install libsoapysdr-dev libi2c-dev libusb-1.0-0-dev
18 12 duo_kali
19 26 duo_kali
#install graphics dependencies
20 1 manatails
sudo apt-get install libwxgtk3.0-dev freeglut3-dev gnuplot
21
22
23 32 duo_kali
** Install LimeSuite
24 31 duo_kali
25 12 duo_kali
git clone https://github.com/myriadrf/LimeSuite.git
26
cd LimeSuite
27
mkdir builddir && cd builddir
28 29 duo_kali
git checkout v17.12.0
29 12 duo_kali
cmake ../
30
make -j4
31
sudo make install
32 1 manatails
sudo ldconfig
33 12 duo_kali
34 27 duo_kali
cd LimeSuite/udev-rules
35 1 manatails
sudo sh ./install.sh
36
37
Type “LimeSuiteGUI” on terminal to check GUI is running
38 31 duo_kali
</pre>
39 12 duo_kali
40
41 31 duo_kali
Now build UHD driver and SoapySDR, SoapyUHD
42
<pre>
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
#Then we start compile UHD driver (install all dependency)
47 12 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 12 duo_kali
50
51
** Install UHD
52
git clone https://github.com/EttusResearch/uhd
53
cd uhd
54
git tag -l
55
...
56 1 manatails
release_003_009_004
57 12 duo_kali
release_003_009_005
58 1 manatails
release_003_010_000_000
59
60
# Example: For UHD 3.10.2.0: 
61 31 duo_kali
then type this command :  
62 12 duo_kali
63 31 duo_kali
git checkout release_003_010_002_000 (get the latest is fine)
64
65
then build: 
66
67 12 duo_kali
cd host
68
mkdir build
69
cd build 
70 1 manatails
cmake ../
71
make
72 12 duo_kali
sudo make install
73 1 manatails
sudo ldconfig
74 12 duo_kali
75 1 manatails
export LD_LIBRARY_PATH=/usr/local/lib
76 30 duo_kali
77 1 manatails
----now find UHD:
78 30 duo_kali
79 1 manatails
uhd_find_devices
80 30 duo_kali
81
82 12 duo_kali
** Install SoapySDR and SoapyUHD 
83 1 manatails
84
85 12 duo_kali
git clone https://github.com/pothosware/SoapySDR.git
86
cd SoapySDR
87 24 duo_kali
mkdir build
88 12 duo_kali
cd build
89
cmake ..
90
make
91
sudo make install
92
sudo ldconfig
93 1 manatails
94 12 duo_kali
git clone https://github.com/pothosware/SoapyUHD
95
cd SoapyUHD
96 24 duo_kali
mkdir build
97 12 duo_kali
cd build
98 1 manatails
cmake ..
99
make
100
sudo make install
101 19 duo_kali
sudo ldconfig
102
103
104 1 manatails
----try run command to find LimeSDR :
105
106 30 duo_kali
SoapySDRUtil --find
107 1 manatails
108
next....
109
110
111 33 duo_kali
BUILD OSMO-TRX
112 31 duo_kali
113 12 duo_kali
mkdir osmo
114
cd osmo
115 1 manatails
116 12 duo_kali
git clone https://github.com/osmocom/osmo-trx.git
117
cd osmo-trx
118
autoreconf -fi
119
./configure
120
make -j5
121
make check
122
sudo make install
123
sudo ldconfig
124 1 manatails
125
126
run on terminal: (too see its connect with SoapyUHD and UHD)
127 12 duo_kali
128 28 duo_kali
osmo-trx-uhd
129 1 manatails
130
131
next …..
132 31 duo_kali
</pre>
133 1 manatails
134
135 32 duo_kali
h1. OSMOCOM OpenBSC building with all stacks 
136 1 manatails
137 31 duo_kali
<pre>
138 1 manatails
DEPENDENCY (use synaptic when they ask more dependency when build)
139
sudo apt install libpcsclite-dev libtalloc-dev libortp-dev libsctp-dev libmnl-dev libdbi-dev libdbd-sqlite3 libsqlite3-dev sqlite3 libc-ares-dev 
140 12 duo_kali
141
142
cd osmo
143
git clone git://git.osmocom.org/libosmocore
144
cd libosmocore
145
autoreconf -fi
146
./configure
147
make -j5
148
sudo make install
149
150
151
cd osmo
152
git clone git://git.osmocom.org/libosmo-abis
153
cd libosmo-abis
154
autoreconf -fi
155
./configure
156
make -j5
157
sudo make install
158
159
160
cd osmo
161
git clone git://git.osmocom.org/libosmo-netif
162
cd libosmo-netif
163
autoreconf -fi
164
./configure
165
make -j5
166
sudo make install
167
168
169
cd osmo
170
git clone git://git.osmocom.org/libosmo-sccp
171
cd libosmo-sccp
172
autoreconf -fi
173
./configure
174
make -j5
175
sudo make install
176
177
178
cd osmo
179
git clone git://git.osmocom.org/libsmpp34
180
cd libsmpp34
181
autoreconf -fi
182
./configure
183
make
184
sudo make install
185
186
187
cd osmo
188
git clone git://git.osmocom.org/osmo-ggsn
189
cd osmo-ggsn
190
autoreconf -fi
191
./configure
192
make -j5
193
sudo make install
194
195
196
cd osmo
197 1 manatails
git clone git://git.osmocom.org/openbsc
198 12 duo_kali
cd openbsc/openbsc
199
autoreconf -fi
200 1 manatails
./configure --enable-smpp --enable-osmo-bsc --enable-nat
201 12 duo_kali
make -j5
202
sudo make install $$ sudo ldconfig
203
204
cd osmo
205
git clone git://git.osmocom.org/osmo-bts.git
206
cd osmo-bts
207
autoreconf -fi
208
./configure --enable-trx
209
make
210 1 manatails
sudo make install
211 22 duo_kali
sudo ldconfig
212 31 duo_kali
</pre>
213 12 duo_kali
214
215
216 32 duo_kali
NOW INSTALLING “ASTERISK & OSMO-SIP-CONNECTOR"
217 31 duo_kali
<pre>
218 32 duo_kali
--Install dependencies:
219 12 duo_kali
220
The extension we are about to make requires to install some additional packages.
221
sudo apt-get install libsofia-sip-ua-glib-dev
222
sudo apt-get install asterisk
223
224 32 duo_kali
--Install osmo-sip-connector:
225 12 duo_kali
cd osmo
226
git clone git://git.osmocom.org/osmo-sip-connector.git
227
cd osmo-sip-connector
228
autoreconf -fi
229
./configure
230
make
231
sudo make install $$ sudo ldconfig
232
233
setting path for configuration
234
235
gedit ~/osmo/openbsc.cfg (file attached)
236
gedit ~/osmo/osmo-bts.cfg (file attached)
237
gedit ~/osmo/osmo-sip-connector.cfg (file attached)
238
239
240 32 duo_kali
--Asterisk configuration
241 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.
242
Set up the sip-trunk towards osmo-sip-connector:
243
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:
244
245
cd /etc/asterisk/
246
sudo gedit sip.conf
247
248
249
[GSM]
250
type=friend
251
host=127.0.0.1
252
dtmfmode=rfc2833
253
canreinvite=no
254
disallow=all
255 1 manatails
allow=gsm
256
context=gsmsubscriber
257 12 duo_kali
port=5069   
258 1 manatails
259 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
260
261
262 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. 
263
Set up a dialplan to route calls:
264
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:
265
266
cd /etc/asterisk
267
sudo gedit extensions.conf
268
269
[gsmsubscriber]
270
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
271
exten=>_XXXXX,n,HangUp
272 31 duo_kali
</pre>
273 12 duo_kali
274 31 duo_kali
NOW HOW TO RUN OPENBSC STACKS:
275 12 duo_kali
276 31 duo_kali
<pre>
277 12 duo_kali
** open terminal 
278
279
run:
280
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
281
282
283
open new terminal
284
run:
285
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
286
287
288 1 manatails
open new terminal
289 12 duo_kali
run:
290
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
291 23 duo_kali
292 12 duo_kali
293
open new terminal
294
run:
295
sudo asterisk -r
296
297
298
open new terminal
299
run:
300
osmo-trx-uhd -C ~/osmo/limesdr.cfg
301 28 duo_kali
302 12 duo_kali
open new terminal
303
run:
304
telnet localhost 4242
305
enable
306 31 duo_kali
</pre>
307 12 duo_kali
308 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)