OpenBSC with Asterisk » History » Revision 12
Revision 11 (wirelesss, 12/08/2016 06:06 PM) → Revision 12/74 (duo_kali, 12/20/2017 03:46 AM)
LimeSDR BUILD OpenBSC with ASTERISK (Ubuntu 16.04) ** Install Dependency {{include(Disclaimer-user-content)}} <pre> sudo add-apt-repository -y ppa:myriadrf/drivers sudo apt-get update ***Please be aware that LCR is obsolete and osmo-sip-connector should be used istead.*** #install core library [[osmonitb:OsmoNITB LCR]] gives short setup 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 ** Install LimeSuite git clone https://github.com/myriadrf/LimeSuite.git cd LimeSuite mkdir builddir && cd builddir cmake ../ make -j4 sudo make install sudo ldconfig cd LimeSuite/udev-rules sudo ./install.sh Type “LimeSuiteGUI” on terminal run OsmoNITB and LCR with Asterisk. This tutorial describes a similar approach to check GUI is running Now set up an [[OpenBSC:]] network-in-a-box with Asterisk. Follow the instructions at [[Build from Source]] to build UHD driver and SoapySDR, Soapy UHD ** UHD (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 ** Install UHD the following Osmocom projects: git clone https://github.com/EttusResearch/uhd * libosmocore cd uhd * libosmo-abis git tag -l ... release_003_009_004 release_003_009_005 release_003_010_000_000 * openbsc lcr, mISDN and mISDNuser source codes are available at http://git.misdn.org # Example: For UHD 3.10.2.0: You can use git checkout release_003_010_002_000 (get client to download the latest if fine) source. cd host mkdir build cd build cmake ../ make sudo make install sudo ldconfig ** LCR export LD_LIBRARY_PATH=/usr/local/lib try run command to find LimeSDR : <pre> uhd_find_devices ** Install SoapySDR and SoapyUHD git clone https://github.com/pothosware/SoapySDR.git cd SoapySDR ../../lcr mkdiir build ln -s ../libosmocore/ . cd build ln -s ../openbsc/openbsc/ . cmake .. sh autogen.sh make ./configure --prefix=/usr --with-asterisk --with-gsm-bs sudo make install sudo ldconfig git clone https://github.com/pothosware/SoapyUHD cd SoapyUHD mkdiir build cd build cmake .. make sudo make install sudo ldconfig ** NOW BUILD OSMO-TRX mkdir osmo cp chan_lcr.so /usr/lib/asterisk/modules/ cd osmo </pre> git clone https://github.com/osmocom/osmo-trx.git On Debian 6 chan_lcr module will be loaded automatically on service restart, but in case it does not load cd osmo-trx automatically, it is recommend adding the following line to your @/etc/modules.conf@ autoreconf -fi ./configure make -j5 make check sudo make install sudo ldconfig run on terminal: (too see its connect with SoapyUHD and UHD) @load => chan_lcr.so@ osmo-trx next ….. ** OSMOCOM OpenBSC building with all stacks DEPENDENCY Ubuntu 16.10 sudo apt install libpcsclite-dev libtalloc-dev libortp-dev libsctp-dev libmnl-dev libdbi-dev libdbd-sqlite3 libsqlite3-dev sqlite3 libc-ares-dev cd osmo git clone git://git.osmocom.org/libosmocore cd libosmocore autoreconf -fi ./configure make -j5 make check sudo make install Configuring the system environment cd osmo <pre> git clone git://git.osmocom.org/libosmo-abis cd libosmo-abis autoreconf -fi ./configure make -j5 make check sudo make install cd osmo git clone git://git.osmocom.org/libosmo-netif cd libosmo-netif autoreconf -fi ./configure make -j5 make check sudo make install cd osmo git clone git://git.osmocom.org/libosmo-sccp cd libosmo-sccp autoreconf -fi ./configure make -j5 make check sudo make install cd osmo git clone git://git.osmocom.org/libsmpp34 cd libsmpp34 autoreconf -fi ./configure make make check sudo make install cd osmo git clone git://git.osmocom.org/osmo-ggsn cd osmo-ggsn autoreconf -fi ./configure make -j5 make check 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 make check sudo make install $$ sudo ldconfig cd osmo git clone git://git.osmocom.org/osmo-bts.git depmod –a cd osmo-bts modprobe mISDN_core autoreconf -fi modprobe mISDN_dsp ./configure --enable-trx modprobe mISDN_l1loop nchannel=30 interfaces=2 make make check sudo make install ** NOW INSTALLING “OSMO-SIP-CONNECTOR” </pre> ** Install dependencies: The extension we are about (Optional) Add following lines to make requires your @/etc/modules@ file if you want your system to install some additional packages. load the modules sudo apt-get install libsofia-sip-ua-glib-dev sudo apt-get install asterisk automatically during boot **Install osmo-sip-connector: <pre> cd osmo mISDN_core git clone git://git.osmocom.org/osmo-sip-connector.git mISDN_dsp cd osmo-sip-connector mISDN_l1loop nchannel=30 interfaces=2 autoreconf -fi ./configure make sudo make install $$ sudo ldconfig </pre> * Configuring LCR setting path for configuration * Configuring GSM-BS gedit ~/osmo/openbsc.cfg (file attached) <pre> gedit ~/osmo/osmo-bts.cfg (file attached) cd /usr/etc/lcr gedit ~/osmo/osmo-sip-connector.cfg (file attached) **Asterisk configuration nano interface.conf The following </pre> Uncomment GSM section will discuss a minimal Asterisk configuration that where it says ‘gsm-bs’. It is able to route calls between mobile phones. The described case assumes a freshly installed Asterisk with virgin configuration files. In the following we an interface for GSM Base Station, in this case, osmo-nitb. Now LCR will edit extensions.conf and sip.conf which can be found in the /etc/asterisk directory. The example below is not special connect to GSM, OpenBSC using its rather a normal SIP-trunk configuration. MNCC socket. Set up Add ‘bridge ast’ at the sip-trunk towards osmo-sip-connector: The first that has to be taken care bottom of is the connection to osmo-sip-connector. The following lines need GSM section. Now all calls from the GSM Base Station will be appended forwarded to sip.conf: Asterisk. cd /etc/asterisk/ ** Set up chan_lcr <pre> sudo gedit sip.conf [GSM] [ast] type=friend remote asterisk host=127.0.0.1 context from-lcr dtmfmode=rfc2833 earlyb no canreinvite=no tones yes disallow=all bridge GSM allow=gsm </pre> LCR will connect to Asterisk using chan_lcr using context name ‘from-lcr’. Calls from Asterisk will be context=gsmsubscriber port=5069 forwarded to OpenBSC. The connection is named GSM, this name phone numbers defined in hlr.sqlite3 will be used later to reference identify mobiles within the connection when routing outgoing calls. The context name “gsmsubscriber” references network. Please refer to the context where mobile originated calls are routed into example Asterisk configuration given below. ** Remove unnecessary interfaces Comment the dialplan. Set up a dialplan to route calls: last two interfaces named Ext and Int. We do not need these interfaces. Now you have Now Asterisk chan_lcr and osmo-sip-connector are connected. The following example introduces a very basic dialplan configuration GSM Base Station interface bridged to route each other. All calls between mobile phones. The following example can from one interface will be added redirected to extensions.conf: the other. No more routing configurations are necessary at this point. cd /etc/asterisk sudo gedit extensions.conf ** Set up permissions [gsmsubscriber] <pre> exten=>_XXXXX,1,Dial(SIP/GSM/${EXTEN}) nano options.conf exten=>_XXXXX,n,HangUp </pre> NOW HOW TO RUN : Uncomment the following 2 lines. LCR will not connect to chan_lcr if you do not set the user and group it runs on. ** open terminal run: <pre> 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 socketuser asterisk run: socketgroup asterisk osmo-bts-trx -c ~/osmo/osmo-bts.cfg open new terminal </pre> ** Configuring Asterisk Following is a simple example of asterisk dialplan that can be used to route all calls from OpenBSC back run: to OpenBSC. But a few extensions listed in the default dialplan are accessible. Add the following lines to osmo-sip-connector -c ./osmo/osmo-sip-connector.cfg open new terminal your @/etc/asterisk/extensions.conf@ <pre> run: [from-lcr] sudo asterisk -r open new terminal include => default run: exten => _X.,1,Dial(LCR/ast/${EXTEN:0},60) osmo-trx -c 1 -s 4 -e -l INFO </pre> open new terminal In this case, I am adding the default Asterisk dialplan. In Asterisk, default dialplan provides some features run: to test drive your network. You can call 1234 for information on Asterisk, and 600 for latency test. Please telnet localhost 4242 refer to the configuration file for more extensions. You might want to remove the default dialplan after enable you confirm that the network is working properly Now you running OpenBSC/BTS with Asterisk :-)