Allow ANNOUNCEMENT_LANGUAGE in MySQL DB:

To update DB:

alter table repeaters add column ANNOUNCEMENT_LANGUAGE VARCHAR(8);

update repeaters set announcement_language='en_GB_2';
This commit is contained in:
Simon 2021-05-22 22:56:20 +01:00
parent f7147ab299
commit edeaf2fbe7
2 changed files with 5 additions and 1 deletions

View File

@ -1107,6 +1107,9 @@ def mysql_config_check(SQLGETCONFIG):
tg = int(tg)
make_static_tg(tg,2,_tmout,system)
if SQLCONFIG[system]['ANNOUNCEMENT_LANGUAGE'] != CONFIG['SYSTEMS'][system]['ANNOUNCEMENT_LANGUAGE']:
logger.debug('(MYSQL) %s announcement language changed to %s',system, SQLCONFIG[system]['ANNOUNCEMENT_LANGUAGE'])
#Rebuild ACLs
SQLCONFIG[system]['REG_ACL'] = acl_build(SQLCONFIG[system]['REG_ACL'], PEER_MAX)
SQLCONFIG[system]['SUB_ACL'] = acl_build(SQLCONFIG[system]['SUB_ACL'], ID_MAX)

View File

@ -56,7 +56,7 @@ class useMYSQL:
logger.info('(MYSQL) error, problem with cursor execute')
raise Exception('Problem with cursor execute')
for (callsign, mode, enabled, _repeat, max_peers, export_ambe, ip, port, passphrase, group_hangtime, use_acl, reg_acl, sub_acl, tgid_ts1_acl, tgid_ts2_acl, default_ua_timer, single_mode, voice_ident,ts1_static,ts2_static,default_reflector) in _cursor:
for (callsign, mode, enabled, _repeat, max_peers, export_ambe, ip, port, passphrase, group_hangtime, use_acl, reg_acl, sub_acl, tgid_ts1_acl, tgid_ts2_acl, default_ua_timer, single_mode, voice_ident,ts1_static,ts2_static,default_reflector, announce_lang) in _cursor:
try:
CONFIG['SYSTEMS'].update({callsign: {
'MODE': mode,
@ -79,6 +79,7 @@ class useMYSQL:
'TS2_STATIC': ts2_static,
'DEFAULT_REFLECTOR': int(default_reflector),
'GENERATOR': int(1),
'ANNOUNCEMENT_LANGUAGE': announce_lang
}})
CONFIG['SYSTEMS'][callsign].update({'PEERS': {}})
except TypeError: