From 2fa9aecabbd1497cc5303359393efc8b4317a1ed Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 20 Oct 2021 00:38:37 +0100 Subject: [PATCH] Squashed commit of the following: commit ebdef2b73d5c600c6082dbf07913d3d9e7c148ed Author: Simon Date: Wed Oct 20 00:35:17 2021 +0100 unit commit 8ed0b8df8f3ff74e11e5828228b77ccf1567c73d Author: Simon Date: Wed Oct 20 00:33:34 2021 +0100 Tyo commit 73151e08b14a100f4240ded2a58f5ff9c80ebc74 Author: Simon Date: Wed Oct 20 00:24:27 2021 +0100 Add rewrite for D-APRS Private Call to Group Call --- bridge_master.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index c1fbb8f..7b285f7 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -487,7 +487,7 @@ def sendVoicePacket(self,pkt,_source_id,_dest_id,_slot): else: systems[system].STATUS[_stream_id]['LAST'] = _pkt_time _slot['TX_TIME'] = _pkt_time - + self.send_system(pkt) def sendSpeech(self,speech): @@ -1760,7 +1760,7 @@ class routerHBP(HBSYSTEM): _int_dst_id = int_id(_dst_id) #Handle private calls (for reflectors) - if _call_type == 'unit': + if _call_type == 'unit' and _slot == 2 and int_id(_dst_id) != 234999: if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']): self.STATUS[_slot]['_stopTgAnnounce'] = False @@ -1828,7 +1828,7 @@ class routerHBP(HBSYSTEM): if (_frame_type == HBPF_DATA_SYNC) and (_dtype_vseq == HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != HBPF_SLT_VTERM): #Speak callsign before message - _say = [words[_lang]['silence']] + # _say = [words[_lang]['silence']] # _systemcs = re.sub(r'\W+', '', self._system) # _systemcs.upper() # for character in _systemcs: @@ -1839,6 +1839,8 @@ class routerHBP(HBSYSTEM): logger.info('(%s) Reflector: voice called - TG < 5 or 9 - "busy""', self._system) _say.append(words[_lang]['busy']) _say.append(words[_lang]['silence']) + _say.append(words[_lang]['notlinked']) + _say.append(words[_lang]['silence']) self.STATUS[_slot]['_stopTgAnnounce'] = True #If disconnection called @@ -1908,10 +1910,13 @@ class routerHBP(HBSYSTEM): self.STATUS[_slot]['RX_TGID'] = _dst_id self.STATUS[_slot]['RX_TIME'] = pkt_time self.STATUS[_slot]['RX_STREAM_ID'] = _stream_id - + + #Placeholder for slot 1 unit calls + if _call_type == 'unit' and _slot == 1: + pass #Handle group calls - if _call_type == 'group' or _call_type == 'vcsbk': + if _call_type == 'group' or _call_type == 'vcsbk' or (_call_type == 'unit' and int_id(_dst_id) == 234999): # Is this a new call stream? if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']): @@ -1927,7 +1932,8 @@ class routerHBP(HBSYSTEM): self._report.send_bridgeEvent('GROUP VOICE,START,RX,{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id)).encode(encoding='utf-8', errors='ignore')) # If we can, use the LC from the voice header as to keep all options intact - if _frame_type == HBPF_DATA_SYNC and _dtype_vseq == HBPF_SLT_VHEAD: + # If we see a unit call to the private ID used for D-APRS, rewrite to a group call. + if _frame_type == HBPF_DATA_SYNC and _dtype_vseq == HBPF_SLT_VHEAD and int_id(_dst_id) != 234999: decoded = decode.voice_head_term(dmrpkt) self.STATUS[_slot]['RX_LC'] = decoded['LC']