From 4c6145661fdf949de8f2beeef41d803d1b60f948 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Tue, 22 Apr 2025 12:54:07 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=BD=D1=8F=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=83=D1=81=D0=BB=D0=BE=D0=B2=D0=B8=D1=8F=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/workerslocation/commands/radiusip.py | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/apps/workerslocation/commands/radiusip.py b/apps/workerslocation/commands/radiusip.py index 42c2bce..f5344db 100644 --- a/apps/workerslocation/commands/radiusip.py +++ b/apps/workerslocation/commands/radiusip.py @@ -151,20 +151,8 @@ async def receive_messages(websocket, auth_dict): if identifier != "location:0/position_broadcast": log(f"<<< Ответ получен: {item}") - if identifier == "core/connection_response": - log("Соединение установлено. Инициализация модулей...") - auth_dict["client_id"] = item["payload"].get("client_id") - await send_messages(websocket, get_call_initialize_command()) - await send_messages(websocket, get_location_initialize_command()) - - elif identifier == "call:1/initialization_response": - call_mapi_initialized = True - ssrc = item["payload"].get("voip_ssrc", SSRC) - - elif identifier == "location:0/position_broadcast" and auth_dict.get("wlocationsystem"): - await save_location(item["payload"]) - - elif call_mapi_initialized and auth_dict.get("plasystem"): + # Проверяем вызовы + if call_mapi_initialized and auth_dict.get("plasystem"): voice_call = await get_voice_calls() if voice_call: for ch in voice_call.channels.all(): @@ -179,6 +167,19 @@ async def receive_messages(websocket, auth_dict): promise_id += 1 await set_voice_call_sent(voice_call) + if identifier == "core/connection_response": + log("Соединение установлено. Инициализация модулей...") + auth_dict["client_id"] = item["payload"].get("client_id") + await send_messages(websocket, get_call_initialize_command()) + await send_messages(websocket, get_location_initialize_command()) + + elif identifier == "call:1/initialization_response": + call_mapi_initialized = True + ssrc = item["payload"].get("voip_ssrc", SSRC) + + elif identifier == "location:0/position_broadcast" and auth_dict.get("wlocationsystem"): + await save_location(item["payload"]) + except Exception: logging.error(traceback.format_exc())