Project

General

Profile

OpenBSC with Asterisk » History » Version 52

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