Revert "Override SERVER_ID that is sent for this OBP"

This reverts commit 36e7ed58b9.
This commit is contained in:
Simon 2021-07-20 23:14:59 +01:00
parent 36e7ed58b9
commit 501a557116
3 changed files with 18 additions and 38 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
###############################################################################
# Copyright (C) 2020-2021 Simon Adlem, G7RZU <g7rzu@gb7fr.org.uk>
# Copyright (C) 2020 Simon Adlem, G7RZU <g7rzu@gb7fr.org.uk>
# Copyright (C) 2016-2019 Cortney T. Buffington, N0MJS <n0mjs@me.com>
#
# This program is free software; you can redistribute it and/or modify
@ -19,6 +19,17 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
###############################################################################
'''
This application, in conjuction with it's rule file (rules.py) will
work like a "conference bridge". This is similar to what most hams think of as a
reflector. You define conference bridges and any system joined to that conference
bridge will both receive traffic from, and send traffic to any other system
joined to the same conference bridge. It does not provide end-to-end connectivity
as each end system must individually be joined to a conference bridge (a name
you create in the configuraiton file) to pass traffic.
This program currently only works with group voice calls.
'''
# Python modules we need
import sys

View File

@ -7,14 +7,8 @@ apt-get -y install docker.io &&
apt-get -y install docker-compose &&
apt-get -y install conntrack &&
echo Set userland-proxy to false and enable ipv6...
cat > /etc/docker/daemon.json &&
{
"userland-proxy": false,
"fixed-cidr-v6": "fd2a:70b6:9f54:29b5::/64",
"ipv6": true
}
EOF
echo Set userland-proxy to false...
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json &&
echo Restart docker...
systemctl restart docker &&
@ -36,7 +30,7 @@ TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
GEN_STAT_BRIDGES: True
ALLOW_NULL_PASSPHRASE: True
ANNOUNCEMENT_LANGUAGES: en_GB,en_GB_2,en_US,es_ES,es_ES_2,fr_FR,de_DE,dk_DK,it_IT,no_NO,pl_PL,se_SE,CW
ANNOUNCEMENT_LANGUAGES: en_GB,en_GB_2,en_US,es_ES,es_ES_2,fr_FR,de_DE,dk_DK,it_IT,no_NO,pl_PL,se_SE
SERVER_ID: 0
[REPORTS]
@ -76,7 +70,6 @@ MODE: OPENBRIDGE
ENABLED: False
IP:
PORT: 62044
OVERRIDE_SERVER_ID: False
NETWORK_ID: 1
PASSPHRASE: mypass
TARGET_IP:
@ -152,38 +145,17 @@ echo "BRIDGES = {'9990': [{'SYSTEM': 'ECHO', 'TS': 2, 'TGID': 9990, 'ACTIVE': Tr
echo Set perms on config directory...
chown -R 54000 /etc/freedmr &&
echo install JSON files...
mkdir -p /etc/freedmr/json &&
curl https://www.radioid.net/static/rptrs.json -o /etc/freedmr/json/peer_ids.json &&
curl https://www.radioid.net/static/users.json -o /etc/freedmr/json/subscriber_ids.json &&
curl http://downloads.freedmr.uk/downloads/talkgroup_ids.json -o /etc/freedmr/json/talkgroup_ids.json &&
chmod 777 -R /etc/freedmr/json &&
echo Setup logging...
mkdir -p /var/log/freedmr &&
touch /var/log/freedmr/freedmr.log &&
chown -R 54000 /var/log/freedmr &&
mkdir -p /var/log/FreeDMRmonitor &&
touch /var/log/FreeDMRmonitor/hbmon.log &&
touch /var/log/FreeDMRmonitor/lastheard.log &&
echo Setup lastheard pruning cron job...
cat << EOF > /etc/cron.hourly/lastheard
#!/bin/bash
mv /var/log/FreeDMRmonitor/lastheard.log /var/log/FreeDMRmonitor/lastheard.log.save
/usr/bin/tail -150 /var/log/FreeDMRmonitor/lastheard.log.save > /var/log/FreeDMRmonitor/lastheard.log
mv /var/log/FreeDMRmonitor/lastheard.log /var/log/FreeDMRmonitor/lastheard.log.save
/usr/bin/tail -150 /var/log/FreeDMRmonitor/lastheard.log.save > /var/log/FreeDMRmonitor/lastheard.log
EOF
echo Get docker-compose.yml...
cd /etc/freedmr &&
curl https://raw.githubusercontent.com/hacknix/FreeDMR/master/docker-configs/docker-compose-ipv6.yml -o docker-compose.yml
curl https://raw.githubusercontent.com/hacknix/FreeDMR/master/docker-configs/docker-compose.yml -o docker-compose.yml
echo Run FreeDMR containers...
echo Run FreeDMR container...
docker-compose up -d
echo FreeDMR setup complete!
echo try:
echo 'tail -f /var/log/freedmr/freedmr.log'

View File

@ -133,10 +133,7 @@ class OPENBRIDGE(DatagramProtocol):
def send_system(self, _packet):
if _packet[:4] == DMRD and self._config['TARGET_IP']:
#_packet = _packet[:11] + self._config['NETWORK_ID'] + _packet[15:]
if self._config['OVERRIDE_SERVER_ID']:
_packet = b''.join([_packet[:11], self._config['OVERRIDE_SERVER_ID'], _packet[15:]])
else:
_packet = b''.join([_packet[:11], self._CONFIG['GLOBAL']['SERVER_ID'], _packet[15:]])
_packet = b''.join([_packet[:11], self._CONFIG['GLOBAL']['SERVER_ID'], _packet[15:]])
#_packet += hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest()
_packet = b''.join([_packet, (hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest())])
self.transport.write(_packet, (self._config['TARGET_IP'], self._config['TARGET_PORT']))