Project

General

Profile

OpenBSC with Asterisk » History » Version 73

laforge, 11/07/2023 04:06 PM
try to fix formatting

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