Поднял по условиям

This commit is contained in:
zakhy 2025-04-22 12:54:07 +07:00
parent b1f42fa1b0
commit 4c6145661f

View File

@ -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())