voice chan timeout poss. bugfix

This commit is contained in:
Max 2021-07-26 20:49:41 -04:00
parent 7290f13486
commit 7373d10e1c
1 changed files with 9 additions and 4 deletions

View File

@ -1018,6 +1018,8 @@ class trunked_system (object):
# return False # return False
if self.last_tsbk + HUNT_HOLD_TIME > time.time(): if self.last_tsbk + HUNT_HOLD_TIME > time.time():
return False return False
if self.last_voice_time + HUNT_HOLD_TIME > time.time():
return False
if time.time() < self.next_hunt_cc: if time.time() < self.next_hunt_cc:
return False return False
self.next_hunt_cc = time.time() + HUNT_HOLD_TIME self.next_hunt_cc = time.time() + HUNT_HOLD_TIME
@ -1026,7 +1028,7 @@ class trunked_system (object):
if self.cc_list_index >= len(self.cc_list): if self.cc_list_index >= len(self.cc_list):
self.cc_list_index = 0 self.cc_list_index = 0
self.trunk_cc = self.cc_list[self.cc_list_index] self.trunk_cc = self.cc_list[self.cc_list_index]
sys.stderr.write('%f %s: set trunk_cc to %s\n' % (curr_time, self.sysname, self.trunk_cc)) sys.stderr.write('%f %s: cycling to next trunk_cc: %s\n' % (curr_time, self.sysname, self.trunk_cc))
if self.trunk_cc != self.last_trunk_cc: if self.trunk_cc != self.last_trunk_cc:
self.last_trunk_cc = self.trunk_cc self.last_trunk_cc = self.trunk_cc
if self.debug >=5: if self.debug >=5:
@ -1329,6 +1331,8 @@ class rx_ctl (object):
if nac not in self.trunked_systems.keys(): if nac not in self.trunked_systems.keys():
return return
tsys = self.trunked_systems[nac] tsys = self.trunked_systems[nac]
if self.current_state != self.states.CC:
tsys.last_voice_time = curr_time
if 'srcaddr' in js.keys(): if 'srcaddr' in js.keys():
tsys.current_srcaddr = js['srcaddr'] tsys.current_srcaddr = js['srcaddr']
if 'grpaddr' in js.keys(): if 'grpaddr' in js.keys():
@ -1391,7 +1395,8 @@ class rx_ctl (object):
return return
tsys = self.trunked_systems[nac] tsys = self.trunked_systems[nac]
if mtype == 0 or mtype == 5 or mtype == 10: # HDU or LDU1 or LDU2 i.e. voice if mtype == 0 or mtype == 5 or mtype == 10: # HDU or LDU1 or LDU2 i.e. voice
tsys.last_voice_time = curr_time if self.current_state != self.states.CC:
tsys.last_voice_time = curr_time
elif mtype == 7: # trunk: TSBK elif mtype == 7: # trunk: TSBK
t = get_ordinals(s) t = get_ordinals(s)
updated += tsys.decode_tsbk(t) updated += tsys.decode_tsbk(t)
@ -1557,10 +1562,10 @@ class rx_ctl (object):
if command == 'timeout': if command == 'timeout':
if self.current_state == self.states.CC: if self.current_state == self.states.CC:
if self.debug > 0: if self.debug > 0:
sys.stderr.write("%f control channel timeout\n" % time.time()) sys.stderr.write("%f control channel timeout, current CC %d\n" % (time.time(), tsys.trunk_cc))
tsys.cc_timeouts += 1 tsys.cc_timeouts += 1
elif self.current_state != self.states.CC and tsys.last_voice_time + 1.0 < curr_time: elif self.current_state != self.states.CC and tsys.last_voice_time + 1.0 < curr_time:
if self.debug > 1: if self.debug > 0:
sys.stderr.write("%f voice timeout\n" % time.time()) sys.stderr.write("%f voice timeout\n" % time.time())
if self.hold_mode is False: if self.hold_mode is False:
self.current_tgid = None self.current_tgid = None