Project

General

Profile

OpenBSC with Asterisk » History » Version 48

duo_kali, 06/10/2018 05:04 AM

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 45 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 48 duo_kali
mkdir build && cd build
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 46 duo_kali
h2. 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 39 duo_kali
h2. Build Osmocom OpenBSC with all stacks
139 1 manatails
140 31 duo_kali
<pre>
141 1 manatails
DEPENDENCY (use synaptic when they ask more dependency when build)
142 47 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
143 12 duo_kali
144 12 duo_kali
145 12 duo_kali
cd osmo
146 12 duo_kali
git clone git://git.osmocom.org/libosmocore
147 12 duo_kali
cd libosmocore
148 12 duo_kali
autoreconf -fi
149 12 duo_kali
./configure
150 12 duo_kali
make -j5
151 12 duo_kali
sudo make install
152 12 duo_kali
153 12 duo_kali
154 12 duo_kali
cd osmo
155 12 duo_kali
git clone git://git.osmocom.org/libosmo-abis
156 12 duo_kali
cd libosmo-abis
157 12 duo_kali
autoreconf -fi
158 12 duo_kali
./configure
159 12 duo_kali
make -j5
160 12 duo_kali
sudo make install
161 12 duo_kali
162 12 duo_kali
163 12 duo_kali
cd osmo
164 12 duo_kali
git clone git://git.osmocom.org/libosmo-netif
165 12 duo_kali
cd libosmo-netif
166 12 duo_kali
autoreconf -fi
167 12 duo_kali
./configure
168 12 duo_kali
make -j5
169 12 duo_kali
sudo make install
170 12 duo_kali
171 12 duo_kali
172 12 duo_kali
cd osmo
173 12 duo_kali
git clone git://git.osmocom.org/libosmo-sccp
174 12 duo_kali
cd libosmo-sccp
175 12 duo_kali
autoreconf -fi
176 12 duo_kali
./configure
177 12 duo_kali
make -j5
178 12 duo_kali
sudo make install
179 12 duo_kali
180 12 duo_kali
181 12 duo_kali
cd osmo
182 12 duo_kali
git clone git://git.osmocom.org/libsmpp34
183 12 duo_kali
cd libsmpp34
184 12 duo_kali
autoreconf -fi
185 12 duo_kali
./configure
186 12 duo_kali
make
187 12 duo_kali
sudo make install
188 12 duo_kali
189 12 duo_kali
190 12 duo_kali
cd osmo
191 12 duo_kali
git clone git://git.osmocom.org/osmo-ggsn
192 12 duo_kali
cd osmo-ggsn
193 12 duo_kali
autoreconf -fi
194 12 duo_kali
./configure
195 12 duo_kali
make -j5
196 12 duo_kali
sudo make install
197 12 duo_kali
198 12 duo_kali
199 12 duo_kali
cd osmo
200 1 manatails
git clone git://git.osmocom.org/openbsc
201 12 duo_kali
cd openbsc/openbsc
202 12 duo_kali
autoreconf -fi
203 1 manatails
./configure --enable-smpp --enable-osmo-bsc --enable-nat
204 12 duo_kali
make -j5
205 12 duo_kali
sudo make install $$ sudo ldconfig
206 12 duo_kali
207 12 duo_kali
cd osmo
208 12 duo_kali
git clone git://git.osmocom.org/osmo-bts.git
209 12 duo_kali
cd osmo-bts
210 12 duo_kali
autoreconf -fi
211 1 manatails
./configure --enable-trx
212 1 manatails
make
213 1 manatails
sudo make install
214 31 duo_kali
sudo ldconfig
215 12 duo_kali
</pre>
216 1 manatails
217 40 duo_kali
h2. Build asterisk & osmo-sip-connector
218 38 duo_kali
219 32 duo_kali
--Install dependencies:
220 12 duo_kali
221 12 duo_kali
The extension we are about to make requires to install some additional packages.
222 12 duo_kali
sudo apt-get install libsofia-sip-ua-glib-dev
223 12 duo_kali
224 42 duo_kali
h3. #Install osmo-sip-connector
225 42 duo_kali
226 12 duo_kali
cd osmo
227 12 duo_kali
git clone git://git.osmocom.org/osmo-sip-connector.git
228 12 duo_kali
cd osmo-sip-connector
229 1 manatails
autoreconf -fi
230 1 manatails
./configure
231 1 manatails
make
232 12 duo_kali
sudo make install $$ sudo ldconfig
233 12 duo_kali
234 12 duo_kali
setting path for configuration
235 12 duo_kali
236 12 duo_kali
gedit ~/osmo/openbsc.cfg (file attached)
237 12 duo_kali
gedit ~/osmo/osmo-bts.cfg (file attached)
238 12 duo_kali
gedit ~/osmo/osmo-sip-connector.cfg (file attached)
239 12 duo_kali
240 43 duo_kali
h3. #Install Asterisk
241 42 duo_kali
242 42 duo_kali
sudo apt-get install asterisk
243 12 duo_kali
244 32 duo_kali
--Asterisk configuration
245 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.
246 12 duo_kali
Set up the sip-trunk towards osmo-sip-connector:
247 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:
248 12 duo_kali
249 12 duo_kali
cd /etc/asterisk/
250 12 duo_kali
sudo gedit sip.conf
251 12 duo_kali
252 12 duo_kali
253 12 duo_kali
[GSM]
254 12 duo_kali
type=friend
255 12 duo_kali
host=127.0.0.1
256 12 duo_kali
dtmfmode=rfc2833
257 12 duo_kali
canreinvite=no
258 12 duo_kali
disallow=all
259 1 manatails
allow=gsm
260 1 manatails
context=gsmsubscriber
261 12 duo_kali
port=5069   
262 1 manatails
263 18 duo_kali
noted : (changing port with 5062 or 5060 if 5069 not working)
264 18 duo_kali
265 18 duo_kali
266 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. 
267 12 duo_kali
Set up a dialplan to route calls:
268 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:
269 12 duo_kali
270 12 duo_kali
cd /etc/asterisk
271 12 duo_kali
sudo gedit extensions.conf
272 12 duo_kali
273 1 manatails
[gsmsubscriber]
274 12 duo_kali
exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN})
275 12 duo_kali
exten=>_XXXXX,n,HangUp
276 31 duo_kali
</pre>
277 12 duo_kali
278 44 duo_kali
h1. how to run OpenBSC stacks
279 12 duo_kali
280 31 duo_kali
<pre>
281 12 duo_kali
** open terminal 
282 12 duo_kali
283 12 duo_kali
run:
284 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
285 12 duo_kali
286 12 duo_kali
287 12 duo_kali
open new terminal
288 12 duo_kali
run:
289 12 duo_kali
osmo-bts-trx -c ~/osmo/osmo-bts.cfg
290 12 duo_kali
291 12 duo_kali
292 1 manatails
open new terminal
293 12 duo_kali
run:
294 12 duo_kali
osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg
295 23 duo_kali
296 12 duo_kali
297 12 duo_kali
open new terminal
298 12 duo_kali
run:
299 12 duo_kali
sudo asterisk -r
300 12 duo_kali
301 12 duo_kali
302 12 duo_kali
open new terminal
303 12 duo_kali
run:
304 12 duo_kali
osmo-trx-uhd -C ~/osmo/limesdr.cfg
305 28 duo_kali
306 12 duo_kali
open new terminal
307 12 duo_kali
run:
308 12 duo_kali
telnet localhost 4242
309 12 duo_kali
enable
310 31 duo_kali
</pre>
311 12 duo_kali
312 28 duo_kali
Now you running OpenBSC with Asterisk :-)
Add picture from clipboard (Maximum size: 48.8 MB)