|
@@ -113,20 +113,8 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
|
|
|
# 全部挂机以后推送挂机状态
|
|
|
# self.logger.info('yushanghui::call_info.device_list %s', call_info.device_list)
|
|
|
- # if len(call_info.device_list) == 0:
|
|
|
- # self.push_handler.push_on_call_end(call_info.cti_flow_id, call_info.agent_key, AgentScene.ROBOT, call_info.direction, device_info.device_type)
|
|
|
- # self.push_handler.push_on_agent_work_report(call_info.saas_id, call_info.cti_flow_id, call_info.agent_key, call_info.call_id, AgentScene.ROBOT, WorkStatus.AGENT_HANG_IDLE)
|
|
|
- # # 计算当前通话时长
|
|
|
- # if call_info.answer_time:
|
|
|
- # call_info.end_time = timestamp
|
|
|
- # call_info.talk_time = int(call_info.end_time) - int(call_info.answer_time)
|
|
|
- # self.dataHandleServer.update_record(call_id, {"time_end": datetime.now(), "times": int(call_info.talk_time / 1_000_000) })
|
|
|
- #
|
|
|
- # self.logger.info('全部挂断 %s', device_info.device_type)
|
|
|
- # # 更新坐席状态
|
|
|
- # if device_info.device_type == DeviceType.AGENT.code:
|
|
|
- # self.logger.info('更新坐席状态')
|
|
|
- # self.dataHandleServer.update_agent_monitor_service_state(call_info.agent_key, AgentServiceState.IDLE.code)
|
|
|
+ if len(call_info.device_list) == 0:
|
|
|
+ self.get_call_info_record(call_info)
|
|
|
|
|
|
# 判断挂机方向 && 更新缓存
|
|
|
self.hangup_dir(call_info, device_info, cause)
|
|
@@ -135,6 +123,12 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
except:
|
|
|
traceback.print_exc()
|
|
|
|
|
|
+ def get_call_info_record(self, call_info):
|
|
|
+ records = []
|
|
|
+ self.logger.info("1223232 %s", records)
|
|
|
+ for value in call_info.device_info_map.values():
|
|
|
+ records.append(value.record)
|
|
|
+ self.logger.info("get_call_info_record: %s", records)
|
|
|
def release(self, event):
|
|
|
device_id = event.getHeader("Unique-ID")
|
|
|
user_part = self.cache.get_user_part(device_id)
|