Project

General

Profile

OpenBSC with Asterisk » History » Version 71

duo_kali, 12/30/2021 07:10 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 68 duo_kali
-install other dependency
24 69 duo_kali
sudo apt-get install libghc-gnutls-dev libmnl-dev libsctp-dev
25 1 manatails
26 70 duo_kali
h3. #Install LimeSuite https://wiki.myriadrf.org/Lime_Suite
27 31 duo_kali
28 12 duo_kali
git clone https://github.com/myriadrf/LimeSuite.git
29
cd LimeSuite
30 50 duo_kali
mkdir buildir && cd buildir
31 12 duo_kali
cmake ../
32
make -j4
33
sudo make install
34 1 manatails
sudo ldconfig
35 12 duo_kali
36 1 manatails
cd LimeSuite/udev-rules
37 51 duo_kali
sudo sh ./install.sh
38 1 manatails
39 31 duo_kali
Type “LimeSuiteGUI” on terminal to check GUI is running
40 1 manatails
</pre>
41
42 56 duo_kali
h2. Build UHD driver and SoapySDR, SoapyUHD 
43
(only install UHD if need UHD driver as USRP, skip UHD installation for LimeSDR)
44 38 duo_kali
45 32 duo_kali
***MAKE SURE YOU HAVE A FRESH INSTALL OR DO THIS TO REMOVE ALL UHD DRIVER FROM APT*****
46 13 duo_kali
sudo apt-get remove libuhd-dev libuhd003 uhd-host
47
48 1 manatails
#Then we start compile UHD driver (install all dependency)
49 13 duo_kali
50 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
51 1 manatails
52 12 duo_kali
53 42 duo_kali
h3. #Install UHD
54
55 12 duo_kali
git clone https://github.com/EttusResearch/uhd
56 1 manatails
cd uhd
57 12 duo_kali
git tag -l
58
...
59 1 manatails
release_003_009_004
60 12 duo_kali
release_003_009_005
61 1 manatails
release_003_010_000_000
62
63 42 duo_kali
- Example: For UHD 3.10.2.0: 
64 31 duo_kali
then type this command :  
65 12 duo_kali
66 31 duo_kali
git checkout release_003_010_002_000 (get the latest is fine)
67
68
then build: 
69
70 12 duo_kali
cd host
71
mkdir build
72
cd build 
73 1 manatails
cmake ../
74
make
75 12 duo_kali
sudo make install
76 1 manatails
sudo ldconfig
77
78
export LD_LIBRARY_PATH=/usr/local/lib
79 30 duo_kali
80
----now find UHD:
81 1 manatails
82
uhd_find_devices
83 30 duo_kali
84
85 42 duo_kali
h3. #Install SoapySDR and SoapyUHD 
86 1 manatails
87
88 12 duo_kali
git clone https://github.com/pothosware/SoapySDR.git
89
cd SoapySDR
90 24 duo_kali
mkdir build
91 12 duo_kali
cd build
92
cmake ..
93
make
94
sudo make install
95
sudo ldconfig
96 1 manatails
97 12 duo_kali
git clone https://github.com/pothosware/SoapyUHD
98 1 manatails
cd SoapyUHD
99 24 duo_kali
mkdir build
100 12 duo_kali
cd build
101 1 manatails
cmake ..
102
make
103
sudo make install
104 19 duo_kali
sudo ldconfig
105
106
107 42 duo_kali
---try run command to find LimeSDR :
108 1 manatails
109
SoapySDRUtil --find
110
111
next....
112
113 37 duo_kali
</pre>
114 1 manatails
115 39 duo_kali
h2. Build osmo-trx
116 33 duo_kali
117 37 duo_kali
<pre>
118 12 duo_kali
mkdir osmo
119 1 manatails
cd osmo
120
121 51 duo_kali
git clone https://github.com/osmocom/osmo-trx
122 12 duo_kali
cd osmo-trx
123
autoreconf -fi
124 51 duo_kali
./configure --with-lms
125 12 duo_kali
make -j5
126
make check
127
sudo make install
128
sudo ldconfig
129 1 manatails
130
131 57 duo_kali
run on terminal: 
132 12 duo_kali
133 51 duo_kali
osmo-trx-lms
134 1 manatails
135
136 31 duo_kali
next …..
137 58 duo_kali
138
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
139 1 manatails
</pre>
140
141 39 duo_kali
h2. Build Osmocom OpenBSC with all stacks
142 1 manatails
143 31 duo_kali
<pre>
144 1 manatails
DEPENDENCY (use synaptic when they ask more dependency when build)
145 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 
146 12 duo_kali
147
148
cd osmo
149
git clone git://git.osmocom.org/libosmocore
150
cd libosmocore
151
autoreconf -fi
152
./configure
153
make -j5
154
sudo make install
155 68 duo_kali
156
When installing libosmocore execute ./configure many people will encounter No package 'talloc' found such a mistake , because they can not talloc, Here is the solution
157
158
$ wget https://www.samba.org/ftp/talloc/talloc-2.1.7.tar.gz
159
$ tar -zxvf talloc-2.1.7.tar.gz
160
$ cd talloc-2.1.7/
161
$ ./configure
162
$ make
163
$ sudo make install
164 12 duo_kali
165
166
cd osmo
167
git clone git://git.osmocom.org/libosmo-abis
168
cd libosmo-abis
169
autoreconf -fi
170
./configure
171
make -j5
172
sudo make install
173
174 71 duo_kali
when have DAHDI error, please do: sudo apt-get install build-essential libtool libortp-dev dahdi-source libsctp-dev shtool autoconf automake git-core pkg-config make gcc
175
176 12 duo_kali
177
cd osmo
178
git clone git://git.osmocom.org/libosmo-netif
179
cd libosmo-netif
180
autoreconf -fi
181
./configure
182
make -j5
183
sudo make install
184
185
186
cd osmo
187
git clone git://git.osmocom.org/libosmo-sccp
188
cd libosmo-sccp
189
autoreconf -fi
190
./configure
191
make -j5
192
sudo make install
193
194
195
cd osmo
196
git clone git://git.osmocom.org/libsmpp34
197
cd libsmpp34
198
autoreconf -fi
199
./configure
200
make
201
sudo make install
202
203
204
cd osmo
205
git clone git://git.osmocom.org/osmo-ggsn
206
cd osmo-ggsn
207
autoreconf -fi
208
./configure
209
make -j5
210
sudo make install
211
212
213
cd osmo
214 1 manatails
git clone git://git.osmocom.org/openbsc
215 12 duo_kali
cd openbsc/openbsc
216
autoreconf -fi
217 1 manatails
./configure --enable-smpp --enable-osmo-bsc --enable-nat
218 12 duo_kali
make -j5
219
sudo make install $$ sudo ldconfig
220
221
cd osmo
222
git clone git://git.osmocom.org/osmo-bts.git
223
cd osmo-bts
224
autoreconf -fi
225 1 manatails
./configure --enable-trx
226
make
227
sudo make install
228 31 duo_kali
sudo ldconfig
229 12 duo_kali
</pre>
230 1 manatails
231 40 duo_kali
h2. Build asterisk & osmo-sip-connector
232 38 duo_kali
233 32 duo_kali
--Install dependencies:
234 12 duo_kali
235
The extension we are about to make requires to install some additional packages.
236
sudo apt-get install libsofia-sip-ua-glib-dev
237
238 42 duo_kali
h3. #Install osmo-sip-connector
239
240 12 duo_kali
cd osmo
241
git clone git://git.osmocom.org/osmo-sip-connector.git
242
cd osmo-sip-connector
243 1 manatails
autoreconf -fi
244
./configure
245
make
246 12 duo_kali
sudo make install $$ sudo ldconfig
247
248
setting path for configuration
249
250 67 laforge
gedit ~/osmo/openbsc.cfg (file attachment:openbsc.cfg)
251
gedit ~/osmo/osmo-bts.cfg (file attachment:osmo-bts.cfg)
252
gedit ~/osmo/osmo-sip-connector.cfg (file attachment:osmo-sip-connector.cfg)
253 1 manatails
254
h3. #Install Asterisk
255 12 duo_kali
256 52 duo_kali
git clone -b 11 http://gerrit.asterisk.org/asterisk asterisk-11
257 51 duo_kali
cd asterisk-11
258
./configure
259
make
260
sudo make install
261 63 duo_kali
make samples
262 12 duo_kali
263 32 duo_kali
--Asterisk configuration
264 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.
265
Set up the sip-trunk towards osmo-sip-connector:
266 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:
267 12 duo_kali
268
cd /etc/asterisk/
269 62 duo_kali
sudo gedit sip-custom-contexts.conf
270 12 duo_kali
271
272
[GSM]
273
type=friend
274
host=127.0.0.1
275
dtmfmode=rfc2833
276
canreinvite=no
277
disallow=all
278 1 manatails
allow=gsm
279
context=gsmsubscriber
280 12 duo_kali
port=5069   
281 1 manatails
282 18 duo_kali
283
284 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. 
285
Set up a dialplan to route calls:
286 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:
287 12 duo_kali
288
cd /etc/asterisk
289
sudo gedit extensions.conf
290
291 1 manatails
[gsmsubscriber]
292 12 duo_kali
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
293
exten=>_XXXXX,n,HangUp
294 59 duo_kali
295 66 duo_kali
note 1: 5 times XXXXX, mean 5 digit number you setup on openbsc vty for msisdn. 
296
note 2: add this line at the very bottom of sip.conf if you dont have one "#include sip-custom-contexts.conf"
297 31 duo_kali
</pre>
298 12 duo_kali
299 44 duo_kali
h1. how to run OpenBSC stacks
300 12 duo_kali
301 31 duo_kali
<pre>
302 12 duo_kali
** open terminal 
303
304
run:
305
osmo-nitb -c ~/osmo/openbsc.cfg -l ~/osmo/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc
306
307
308
open new terminal
309
run:
310
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
311
312
313 1 manatails
open new terminal
314 12 duo_kali
run:
315
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
316
317
318 1 manatails
open new terminal
319 12 duo_kali
run:
320 64 duo_kali
sudo asterisk -cvvvvvvvv
321 12 duo_kali
322
323
open new terminal
324
run:
325 51 duo_kali
osmo-trx-lms -C ~/osmo/limesdr.cfg
326 53 duo_kali
or
327
osmo-trx-uhd -C ~/osmo/limesdr.cfg (if using usrp or other hardware used UHD)
328 28 duo_kali
329 12 duo_kali
open new terminal
330
run:
331
telnet localhost 4242
332
enable
333 31 duo_kali
</pre>
334 12 duo_kali
335 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)