From 3988ababccc9e091dc3a1f2d4189c5f8c90d0e2d Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 2 Feb 2022 18:24:17 +0000 Subject: [PATCH] move around AMI --- bridge_master.py | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index 14b15e2..f049639 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -2220,7 +2220,25 @@ class routerHBP(HBSYSTEM): else: logger.info('(%s) UNIT Data not bridged to HBP on slot %s - target busy: %s DST_ID: %s',self._system,_d_slot,_d_system,_int_dst_id) - + #Handle AMI private calls + if _call_type == 'unit' and not _data_call and self.STATUS[_slot]['_allStarMode']: + + self.STATUS[_slot]['TX_TIME'] = self.STATUS[_slot]['TX_TIME'] - 20 + + if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']): + pass + + if (_frame_type == HBPF_DATA_SYNC) and (_dtype_vseq == HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != HBPF_SLT_VTERM): + if _int_dst_id == 4000: + logger.info('(%s) AMI: Private call from %s to %s (Disconnect)',self._system, int_id(_rf_src), _int_dst_id) + AMIOBJ.send_command('ilink 6 0') + elif _int_dst_id == 5000: + logger.info('(%s) AMI: Private call from %s to %s (Status)',self._system, int_id(_rf_src), _int_dst_id) + AMIOBJ.send_command('ilink 5 0') + else: + logger.info('(%s) AMI: Private call from %s to %s (Link)',self._system, int_id(_rf_src), _int_dst_id) + AMIOBJ.send_command('ilink 6 0') + AMIOBJ.send_command('ilink 3 ' + str(_int_dst_id)) #Handle private voice calls (for reflectors) if _call_type == 'unit' and not _data_call and not self.STATUS[_slot]['_allStarMode']: @@ -2378,26 +2396,6 @@ class routerHBP(HBSYSTEM): self.STATUS[_slot]['VOICE_STREAM'] = _voice_call self.STATUS[_slot]['packets'] = self.STATUS[_slot]['packets'] +1 - - #Handle AMI - if _call_type == 'unit' and not _data_call and self.STATUS[_slot]['_allStarMode']: - - self.STATUS[_slot]['TX_TIME'] = self.STATUS[_slot]['TX_TIME'] - 20 - - if (_stream_id != self.STATUS[_slot]['RX_STREAM_ID']): - pass - - if (_frame_type == HBPF_DATA_SYNC) and (_dtype_vseq == HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != HBPF_SLT_VTERM): - if _int_dst_id == 4000: - logger.info('(%s) AMI: Private call from %s to %s (Disconnect)',self._system, int_id(_rf_src), _int_dst_id) - AMIOBJ.send_command('ilink 6 0') - elif _int_dst_id == 5000: - logger.info('(%s) AMI: Private call from %s to %s (Status)',self._system, int_id(_rf_src), _int_dst_id) - AMIOBJ.send_command('ilink 5 0') - else: - logger.info('(%s) AMI: Private call from %s to %s (Link)',self._system, int_id(_rf_src), _int_dst_id) - AMIOBJ.send_command('ilink 6 0') - AMIOBJ.send_command('ilink 3 ' + str(_int_dst_id)) # Mark status variables for use later