|
@@ -30,22 +30,25 @@ class ChannelAnswerHandler(EslEventHandler):
|
|
|
|
|
|
device_id = EslEventUtil.getDeviceId(event)
|
|
|
device_info = call_info.device_info_map.get(device_id)
|
|
|
+ if CallType.AGENT_CALL.code == call_info.call_type and device_info.device_type == DeviceType.CUSTOMER.code:
|
|
|
+ self.record(event, device_id)
|
|
|
+
|
|
|
+ if CallType.BOT_CALL.code == call_info.call_type:
|
|
|
+ call_info.answer_flag = AnswerFlag.ROBOT_ANSWER.code
|
|
|
+ registry.counter('call_bot_answer_requests', '呼入机器人接听量', {'bucket_type': f"{call_info.bucket_type}"})
|
|
|
+
|
|
|
next_command = call_info.next_commands[0] if len(call_info.next_commands) > 0 else None
|
|
|
device_type = DeviceType.get_by_code(device_info.device_type)
|
|
|
self.logger.info("liuwei::debugger::ChannelAnswerHandler call_id:%s, device_id:%s, device_type:%s, next_command:%s"%(call_id, device_id, device_type, next_command))
|
|
|
if not next_command:
|
|
|
return
|
|
|
|
|
|
- if CallType.AGENT_CALL.code == call_info.call_type and device_info.device_type == DeviceType.CUSTOMER.code:
|
|
|
- self.record(event, device_id)
|
|
|
-
|
|
|
device_info.answer_time = EslEventUtil.getEventDateTimestamp(event)
|
|
|
device_info.ring_end_time = EslEventUtil.getEventDateTimestamp(event)
|
|
|
call_info.answer_count = call_info.answer_count + 1
|
|
|
call_info.next_commands.remove(next_command)
|
|
|
self.logger.info("liuwei::debugger::ChannelAnswerHandler call_info.answer_time::%s,time:%s", call_info.answer_time, EslEventUtil.getEventDateTimestamp(event))
|
|
|
|
|
|
-
|
|
|
if NextType.NEXT_CALL_OTHER.code == next_command.next_type:
|
|
|
self.call_other(call_info, device_info, event)
|
|
|
elif NextType.NEXT_CALL_BRIDGE.code == next_command.next_type:
|
|
@@ -107,10 +110,6 @@ class ChannelAnswerHandler(EslEventHandler):
|
|
|
def call_bridge(self, call: CallInfo, device: DeviceInfo, next_command: NextCommand, event):
|
|
|
self.logger.info("开始桥接电话: callId:%s, caller:%s, called:%s, device1:%s, device2:%s"% (call.call_id,
|
|
|
call.caller, call.called, next_command.device_id, next_command.next_value))
|
|
|
- if CallType.BOT_CALL.code == call.call_type:
|
|
|
- call.answer_flag = AnswerFlag.ROBOT_ANSWER.code
|
|
|
- registry.counter('call_bot_answer_requests', '呼入机器人接听量', {'bucket_type': f"{call.bucket_type}"})
|
|
|
-
|
|
|
self.record(event, device_id=device.device_id)
|
|
|
device1 = call.device_info_map.get(next_command.device_id)
|
|
|
device2 = call.device_info_map.get(next_command.next_value)
|