mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 09:03:54 +08:00
优化相关逻辑
This commit is contained in:
@@ -192,6 +192,8 @@ class ConnectionHandler:
|
||||
|
||||
# 初始化通话状态
|
||||
self.calling = False
|
||||
# 标记当前是否为来电接听模式
|
||||
self.incoming_call = None
|
||||
|
||||
async def handle_connection(self, ws: websockets.ServerConnection):
|
||||
try:
|
||||
|
||||
@@ -64,6 +64,9 @@ class ListenTextMessageHandler(TextMessageHandler):
|
||||
call_text = original_text[len("[device_call]"):].strip()
|
||||
conn.logger.bind(tag=TAG).info(f"收到设备呼叫指令: {call_text}")
|
||||
|
||||
# 标记为来电接听模式
|
||||
conn.incoming_call = True
|
||||
|
||||
# 准备开始新会话
|
||||
conn.sentence_id = uuid.uuid4().hex
|
||||
|
||||
|
||||
Reference in New Issue
Block a user