|
@@ -129,7 +129,7 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
|
|
|
# 全部挂机以后推送挂机状态
|
|
# 全部挂机以后推送挂机状态
|
|
# self.logger.info('yushanghui::call_info.device_list %s', call_info.device_list)
|
|
# self.logger.info('yushanghui::call_info.device_list %s', call_info.device_list)
|
|
- if call_info.hangup_count == call_info.answer_count:
|
|
|
|
|
|
+ if call_info.hangup_count >= call_info.answer_count:
|
|
# if len(call_info.device_list) == 0:
|
|
# if len(call_info.device_list) == 0:
|
|
self.get_call_info_record(call_info)
|
|
self.get_call_info_record(call_info)
|
|
|
|
|
|
@@ -155,14 +155,19 @@ class ChannelHangupHandler(EslEventHandler):
|
|
sip_status = []
|
|
sip_status = []
|
|
hangup_cause = []
|
|
hangup_cause = []
|
|
agent_name = ''
|
|
agent_name = ''
|
|
- for value in call_info.device_info_map.values():
|
|
|
|
- records.append(value.record) if value.record else None
|
|
|
|
- sip_status.append(value.sip_status if value.sip_status else 'EMPTY')
|
|
|
|
- hangup_cause.append(value.hangup_cause if value.hangup_cause else 'EMPTY')
|
|
|
|
- if value.device_type == DeviceType.AGENT.code :
|
|
|
|
- agent_name = value.agent_key
|
|
|
|
- self.logger.info("get_call_info_record: %s,agent_name:%s, sip_status:%s, hangup_cause:%s", records, agent_name, sip_status, hangup_cause)
|
|
|
|
- threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, list(dict.fromkeys(records)), ",".join(sip_status), ",".join(hangup_cause), agent_name)).start()
|
|
|
|
|
|
+ try:
|
|
|
|
+ self.logger.info("get_call_info_record: %s", call_info)
|
|
|
|
+ for value in call_info.device_info_map.values():
|
|
|
|
+ records.append(value.record) if value.record else None
|
|
|
|
+ sip_status.append(value.sip_status if value.sip_status else 'EMPTY')
|
|
|
|
+ hangup_cause.append(value.hangup_cause if value.hangup_cause else 'EMPTY')
|
|
|
|
+ if value.device_type == DeviceType.AGENT.code :
|
|
|
|
+ agent_name = value.agent_key
|
|
|
|
+ self.logger.info("get_call_info_record: %s,agent_name:%s, sip_status:%s, hangup_cause:%s", records, agent_name, sip_status, hangup_cause)
|
|
|
|
+ threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, list(dict.fromkeys(records)), ",".join(sip_status), ",".join(hangup_cause), agent_name)).start()
|
|
|
|
+ except Exception as e:
|
|
|
|
+ self.logger.info("get_call_info_record:exception %s", e)
|
|
|
|
+ traceback.print_exc()
|
|
|
|
|
|
def update_name(self,call_id, agent_name):
|
|
def update_name(self,call_id, agent_name):
|
|
try:
|
|
try:
|