diff --git a/monitor.py b/monitor.py
index bf968b9..d3a3305 100644
--- a/monitor.py
+++ b/monitor.py
@@ -738,49 +738,17 @@ def process_message(_bmessage):
p = _message[1:].split(",")
rts_update(p)
opbfilter = get_opbf()
+ # open lastheard.log file
+ lh_logfile = open(LOG_PATH+"lastheard.log", "a")
if p[0] == 'GROUP VOICE' and p[2] != 'TX' and p[5] not in opbfilter:
if p[1] == 'END':
log_message = '{} {} {} SYS: {:8.8s} SRC_ID: {:9.9s} TS: {} TGID: {:7.7s} {:17.17s} SUB: {:9.9s}; {:18.18s} Time: {}s '.format(_now[10:19], p[0][6:], p[1], p[3], p[5], p[7],p[8],alias_tgid(int(p[8]),talkgroup_ids), p[6], alias_short(int(p[6]), subscriber_ids), int(float(p[9])))
- # log only to file if system is NOT OpenBridge event (not logging open bridge system, name depends on your OB definitions) AND transmit time is LONGER as 2sec (make sense for very short transmits)
- if LASTHEARD_INC:
- if int(float(p[9]))> 2:
- log_lh_message = '{},{},{},{},{},{},{},TS{},TG{},{},{},{}'.format(_now, p[9], p[0], p[1], p[3], p[5], alias_call(int(p[5]), subscriber_ids), p[7], p[8],alias_tgid(int(p[8]),talkgroup_ids),p[6], alias_short(int(p[6]), subscriber_ids))
- lh_logfile = open(LOG_PATH+"lastheard.log", "a")
- lh_logfile.write(log_lh_message + '\n')
- lh_logfile.close()
- # Lastheard in Dashboard by SP2ONG
- my_list=[]
- n=0
- f = open(PATH+"templates/lastheard.html", "w")
- f.write("
")
- f.close()
- # End of Lastheard
+ log_lh_message = '{},{},{},{},{},{},{},TS{},TG{},{},{},{}'.format(_now, p[9], p[0], p[1], p[3], p[5], alias_call(int(p[5]), subscriber_ids), p[7], p[8],alias_tgid(int(p[8]),talkgroup_ids),p[6], alias_short(int(p[6]), subscriber_ids))
+ lh_logfile.write(log_lh_message + '\n')
elif p[1] == 'START':
log_message = '{} {} {} SYS: {:8.8s} SRC_ID: {:9.9s} TS: {} TGID: {:7.7s} {:17.17s} SUB: {:9.9s}; {:18.18s}'.format(_now[10:19], p[0][6:], p[1], p[3], p[5], p[7],p[8], alias_tgid(int(p[8]),talkgroup_ids), p[6], alias_short(int(p[6]), subscriber_ids))
+ log_lh_message = '{},{},{},{},{},{},{},TS{},TG{},{},{},{}'.format(_now, 0, p[0], p[1], p[3], p[5], alias_call(int(p[5]), subscriber_ids), p[7], p[8],alias_tgid(int(p[8]),talkgroup_ids),p[6], alias_short(int(p[6]), subscriber_ids))
+ lh_logfile.write(log_lh_message + '\n')
elif p[1] == 'END WITHOUT MATCHING START':
log_message = '{} {} {} on SYSTEM {:8.8s}: SRC_ID: {:9.9s} TS: {} TGID: {:7.7s} {:17.17s} SUB: {:9.9s}; {:18.18s}'.format(_now[10:19], p[0][6:], p[1], p[3], p[5], p[7], p[8],alias_tgid(int(p[8]),talkgroup_ids),p[6], alias_short(int(p[6]), subscriber_ids))
else:
@@ -791,10 +759,64 @@ def process_message(_bmessage):
else:
logging.debug('{} UNKNOWN LOG MESSAGE'.format(_now[10:19]))
+
+ # close lastheard.log file
+ lh_logfile.close()
else:
logging.debug('got unknown opcode: {}, message: {}'.format(repr(opcode), repr(_message[1:])))
-
+
+ # Lastheard with TX-ing in Dashboard by SP2ONG
+ my_list=[]
+ n = 0
+ f = open(PATH+"templates/lastheard.html", "w")
+ f.write("
")
+ f.close()
+ # refresh main page
+ main = 'i' + itemplate.render(_table=CTABLE,themec=THEME_COLOR,dbridges=BTABLE['SETUP']['BRIDGES'],auth=WEB_AUTH)
+ dashboard_server.broadcast(main)
+
def load_dictionary(_message):
data = _message[1:]
return loads(data)