|
@@ -13,21 +13,21 @@ class ChannelBridgeHandler(EslEventHandler):
|
|
|
|
|
|
def __init__(self, inbound_client, bot_agent):
|
|
|
super().__init__(inbound_client, bot_agent)
|
|
|
- # self.dataHandleServer = DataHandleServer(inbound_client.app)
|
|
|
- # self.push_handler = PushHandler(inbound_client.logger)
|
|
|
+ self.dataHandleServer = DataHandleServer(inbound_client.app)
|
|
|
+ self.push_handler = PushHandler(inbound_client.logger)
|
|
|
|
|
|
def handle(self, address, event, coreUUID):
|
|
|
- pass
|
|
|
- # call_id = EslEventUtil.getCallId(event)
|
|
|
- # device_id = EslEventUtil.getDeviceId(event)
|
|
|
- # call = self.cache.get_call_info(call_id)
|
|
|
- # device = call.device_info_map.get(device_id)
|
|
|
- # # 每通电话的第一次写入应答时间
|
|
|
- # if not call.answer_time:
|
|
|
- # call.answer_time = EslEventUtil.getEventDateTimestamp(event)
|
|
|
- # self.cache.add_call_info(call)
|
|
|
- # self.dataHandleServer.update_record(call_id, {"status": 1})
|
|
|
- # self.logger.info("bridge call_info.answer_time:%s,device_info.answer_time%s,device.device_type%s" % (call.answer_time, device.answer_time,device.device_type))
|
|
|
- # if device.device_type == DeviceType.AGENT.code: # 如果是坐席接听 变更坐席状态
|
|
|
- # self.push_handler.push_on_agent_work_report(call.saas_id, call.cti_flow_id, call.agent_key, call.call_id, AgentScene.ROBOT, WorkStatus.AGENT_ANSWER_INCOMING)
|
|
|
- # self.dataHandleServer.update_agent_monitor_service_state(call.agent_key, AgentServiceState.CALLING.code)
|
|
|
+ call_id = EslEventUtil.getCallId(event)
|
|
|
+ device_id = EslEventUtil.getDeviceId(event)
|
|
|
+ call_info = self.cache.get_call_info(call_id)
|
|
|
+ device = call_info.device_info_map.get(device_id)
|
|
|
+ # 每通电话的第一次写入应答时间
|
|
|
+ if not call_info.answer_time:
|
|
|
+ call_info.answer_time = EslEventUtil.getEventDateTimestamp(event)
|
|
|
+ self.cache.add_call_info(call_info)
|
|
|
+ self.dataHandleServer.update_record(call_id, {"status": 1})
|
|
|
+ self.logger.info("bridge call_info.answer_time:%s,device_info.answer_time%s,device.device_type%s" % (call_info.answer_time, device.answer_time,device.device_type))
|
|
|
+ if device.device_type == DeviceType.AGENT.code: # 如果是坐席接听 变更坐席状态
|
|
|
+ # self.dataHandleServer.update_record(call_id, {"status": 1})
|
|
|
+ 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_ANSWER_INCOMING)
|
|
|
+ self.dataHandleServer.update_agent_monitor_service_state(call_info.agent_key,AgentServiceState.CALLING.code)
|