Options support update:

New format:

TS1=;TS2=2350;DIAL=0;TIMER=12;VOICE=0

Old format is still supported

Also support for DMR+ format
This commit is contained in:
Simon 2021-03-07 16:11:30 +00:00
parent e41eb7bfc5
commit 0090f1a65d
5 changed files with 64 additions and 10 deletions

View File

@ -549,6 +549,60 @@ def options_config():
_options[k] = v _options[k] = v
logger.debug('(OPTIONS) Options found for %s',_system) logger.debug('(OPTIONS) Options found for %s',_system)
if 'DIAL' in _options:
_options['DEFAULT_REFLECTOR'] = _options.pop('DIAL')
if 'TIMER' in _options:
_options['DEFAULT_UA_TIMER'] = _options.pop('TIMER')
if 'TS1' in _options:
_options['TS1_STATIC'] = _options.pop('TS1')
if 'TS2' in _options:
_options['TS2_STATIC'] = _options.pop('TS2')
#DMR+ style options
if 'StartRef' in _options:
_options['DEFAULT_REFLECTOR'] = _options.pop('StartRef')
if 'RelinkTime' in _options:
_options['DEFAULT_UA_TIMER'] = _options.pop('RelinkTime')
if 'TS1_1' in _options:
_options['TS1_STATIC'] = _options.pop('TS1_1')
if 'TS1_2' in _options:
_options['TS1_STATIC'] = _options['TS1_STATIC'] + ',' + _options.pop('TS1_2')
if 'TS1_3' in _options:
_options['TS1_STATIC'] = _options['TS1_STATIC'] + ',' + _options.pop('TS1_3')
if 'TS1_4' in _options:
_options['TS1_STATIC'] = _options['TS1_STATIC'] + ',' + _options.pop('TS1_4')
if 'TS1_4' in _options:
_options['TS1_STATIC'] = _options['TS1_STATIC'] + ',' + _options.pop('TS1_5')
if 'TS2_2' in _options:
_options['TS2_STATIC'] = _options.pop('TS2_1')
if 'TS2_2' in _options:
_options['TS2_STATIC'] = _options['TS2_STATIC'] + ',' + _options.pop('TS2_2')
if 'TS2_3' in _options:
_options['TS2_STATIC'] = _options['TS2_STATIC'] + ',' + _options.pop('TS2_3')
if 'TS2_4' in _options:
_options['TS2_STATIC'] = _options['TS2_STATIC'] + ',' + _options.pop('TS2_4')
if 'TS2_4' in _options:
_options['TS2_STATIC'] = _options['TS2_STATIC'] + ',' + _options.pop('TS2_5')
if 'UserLink' in _options:
_options.pop('UserLink')
if 'TS1_STATIC' not in _options:
_options['TS1_STATIC'] = False
if 'TS2_STATIC' not in _options:
_options['TS2_STATIC'] = False
if 'DEFAULT_REFLECTOR' not in _options:
_options['DEFAULT_REFLECTOR'] = 0
if 'DEFAULT_UA_TIMER' not in _options:
_options['DEFAULT_UA_TIMER'] = CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER']
if 'VOICE' in _options and (CONFIG['SYSTEMS'][_system]['VOICE_IDENT'] != bool(int(_options['VOICE']))):
CONFIG['SYSTEMS'][_system]['VOICE_IDENT'] = bool(int(_options['VOICE']))
logger.debug("(OPTIONS) %s - Setting voice ident to %s",_system,CONFIG['SYSTEMS'][_system]['VOICE_IDENT'])
if 'TS1_STATIC' not in _options or 'TS2_STATIC' not in _options or 'DEFAULT_REFLECTOR' not in _options or 'DEFAULT_UA_TIMER' not in _options: if 'TS1_STATIC' not in _options or 'TS2_STATIC' not in _options or 'DEFAULT_REFLECTOR' not in _options or 'DEFAULT_UA_TIMER' not in _options:
logger.debug('(OPTIONS) %s - Required field missing, ignoring',_system) logger.debug('(OPTIONS) %s - Required field missing, ignoring',_system)
continue continue

View File

@ -3,5 +3,5 @@
cd /opt/freedmr cd /opt/freedmr
python /opt/freedmr/hdstack/hotspot_proxy_v2.py & python /opt/freedmr/hdstack/hotspot_proxy_v2.py &
python /opt/freedmr/bridge_master.py -c freedmr.cfg -r rules.py & python /opt/freedmr/bridge_master.py -c freedmr.cfg -r rules.py &
python /opt/freedmr/bridge_master.py -c hdstack/stack1.cfg -r rules.py & python /opt/freedmr/bridge_master.py -c hdstack/hdstack1.cfg -r rules.py &
python /opt/freedmr/bridge_master.py -c hdstack/stack2.cfg -r rules.py & python /opt/freedmr/bridge_master.py -c hdstack/hdstack2.cfg -r rules.py &

View File

@ -46,11 +46,11 @@ TABLE: repeaters
MODE: OPENBRIDGE MODE: OPENBRIDGE
ENABLED: True ENABLED: True
IP: 127.0.0.1 IP: 127.0.0.1
PORT: 70001 PORT: 7001
NETWORK_ID: 3 NETWORK_ID: 3
PASSPHRASE: internal PASSPHRASE: internal
TARGET_IP: 127.0.0.1 TARGET_IP: 127.0.0.1
TARGET_PORT: 70001 TARGET_PORT: 7001
USE_ACL: True USE_ACL: True
SUB_ACL: DENY:1 SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL TGID_ACL: PERMIT:ALL
@ -60,11 +60,11 @@ RELAX_CHECKS: True
MODE: OPENBRIDGE MODE: OPENBRIDGE
ENABLED: True ENABLED: True
IP: 127.0.0.1 IP: 127.0.0.1
PORT: 70002 PORT: 7002
NETWORK_ID: 4 NETWORK_ID: 4
PASSPHRASE: internal PASSPHRASE: internal
TARGET_IP: 127.0.0.1 TARGET_IP: 127.0.0.1
TARGET_PORT: 70002 TARGET_PORT: 7002
USE_ACL: True USE_ACL: True
SUB_ACL: DENY:1 SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL TGID_ACL: PERMIT:ALL

View File

@ -46,11 +46,11 @@ TABLE: repeaters
MODE: OPENBRIDGE MODE: OPENBRIDGE
ENABLED: True ENABLED: True
IP: 127.0.0.1 IP: 127.0.0.1
PORT: 70001 PORT: 7001
NETWORK_ID: 1 NETWORK_ID: 1
PASSPHRASE: internal PASSPHRASE: internal
TARGET_IP: 127.0.0.1 TARGET_IP: 127.0.0.1
TARGET_PORT: 70001 TARGET_PORT: 7001
USE_ACL: True USE_ACL: True
SUB_ACL: DENY:1 SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL TGID_ACL: PERMIT:ALL

View File

@ -46,11 +46,11 @@ TABLE: repeaters
MODE: OPENBRIDGE MODE: OPENBRIDGE
ENABLED: True ENABLED: True
IP: 127.0.0.1 IP: 127.0.0.1
PORT: 70002 PORT: 7002
NETWORK_ID: 2 NETWORK_ID: 2
PASSPHRASE: internal PASSPHRASE: internal
TARGET_IP: 127.0.0.1 TARGET_IP: 127.0.0.1
TARGET_PORT: 70002 TARGET_PORT: 7002
USE_ACL: True USE_ACL: True
SUB_ACL: DENY:1 SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL TGID_ACL: PERMIT:ALL