diff --git a/confbridge.py b/confbridge.py index 5f00fa3..4f3c831 100755 --- a/confbridge.py +++ b/confbridge.py @@ -338,6 +338,10 @@ class confbridgeIPSC(IPSC): if _system['ACTIVE'] == True and _system['TO_TYPE'] == 'ON': _system['TIMER'] = now + _system['TIMEOUT'] self._logger.info('(%s) Bridge: %s, timeout timer reset to: %s', self._system, _bridge, _system['TIMER'] - now) + # Cancel the timer if we've enabled an "OFF" type timeout + if _system['ACTIVE'] == True and _system['TO_TYPE'] == 'OFF': + _system['TIMER'] = now + self._logger.info('(%s) Bridge: %s set to "OFF" with an on timer rule: timeout timer cancelled', self._system, _bridge) # TGID matches an DE-ACTIVATION trigger if _dst_group in _system['OFF']: @@ -349,6 +353,10 @@ class confbridgeIPSC(IPSC): if _system['ACTIVE'] == False and _system['TO_TYPE'] == 'OFF': _system['TIMER'] = now + _system['TIMEOUT'] self._logger.info('(%s) Bridge: %s, timeout timer reset to: %s', self._system, _bridge, _system['TIMER'] - now) + # Cancel the timer if we've enabled an "ON" type timeout + if _system['ACTIVE'] == True and _system['TO_TYPE'] == 'ON': + _system['TIMER'] = now + self._logger.info('(%s) Bridge: %s set to ON with and "OFF" timer rule: timeout timer cancelled', self._system, _bridge) # # END IN-BAND SIGNALLING