diff --git a/docker-compose.yaml b/docker-compose.yaml index 228702e..7190dc9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -48,6 +48,15 @@ services: - mongo networks: - phone + worker-dev: + build: ./worker-dev + restart: always + environment: + - TZ=Asia/Krasnoyarsk + depends_on: + - mongo + networks: + - phone web: build: ./web restart: always diff --git a/web/app.py b/web/app.py index 5a37b31..53812bb 100644 --- a/web/app.py +++ b/web/app.py @@ -29,7 +29,7 @@ IgnoreList = ['83919865589', '83912051046', '83912051045', '84950213944', '84951 @app.route("/web/call/") def WebCall(): - call = coll_call.find().sort('time', -1) + call = coll_call.find().limit(findLimit).sort('time', -1) return render_template("WebCall.html", call=call) @app.route("/web/call/status/") diff --git a/web_admin/templates/WebCall.html b/web_admin/templates/WebCall.html index b462625..c9c7cca 100644 --- a/web_admin/templates/WebCall.html +++ b/web_admin/templates/WebCall.html @@ -22,6 +22,7 @@ Дата время Дополнитительная информация + uuid @@ -54,6 +55,8 @@ {% if entry.reason|length > 1 %} {{ entry.reason }} {% endif %} + + {{ entry.uuid }} diff --git a/worker/app.py b/worker/app.py index 6e924d4..b6ddf62 100644 --- a/worker/app.py +++ b/worker/app.py @@ -63,7 +63,6 @@ def main(): insDict = {"client": srcJson['from'], "time": srcJson['time'], "status": 0, "recordUrl": srcJson["recordUrl"], "duration": srcJson["duration"], "important": tmpIncoming[srcJson['uuid']][2]} except Exception as e: - # print(srcJson) print(e) insDict = { "client": srcJson['from'], "time": srcJson['time'], "status": 1, "important": tmpIncoming[srcJson['uuid']][2]} @@ -94,11 +93,11 @@ def main(): #r = coll_phone.update_one({'$and': [{'client': {'$regex': srcJson['to']}}, {'status': 1}]}, {'$set': {'status': 2, 'callid': srcJson['uuid']}}) r = coll_phone.update_one({'$and': [{'client': {'$regex': srcJson['to']}}, {'status': {'$in': [1,4]}}]}, {'$set': {'status': 2, 'callid': srcJson['uuid']}}) if srcJson['state'] == 'HANGUP': - try: + try: # Проверяем заполнено ли поле recordURL, если нет то меняем статус на 4 if len(srcJson['recordUrl']) > 4: coll_phone.update_one({'callid':srcJson['uuid']}, {'$set': {'recordUrl': srcJson['recordUrl']}}) - else: + else: coll_phone.update_one({'callid':srcJson['uuid']}, {'$set': {'status': 4}}) except Exception as e: print(e)