From 52afb05517c4537fc8a091ce8ffece2f87fd3e57 Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Tue, 3 May 2016 20:15:55 -0500 Subject: [PATCH] Access Control List (ACL) Added Control permit or deny with a list of subscriber IDs. Thanks to Peter Martin for the idea. --- bridge.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bridge.py b/bridge.py index ceca858..78e53a3 100755 --- a/bridge.py +++ b/bridge.py @@ -116,6 +116,7 @@ try: logger.info('Subscriber access control file found, subscriber ACL imported') except ImportError: logger.critical('\'sub_acl.py\' not found - all subscriber IDs are valid') + ACL_ACTION = 'NONE' # Depending on which type of ACL is used (PERMIT, DENY... or there isn't one) # define a differnet function to be used to check the ACL @@ -123,10 +124,14 @@ if ACL_ACTION == 'PERMIT': def allow_sub(_sub): if _sub in ACL: return True + else: + return False elif ACL_ACTION == 'DENY': def allow_sub(_sub): if _sub not in ACL: return True + else: + return False else: def allow_sub(_sub): return True @@ -187,7 +192,7 @@ class bridgeIPSC(IPSC): # Check for ACL match, and return if the subscriber is not allowed if allow_sub(_src_sub) == False: - logger.debug('(%s) Group Voice Packet ***REJECTED BY ACL*** From: %s, IPSC Peer %s, Destination %s', _network, int_id(_src_sub), int_id(_peerid), int_id(_dst_group)) + logger.warning('(%s) Group Voice Packet ***REJECTED BY ACL*** From: %s, IPSC Peer %s, Destination %s', _network, int_id(_src_sub), int_id(_peerid), int_id(_dst_group)) return # Process the packet