余尚辉 4 months ago
parent
commit
cd10e917d9

+ 1 - 0
docker-compose.yml

@@ -8,6 +8,7 @@ services:
 #      - /Users/davidliu/git/voice-gateway-service:/code
       - /home/hongshan/voice-gateway-service:/code
       - /root/aibot/dm/voice:/root/aibot/dm/voice
+      - /home/hongshan/freeswitch:/freeswitch
     environment:
       - SERVE_HOST=192.168.100.159
       - TZ=Asia/Shanghai

+ 9 - 0
src/core/callcenter/agent.py

@@ -149,6 +149,7 @@ class AgentEventService:
                 self.agent_actionlog_service.insert_service_state(agent_monitor, AgentServiceState.REPROCESSING, AgentLogState.CHANNEL_HANG_UP)
 
                 self.data_handle_server.update_record(call_id, time_end=datetime.now())
+                self.get_call_info_record(call_info)
                 # 同步处理后处理置闲
                 # reprocessingIdle(statusDto);
                 # agentProducer.pushDelayedStatus(statusDto, reprocessingTimeout);
@@ -222,6 +223,7 @@ class AgentEventService:
                 self.agent_actionlog_service.insert_service_state(agent_monitor, AgentServiceState.REPROCESSING,
                                                       AgentLogState.CHANNEL_HANG_UP, service_id=human_service_id)
                 self.data_handle_server.update_record(call_id, time_end=datetime.now())
+                self.get_call_info_record(call_info)
         except:
             traceback.print_exc()
         finally:
@@ -238,6 +240,13 @@ class AgentEventService:
         self.agent_monitor_service.update_idle(agent_monitor)
         self.push_handler.push_on_agent_work_report(state_data.saas_id, state_data.flow_id, state_data.agent_num, "", state_data.scene, WorkStatus.AGENT_HANG_IDLE)
         self.agent_actionlog_service.insert_service_state(agent_monitor, AgentServiceState.IDLE, AgentLogState.REPROCESSING_IDLE)
+    def get_call_info_record(self, call_info):
+        records = []
+        for value in call_info.device_info_map.values():
+            records.append(value.record)
+        self.logger.info("get_call_info_record: %s", records)
+
+
 
 
 class AgentOperService:

+ 2 - 2
src/core/callcenter/data_handler.py

@@ -45,9 +45,9 @@ class DataHandleServer:
     def update_record(self, session_id, **kwargs):
         call_record = CallRecord.query.filter(CallRecord.session_id == session_id).first()
         time_end = kwargs.get('time_end')
-        if time_end:
+        if time_end and call_record.call_type==1:
             bot_record = BotRecords.query.filter(BotRecords.session == session_id).first()
-            call_record.bussiness_type = bot_record.intent
+            call_record.bussiness_type = bot_record.intent if bot_record else ''
         # 动态更新字段
         for key, value in kwargs.items():
             if hasattr(call_record, key):

+ 1 - 1
src/core/callcenter/esl/handler/channel_answer_handler.py

@@ -78,7 +78,7 @@ class ChannelAnswerHandler(EslEventHandler):
         # 启用录音, 生产时候打开
         record_url = self.record(event, device_id)
         device.record_start_time = device.answer_time
-        self.dataHandleServer.update_record(call_id, url= record_url)
+        # self.dataHandleServer.update_record(call_id, url= record_url)
 
         call.direction = Direction.OUTBOUND.code
         call.answer_flag = AnswerFlag.AGENT_ANSWER.code