Prevent duplicate Data Gateway voice routing

master
Simon 2 weeks ago
parent 0841d819e5
commit d802920514

@ -1822,6 +1822,8 @@ class routerOBP(OPENBRIDGE):
_data_event = group_data_report_name(_call_type, _dtype_vseq)
for _target in BRIDGES[_bridge]:
if (_target['SYSTEM'] != self._system) and (_target['ACTIVE']):
if _target['SYSTEM'] == 'DATA-GATEWAY' and not _data_control:
continue
_target_status = systems[_target['SYSTEM']].STATUS
_target_system = self._CONFIG['SYSTEMS'][_target['SYSTEM']]
if (_target['SYSTEM'],_target['TS']) in _sysIgnore:
@ -2532,6 +2534,8 @@ class routerHBP(HBSYSTEM):
for _target in BRIDGES[_bridge]:
#if _target['SYSTEM'] != self._system or (_target['SYSTEM'] == self._system and _target['TS'] != _slot):
if _target['SYSTEM'] != self._system and _target['ACTIVE']:
if _target['SYSTEM'] == 'DATA-GATEWAY' and dataGatewayEnabled():
continue
#if _target['ACTIVE']:
_target_status = systems[_target['SYSTEM']].STATUS
_target_system = self._CONFIG['SYSTEMS'][_target['SYSTEM']]

@ -3923,6 +3923,14 @@ NETWORK_DIRECT_DIAL_SLOT: {value}
add_openbridge_system(config, "DATA-GATEWAY", network_id=0)
gateway = config["SYSTEMS"]["DATA-GATEWAY"]
gateway["ENHANCED_OBP"] = True
bridges = active_bridge(
"9",
9,
(
("MASTER-A", 2),
("DATA-GATEWAY", 1),
),
)
packets = (
PacketSpec(
@ -3962,7 +3970,7 @@ NETWORK_DIRECT_DIAL_SLOT: {value}
),
)
with DeterministicScenario(config=config) as scenario:
with DeterministicScenario(config=config, bridges=bridges) as scenario:
scenario.register_peer("MASTER-A", 4000001)
gateway["_bcka"] = scenario.clock.time()
for packet in packets:
@ -3985,27 +3993,71 @@ NETWORK_DIRECT_DIAL_SLOT: {value}
self.assertEqual(captured[0].ber, b"\x01")
self.assertEqual(captured[0].rssi, b"\x02")
def test_native_data_gateway_does_not_observe_fbp_ingress(self):
def test_native_data_gateway_does_not_observe_fbp_voice_ingress(self):
config = minimal_config(("MASTER-A",))
config["GLOBAL"]["DATA_GATEWAY"] = True
add_openbridge_system(config, "OBP-1", network_id=3001)
add_openbridge_system(config, "DATA-GATEWAY", network_id=0)
bridges = active_bridge(
"9",
9,
(
("OBP-1", 1),
("DATA-GATEWAY", 1),
),
)
with DeterministicScenario(config=config) as scenario:
with DeterministicScenario(config=config, bridges=bridges) as scenario:
packet = PacketSpec(
peer_id=3001,
rf_src=1234567,
dst_id=900999,
dst_id=9,
slot=1,
stream_id=0x01020320,
call_type="unit",
call_type="group",
frame_type=HBPF_DATA_SYNC,
dtype_vseq=6,
dtype_vseq=HBPF_SLT_VHEAD,
)
scenario.inject_obp("OBP-1", packet)
self.assertEqual(scenario.capture.for_system("DATA-GATEWAY"), [])
def test_native_data_gateway_can_receive_fbp_group_data(self):
config = minimal_config(("MASTER-A",))
config["GLOBAL"]["DATA_GATEWAY"] = True
add_openbridge_system(config, "OBP-1", network_id=3001)
add_openbridge_system(config, "DATA-GATEWAY", network_id=0)
gateway = config["SYSTEMS"]["DATA-GATEWAY"]
bridges = active_bridge(
"900100",
900100,
(
("OBP-1", 1),
("DATA-GATEWAY", 1),
),
)
with DeterministicScenario(config=config, bridges=bridges) as scenario:
gateway["_bcka"] = scenario.clock.time()
packet = PacketSpec(
peer_id=3001,
rf_src=1234567,
dst_id=900100,
slot=1,
stream_id=0x01020321,
call_type="group",
frame_type=HBPF_DATA_SYNC,
dtype_vseq=6,
payload=b"\x44" * 33,
)
scenario.inject_obp("OBP-1", packet)
captured = scenario.capture.for_system("DATA-GATEWAY")
self.assertEqual(len(captured), 1)
self.assertEqual(captured[0].fields["dmr_payload"], packet.payload)
def test_native_data_gateway_honours_existing_fbcp_source_quench(self):
config = minimal_config(("MASTER-A",))
config["GLOBAL"]["DATA_GATEWAY"] = True

Loading…
Cancel
Save

Powered by TurnKey Linux.