Project

General

Profile

OpenBSC with Asterisk » History » Version 43

duo_kali, 06/07/2018 04:36 PM

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