Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions build-and-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

source $(dirname $0)/common.source

SDR=$1
ROOT=`pwd`

usage () {
echo "# - Usage: $0 radio-type"
echo "# - Valid radio types are: SDR1, USRP1, B100, B110, B200, B210, N200, N210"
exit 1
}

if [ "$EUID" -ne 0 ]
then echo "# - $(whoami) please run ${0}(me) as root"
# sudo $0 $SDR
exit 1
fi

if [ -z "$SDR" ]; then
echo "# - ERROR : radio type must be specified"
usage
exit 1
fi

./clone.sh
./build.sh $SDR asterisk
./build.sh $SDR liba53

cd ${ROOT}/libcoredumper
./build.sh LOCAL
sayAndDo "dpkg -i libcoredumper1_1.2.1-1_*.deb"
sayAndDo "dpkg -i libcoredumper-dev_1.2.1-1_*.deb"

cd $ROOT
./build.sh $SDR subscriberRegistry
./build.sh $SDR smqueue
./build.sh $SDR openbts
./build.sh $SDR asterisk-config

sayAndDo "find BUILDS -name range-asterisk_11.7.0.5_*.deb -exec dpkg -i {} \;"
sayAndDo "find BUILDS -name liba53_0.1_*.deb -exec dpkg -i {} \;"
sayAndDo "find BUILDS -name smqueue_5.0_*.deb -exec dpkg -i {} \;"
sayAndDo "find BUILDS -name openbts_5.0_*.deb -exec dpkg -i {} \;"
sayAndDo "find BUILDS -name range-asterisk-config_5.0_all.deb -exec dpkg -i {} \;"

sayAndDo cp systemd-service-units-configuration/asterisk.service /etc/systemd/system/
sayAndDo cp systemd-service-units-configuration/sipauthserve.service /etc/systemd/system/
sayAndDo cp systemd-service-units-configuration/smqueue.service /etc/systemd/system/
sayAndDo cp systemd-service-units-configuration/openbts.service /etc/systemd/system/
sayAndDo systemctl daemon-reload

sayAndDo cp ./NodeManager/nmcli.py /OpenBTS/
sayAndDo chown -R asterisk:www-data /var/lib/asterisk

exit 0
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# See the COPYING file in the main directory for details.
Expand Down Expand Up @@ -115,6 +115,7 @@ installIfMissing libreadline-dev
installIfMissing libncurses5
installIfMissing libncurses5-dev
installIfMissing pkg-config
installIfMissing libboost-all-dev
# libsqliteodbc deps
installIfMissing cdbs
installIfMissing libsqlite0-dev
Expand Down
16 changes: 16 additions & 0 deletions systemd-service-units-configuration/asterisk.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Asterisk PBX for OpenBTS
After=network.target
Documentation=man:asterisk(8)

[Service]
Type=simple
Environment=statedir=/var/run/asterisk
Environment=LC_ALL=C
ExecStartPre=/bin/mkdir -p ${statedir}
ExecStart=/usr/sbin/asterisk -f -g
ExecStop=/usr/sbin/asterisk -rx 'core stop now'
ExecReload=/usr/sbin/asterisk -rx 'core reload'

[Install]
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions systemd-service-units-configuration/openbts.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=OpenBTS

[Service]
Type=simple
ExecStart=/OpenBTS/OpenBTS
WorkingDirectory=/OpenBTS

[Install]
WantedBy=multi-user.target
9 changes: 9 additions & 0 deletions systemd-service-units-configuration/sipauthserve.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=OpenBTS SIP Authorization Service

[Service]
Type=simple
ExecStart=/OpenBTS/sipauthserve

[Install]
WantedBy=multi-user.target
9 changes: 9 additions & 0 deletions systemd-service-units-configuration/smqueue.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=OpenBTS Store-and-Forward Short Message Service

[Service]
Type=simple
ExecStart=/OpenBTS/smqueue

[Install]
WantedBy=multi-user.target