From 74eb8edb5f0fb42128df37e6faa125d2356dbfaf Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Sat, 10 Sep 2016 16:34:50 -0500 Subject: [PATCH] add call timer --- bridge.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bridge.py b/bridge.py index ad482b1..687aa59 100755 --- a/bridge.py +++ b/bridge.py @@ -176,6 +176,7 @@ class bridgeIPSC(IPSC): } self.last_seq_id = '\x00' + self.call_start = 0 # Setup the backup/polite bridging maintenance loop (based on keep-alive timer) @@ -335,16 +336,16 @@ class bridgeIPSC(IPSC): if _burst_data_type == BURST_DATA_TYPE['VOICE_HEAD']: if self.last_seq_id != _seq_id: self.last_seq_id = _seq_id - call_start = time() + self.call_start = time() logger.info('(%s) GROUP VOICE START: PEER: %s, SUB: %s, TS: %s, TGID: %s', _network, int_id(_peerid), int_id(_src_sub), _ts+1, int_id(_dst_group)) # Action happens on un-key if _burst_data_type == BURST_DATA_TYPE['VOICE_TERM']: if self.last_seq_id == _seq_id: - call_duration = time() - call_start - logger.info('(%s) GROUP VOICE END: PEER: %s, SUB: %s, TS: %s, TGID: %s Duration: %ss', _network, int_id(_peerid), int_id(_src_sub), _ts+1, int_id(_dst_group), call_duration) + self.call_duration = time() - self.call_start + logger.info('(%s) GROUP VOICE END: PEER: %s, SUB: %s, TS: %s, TGID: %s Duration: %ss', _network, int_id(_peerid), int_id(_src_sub), _ts+1, int_id(_dst_group), self.call_duration) else: - logger.warning('(%s) GROUP VOICE END WITHOUT MATCHING START: PEER: %s, SUB: %s, TS: %s, TGID: %s', _network, int_id(_peerid), int_id(_src_sub), _ts+1, int_id(_dst_group)) + logger.warning('(%s) GROUP VOICE END WITHOUT MATCHING START: PEER: %s, SUB: %s, TS: %s, TGID: %s', _network, int_id(_peerid), int_id(_src_sub), _ts+1, int_id(_dst_group),) # Iterate the rules dictionary for rule in RULES[_network]['GROUP_VOICE']: