OpenBSC with Asterisk » History » Revision 66
Revision 65 (duo_kali, 09/15/2018 05:08 PM) → Revision 66/72 (duo_kali, 10/24/2018 12:45 PM)
{{include(Disclaimer-user-content)}} {{>toc}} h1. How to install OpenBSC with Asterisk using LimeSDR (Ubuntu 16.04) h2. Build LimeSDR software and dependency ** Install Dependency sudo add-apt-repository -y ppa:myriadrf/drivers sudo apt-get update -install core library and build dependencies sudo apt-get install git g++ cmake libsqlite3-dev -install hardware support dependencies sudo apt-get install libsoapysdr-dev libi2c-dev libusb-1.0-0-dev -install graphics dependencies sudo apt-get install libwxgtk3.0-dev freeglut3-dev gnuplot h3. #Install LimeSuite git clone https://github.com/myriadrf/LimeSuite.git cd LimeSuite mkdir buildir && cd buildir cmake ../ make -j4 sudo make install sudo ldconfig cd LimeSuite/udev-rules sudo sh ./install.sh Type “LimeSuiteGUI” on terminal to check GUI is running </pre> h2. Build UHD driver and SoapySDR, SoapyUHD (only install UHD if need UHD driver as USRP, skip UHD installation for LimeSDR) ***MAKE SURE YOU HAVE A FRESH INSTALL OR DO THIS TO REMOVE ALL UHD DRIVER FROM APT***** sudo apt-get remove libuhd-dev libuhd003 uhd-host #Then we start compile UHD driver (install all dependency) 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 h3. #Install UHD git clone https://github.com/EttusResearch/uhd cd uhd git tag -l ... release_003_009_004 release_003_009_005 release_003_010_000_000 - Example: For UHD 3.10.2.0: then type this command : git checkout release_003_010_002_000 (get the latest is fine) then build: cd host mkdir build cd build cmake ../ make sudo make install sudo ldconfig export LD_LIBRARY_PATH=/usr/local/lib ----now find UHD: uhd_find_devices h3. #Install SoapySDR and SoapyUHD git clone https://github.com/pothosware/SoapySDR.git cd SoapySDR mkdir build cd build cmake .. make sudo make install sudo ldconfig git clone https://github.com/pothosware/SoapyUHD cd SoapyUHD mkdir build cd build cmake .. make sudo make install sudo ldconfig ---try run command to find LimeSDR : SoapySDRUtil --find next.... </pre> h2. Build osmo-trx <pre> mkdir osmo cd osmo git clone https://github.com/osmocom/osmo-trx cd osmo-trx autoreconf -fi ./configure --with-lms make -j5 make check sudo make install sudo ldconfig run on terminal: osmo-trx-lms next ….. 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 </pre> h2. Build Osmocom OpenBSC with all stacks <pre> DEPENDENCY (use synaptic when they ask more dependency when build) 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 cd osmo git clone git://git.osmocom.org/libosmocore cd libosmocore autoreconf -fi ./configure make -j5 sudo make install cd osmo git clone git://git.osmocom.org/libosmo-abis cd libosmo-abis autoreconf -fi ./configure make -j5 sudo make install cd osmo git clone git://git.osmocom.org/libosmo-netif cd libosmo-netif autoreconf -fi ./configure make -j5 sudo make install cd osmo git clone git://git.osmocom.org/libosmo-sccp cd libosmo-sccp autoreconf -fi ./configure make -j5 sudo make install cd osmo git clone git://git.osmocom.org/libsmpp34 cd libsmpp34 autoreconf -fi ./configure make sudo make install cd osmo git clone git://git.osmocom.org/osmo-ggsn cd osmo-ggsn autoreconf -fi ./configure make -j5 sudo make install cd osmo git clone git://git.osmocom.org/openbsc cd openbsc/openbsc autoreconf -fi ./configure --enable-smpp --enable-osmo-bsc --enable-nat make -j5 sudo make install $$ sudo ldconfig cd osmo git clone git://git.osmocom.org/osmo-bts.git cd osmo-bts autoreconf -fi ./configure --enable-trx make sudo make install sudo ldconfig </pre> h2. Build asterisk & osmo-sip-connector --Install dependencies: The extension we are about to make requires to install some additional packages. sudo apt-get install libsofia-sip-ua-glib-dev h3. #Install osmo-sip-connector cd osmo git clone git://git.osmocom.org/osmo-sip-connector.git cd osmo-sip-connector autoreconf -fi ./configure make sudo make install $$ sudo ldconfig setting path for configuration gedit ~/osmo/openbsc.cfg (file attached) gedit ~/osmo/osmo-bts.cfg (file attached) gedit ~/osmo/osmo-sip-connector.cfg (file attached) h3. #Install Asterisk git clone -b 11 http://gerrit.asterisk.org/asterisk asterisk-11 cd asterisk-11 ./configure make sudo make install make samples --Asterisk configuration 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. Set up the sip-trunk towards osmo-sip-connector: 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: cd /etc/asterisk/ sudo gedit sip-custom-contexts.conf [GSM] type=friend host=127.0.0.1 dtmfmode=rfc2833 canreinvite=no disallow=all allow=gsm context=gsmsubscriber port=5069 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. Set up a dialplan to route calls: 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: cd /etc/asterisk sudo gedit extensions.conf [gsmsubscriber] exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN}) exten=>_XXXXX,n,HangUp note 1: notes: 5 times XXXXX, mean 5 digit number you setup on openbsc vty for msisdn. note 2: add this line at the very bottom of sip.conf if you dont have one "#include sip-custom-contexts.conf" </pre> h1. how to run OpenBSC stacks <pre> ** 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 open new terminal run: osmo-bts-trx -c ~/osmo/osmo-bts.cfg open new terminal run: osmo-sip-connector -c ~/osmo/osmo-sip-connector.cfg open new terminal run: sudo asterisk -cvvvvvvvv 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) open new terminal run: telnet localhost 4242 enable </pre> Now you running OpenBSC with Asterisk :-)