Revert "Override SERVER_ID that is sent for this OBP"
This reverts commit 36e7ed58b9
.
This commit is contained in:
parent
36e7ed58b9
commit
501a557116
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/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>
|
# Copyright (C) 2016-2019 Cortney T. Buffington, N0MJS <n0mjs@me.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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
|
# Python modules we need
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -7,14 +7,8 @@ apt-get -y install docker.io &&
|
||||||
apt-get -y install docker-compose &&
|
apt-get -y install docker-compose &&
|
||||||
apt-get -y install conntrack &&
|
apt-get -y install conntrack &&
|
||||||
|
|
||||||
echo Set userland-proxy to false and enable ipv6...
|
echo Set userland-proxy to false...
|
||||||
cat > /etc/docker/daemon.json &&
|
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json &&
|
||||||
{
|
|
||||||
"userland-proxy": false,
|
|
||||||
"fixed-cidr-v6": "fd2a:70b6:9f54:29b5::/64",
|
|
||||||
"ipv6": true
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo Restart docker...
|
echo Restart docker...
|
||||||
systemctl restart docker &&
|
systemctl restart docker &&
|
||||||
|
@ -36,7 +30,7 @@ TGID_TS1_ACL: PERMIT:ALL
|
||||||
TGID_TS2_ACL: PERMIT:ALL
|
TGID_TS2_ACL: PERMIT:ALL
|
||||||
GEN_STAT_BRIDGES: True
|
GEN_STAT_BRIDGES: True
|
||||||
ALLOW_NULL_PASSPHRASE: 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
|
SERVER_ID: 0
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
@ -76,7 +70,6 @@ MODE: OPENBRIDGE
|
||||||
ENABLED: False
|
ENABLED: False
|
||||||
IP:
|
IP:
|
||||||
PORT: 62044
|
PORT: 62044
|
||||||
OVERRIDE_SERVER_ID: False
|
|
||||||
NETWORK_ID: 1
|
NETWORK_ID: 1
|
||||||
PASSPHRASE: mypass
|
PASSPHRASE: mypass
|
||||||
TARGET_IP:
|
TARGET_IP:
|
||||||
|
@ -152,38 +145,17 @@ echo "BRIDGES = {'9990': [{'SYSTEM': 'ECHO', 'TS': 2, 'TGID': 9990, 'ACTIVE': Tr
|
||||||
echo Set perms on config directory...
|
echo Set perms on config directory...
|
||||||
chown -R 54000 /etc/freedmr &&
|
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...
|
echo Setup logging...
|
||||||
mkdir -p /var/log/freedmr &&
|
mkdir -p /var/log/freedmr &&
|
||||||
touch /var/log/freedmr/freedmr.log &&
|
touch /var/log/freedmr/freedmr.log &&
|
||||||
chown -R 54000 /var/log/freedmr &&
|
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...
|
echo Get docker-compose.yml...
|
||||||
cd /etc/freedmr &&
|
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
|
docker-compose up -d
|
||||||
|
|
||||||
|
|
||||||
echo FreeDMR setup complete!
|
echo FreeDMR setup complete!
|
||||||
echo try:
|
|
||||||
echo 'tail -f /var/log/freedmr/freedmr.log'
|
|
||||||
|
|
|
@ -133,10 +133,7 @@ class OPENBRIDGE(DatagramProtocol):
|
||||||
def send_system(self, _packet):
|
def send_system(self, _packet):
|
||||||
if _packet[:4] == DMRD and self._config['TARGET_IP']:
|
if _packet[:4] == DMRD and self._config['TARGET_IP']:
|
||||||
#_packet = _packet[:11] + self._config['NETWORK_ID'] + _packet[15:]
|
#_packet = _packet[:11] + self._config['NETWORK_ID'] + _packet[15:]
|
||||||
if self._config['OVERRIDE_SERVER_ID']:
|
_packet = b''.join([_packet[:11], self._CONFIG['GLOBAL']['SERVER_ID'], _packet[15:]])
|
||||||
_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 += hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest()
|
#_packet += hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest()
|
||||||
_packet = b''.join([_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']))
|
self.transport.write(_packet, (self._config['TARGET_IP'], self._config['TARGET_PORT']))
|
||||||
|
|
Loading…
Reference in New Issue