|
@@ -13,20 +13,22 @@ class Callback(object):
|
|
|
|
|
|
def __init__(self, app):
|
|
def __init__(self, app):
|
|
self.app = app
|
|
self.app = app
|
|
|
|
+ self.logger = app.logger
|
|
self.cache = Cache(app)
|
|
self.cache = Cache(app)
|
|
self.agent_event_service = AgentEventService(app)
|
|
self.agent_event_service = AgentEventService(app)
|
|
|
|
|
|
def callback_event(self, event):
|
|
def callback_event(self, event):
|
|
event_name = EslEventUtil.getEventName(event)
|
|
event_name = EslEventUtil.getEventName(event)
|
|
|
|
|
|
|
|
+ self.logger.info("liuwei::debugger::callback::event_name=%s", event_name)
|
|
if not (CUSTOM == event_name and event_name.startswith('CHANNEL_') and event_name.startswith('PLAYBACK_') and event_name.startswith('PLAYBACK_')):
|
|
if not (CUSTOM == event_name and event_name.startswith('CHANNEL_') and event_name.startswith('PLAYBACK_') and event_name.startswith('PLAYBACK_')):
|
|
return
|
|
return
|
|
|
|
|
|
call_id = EslEventUtil.getCallId(event)
|
|
call_id = EslEventUtil.getCallId(event)
|
|
device_id = EslEventUtil.getDeviceId(event)
|
|
device_id = EslEventUtil.getDeviceId(event)
|
|
-
|
|
|
|
call_info = self.cache.get_call_info(call_id)
|
|
call_info = self.cache.get_call_info(call_id)
|
|
device_info = call_info.device_info_map.get(device_id) if call_info and call_info.device_info_map else None
|
|
device_info = call_info.device_info_map.get(device_id) if call_info and call_info.device_info_map else None
|
|
|
|
+ self.logger.info("liuwei::debugger::callback::event_name=%s, call_id=%s, device_id=%s, call_info=%s", event_name, call_id, device_id, call_info)
|
|
if call_info and CallType.BOT_CALL.code == call_info.call_type:
|
|
if call_info and CallType.BOT_CALL.code == call_info.call_type:
|
|
threading.Thread(target=self.agent_event_service.bot_event_channel, args=(event, call_info, device_info)).start()
|
|
threading.Thread(target=self.agent_event_service.bot_event_channel, args=(event, call_info, device_info)).start()
|
|
# self.agent_event_service.bot_event_channel(event, call_info, device_info)
|
|
# self.agent_event_service.bot_event_channel(event, call_info, device_info)
|