Added Timestamp

This commit is contained in:
Cort Buffington 2013-10-15 05:50:02 -05:00
parent 6edf3ef978
commit 9ac7727b7a

10
ipsc.py
View File

@ -19,6 +19,7 @@ import hmac
import hashlib
import socket
import csv
import time
#************************************************
# IMPORTING OTHER FILES - '#include'
@ -143,6 +144,7 @@ def xcmp_xnl(_network, _data):
def group_voice(_network, _data):
# _log = logger.debug
_time = time.strftime('%H:%M:%S')
_src_sub = int(binascii.b2a_hex(_data[6:9]), 16)
_dst_group = int(binascii.b2a_hex(_data[9:12]), 16)
_src_ipsc = int(binascii.b2a_hex(_data[1:5]), 16)
@ -155,20 +157,20 @@ def group_voice(_network, _data):
if _call == '00':
if (_network, 'Slot 1') not in ACTIVE_CALLS:
ACTIVE_CALLS.append((_network, 'Slot 1'))
print('({}) CALL START Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t1' .format(_network, _src_ipsc, _src_sub, _dst_group))
print('{} ({}) CALL START Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t1' .format(_time, _network, _src_ipsc, _src_sub, _dst_group))
if _call == '20':
if (_network, 'Slot 2') not in ACTIVE_CALLS:
ACTIVE_CALLS.append((_network, 'Slot 2'))
print('({}) CALL START Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t2' .format(_network, _src_ipsc, _src_sub, _dst_group))
print('{} ({}) CALL START Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t2' .format(_time, _network, _src_ipsc, _src_sub, _dst_group))
if _call == '40':
ACTIVE_CALLS.remove((_network, 'Slot 1'))
print('({}) CALL END Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t1 \a' .format(_network, _src_ipsc, _src_sub, _dst_group))
print('{} ({}) CALL END Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t1 \a' .format(_time, _network, _src_ipsc, _src_sub, _dst_group))
if _call == '60':
ACTIVE_CALLS.remove((_network, 'Slot 2'))
print('({}) CALL END Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t2 \a' .format(_network, _src_ipsc, _src_sub, _dst_group))
print('{} ({}) CALL END Group Voice: \n\tIPSC Source:\t{}\n\tSubscriber:\t{}\n\tDestination:\t{}\n\tTimeslot\t2 \a' .format(_time, _network, _src_ipsc, _src_sub, _dst_group))
'''
for source in NETWORK[_network]['RULES']['GROUP_VOICE']: