|
@@ -8,12 +8,13 @@ import traceback
|
|
|
from src.core.callcenter.acd import AcdService
|
|
|
from src.core.callcenter.call import CallService
|
|
|
from src.core.callcenter.enumeration import CallType, DeviceType, AnswerFlag, NextType, CdrType, HangupDir, \
|
|
|
- CallCause,AgentServiceState
|
|
|
+ CallCause,AgentServiceState,AgentScene
|
|
|
from src.core.callcenter.esl.annotation import EslEventName
|
|
|
import src.core.callcenter.esl.utils.esl_event_util as EslEventUtil
|
|
|
from src.core.callcenter.esl.constant.event_names import CHANNEL_HANGUP
|
|
|
from src.core.callcenter.esl.handler.esl_event_handler import EslEventHandler
|
|
|
from src.core.callcenter.api import CallInfo, DeviceInfo, NextCommand
|
|
|
+from src.core.callcenter.push import PushHandler
|
|
|
from src.core.callcenter.data_handler import *
|
|
|
|
|
|
@EslEventName(CHANNEL_HANGUP)
|
|
@@ -24,6 +25,7 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
self.acd_service = AcdService(inbound_client,inbound_client.app)
|
|
|
self.call_service = CallService(inbound_client,inbound_client.logger)
|
|
|
self.dataHandleServer=DataHandleServer(inbound_client.app)
|
|
|
+ self.push_handler = PushHandler(inbound_client.logger)
|
|
|
|
|
|
def handle(self, address, event, coreUUID):
|
|
|
print(json.loads(event.serialize('json')), flush=True)
|
|
@@ -112,6 +114,7 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
|
|
|
if len(call.device_list)==0 and device.device_type == DeviceType.AGENT.code:
|
|
|
self.dataHandleServer.update_agent_monitor_service_state(device_id, AgentServiceState.IDLE.code)
|
|
|
+ self.push_handler.push_on_call_end(call.cti_flow_id,call.agent_key,AgentScene.ROBOT,call.direction, device.device_type)
|
|
|
except:
|
|
|
traceback.print_exc()
|
|
|
|