From 567204e9610a78435e83d7fe37c0aa33e5db2988 Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Mon, 26 Aug 2013 08:16:54 -0500 Subject: [PATCH] Group Voice Forwarding Now Works Group Voice forwarding now works, making this code sucessful at bridging IPSC networks. Some things are missing, such as transmission to all peers in an IPSC, right now, it only sends to the master, but that's easily enough added, and my next goal. --- ipsc.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ipsc.py b/ipsc.py index 2260bc7..6260f93 100644 --- a/ipsc.py +++ b/ipsc.py @@ -114,13 +114,16 @@ def fwd_group_voice(_network, _data): for source in NETWORK[_network]['RULES']['GROUP_VOICE']: if source['SRC_GROUP'] == _src_group: + _target = source['DST_NET'] + _target_sock = NETWORK[_target]['MASTER']['IP'], NETWORK[_target]['MASTER']['PORT'] print(binascii.b2a_hex(_data)) - _data = _data.replace(_src_ipsc, NETWORK[(source['DST_NET'])]['LOCAL']['RADIO_ID']) + _data = _data.replace(_src_ipsc, NETWORK[_target]['LOCAL']['RADIO_ID']) _data = _data.replace(_src_group, source['DST_GROUP']) - _data = hashed_packet(NETWORK[(source['DST_NET'])]['LOCAL']['AUTH_KEY'], _data) + _data = hashed_packet(NETWORK[_target]['LOCAL']['AUTH_KEY'], _data) print(binascii.b2a_hex(_data)) print() - # Send packet + networks[_target].transport.write(_data, (_target_sock)) + # Take a recieved peer list and the network it belongs to, process and populate the # data structure in my_ipsc_config with the results.