Override SERVER_ID that is sent for this OBP
Generally, this is used for connecting to non-FreeDMR systems. Should usually be set to: OVERRIDE_SERVER_ID: False ** USE WITH CAUTION **
This commit is contained in:
parent
5724d32197
commit
36e7ed58b9
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Copyright (C) 2020 Simon Adlem, G7RZU <g7rzu@gb7fr.org.uk>
|
# Copyright (C) 2020-2021 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,17 +19,6 @@
|
||||||
# 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,8 +7,14 @@ 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...
|
echo Set userland-proxy to false and enable ipv6...
|
||||||
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json &&
|
cat > /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 &&
|
||||||
|
@ -30,7 +36,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
|
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
|
||||||
SERVER_ID: 0
|
SERVER_ID: 0
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
@ -70,6 +76,7 @@ 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:
|
||||||
|
@ -145,17 +152,38 @@ 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.yml -o docker-compose.yml
|
curl https://raw.githubusercontent.com/hacknix/FreeDMR/master/docker-configs/docker-compose-ipv6.yml -o docker-compose.yml
|
||||||
|
|
||||||
echo Run FreeDMR container...
|
echo Run FreeDMR containers...
|
||||||
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,7 +133,10 @@ 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:]
|
||||||
_packet = b''.join([_packet[:11], self._CONFIG['GLOBAL']['SERVER_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 += 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