diff --git a/data_gateway.py b/data_gateway.py index d3896c9..b4cdbc0 100644 --- a/data_gateway.py +++ b/data_gateway.py @@ -577,6 +577,10 @@ def process_sms(_rf_src, sms, call_type, system_name): s = ' ' post = s.join(parse_sms[1:]) send_ss(CONFIG, str(get_alias(int_id(_rf_src), subscriber_ids)), post, int_id(_rf_src)) + if '@RSS' in parse_sms[0]: + print(parse_sms) + send_sms_cmd(CONFIG, int_id(_rf_src), sms) +## s = ' ' elif parse_sms[0] == 'ID': logger.info(str(get_alias(int_id(_rf_src), subscriber_ids)) + ' - ' + str(int_id(_rf_src))) if call_type == 'unit': diff --git a/web/app.py b/web/app.py index 5fa3670..58da6c5 100644 --- a/web/app.py +++ b/web/app.py @@ -2795,8 +2795,7 @@ TG #: ''' + str(tg_d.tg) + ''' ''' elif request.args.get('send_sms'): - sms_que_add(current_user.username, '', 0, int(request.form.get('dmr_id')), 'motorola', 'unit', request.form.get('gateway'), '', request.form.get('message')) - print(request.form.get('gateway')) + sms_que_add(current_user.username, '', 0, int(request.form.get('dmr_id')), 'motorola', 'unit', request.form.get('gateway'), '', current_user.username + ' - ' + request.form.get('message')) content = '''

Message in que.

Redirecting in 1 seconds.

''' @@ -6830,18 +6829,33 @@ Name: ''' + p.name + '''  -  Port: ''' + str( sms_que_purge(hblink_req['get_sms_que']) elif 'sms_cmd' in hblink_req: if hblink_req['sms_cmd']: + split_cmd = str(hblink_req['cmd']).split(' ') + print(split_cmd) if hblink_req['cmd'][:1] == '?': - tst = ServerList.query.filter(ServerList.other_options.ilike('%DATA_GATEWAY%')).first() - print(tst) - oo_str = tst.other_options - print(oo_str.split(';')) - +## tst = ServerList.query.filter(ServerList.other_options.ilike('%DATA_GATEWAY%')).first() +## print(tst) +## oo_str = tst.other_options +## print(oo_str.split(';')) try: - split_cmd = str(hblink_req['cmd']).split(' ') tp = TinyPage.query.filter_by(query_term=str(split_cmd[0])[1:]).first() -## sms_que_add('', '', 0, hblink_req['rf_id'], 'motorola', 'unit', hblink_req['sms_cmd'], '', tp.content) + sms_que_add('', '', 0, hblink_req['rf_id'], 'motorola', 'unit', hblink_req['sms_cmd'], '', tp.content) except: sms_que_add('', '', 0, hblink_req['rf_id'], 'motorola', 'unit', hblink_req['sms_cmd'], '', 'Query not found or other error.') + if hblink_req['cmd'][:4] == '@RSS': + try: + try: + retr = int(split_cmd[1]) + except: + retr = split_cmd[1] + + if type(retr) == int: + ss = Social.query.filter_by(dmr_id=int(split_cmd[1])).order_by(Social.time.desc()).first() + elif type(retr) == str: + ss = Social.query.filter_by(callsign=str(split_cmd[1]).upper()).order_by(Social.time.desc()).first() + sms_que_add('', '', 0, hblink_req['rf_id'], 'motorola', 'unit', hblink_req['sms_cmd'], '', 'Last - ' + ss.message) + except: + sms_que_add('', '', 0, hblink_req['rf_id'], 'motorola', 'unit', hblink_req['sms_cmd'], '', 'Not found or other error') + diff --git a/web/templates/mail.html b/web/templates/mail.html index 7d5c66c..be09e2a 100644 --- a/web/templates/mail.html +++ b/web/templates/mail.html @@ -70,8 +70,8 @@

- {% if call_or_get(current_user.has_roles('Admin')) %} -

+{% if call_or_get(current_user.has_roles('Admin')) %} +

{% endif %}