def test_update_agent_status(self): agent_id = 42 agent_status = {'availability': AgentStatus.logged_out, 'availability_since': 123456789} expected_result = {'class': 'getlist', 'listname': 'agents', 'function': 'updatestatus', 'tipbxid': 'xivo', 'tid': agent_id, 'status': agent_status} result = CTIMessageFormatter.update_agent_status(agent_id, agent_status) self.assertEqual(result, expected_result)
def test_update_agent_status(self): agent_id = 42 agent_status = { 'availability': AgentStatus.logged_out, 'availability_since': 123456789 } expected_result = { 'class': 'getlist', 'listname': 'agents', 'function': 'updatestatus', 'tipbxid': 'xivo', 'tid': agent_id, 'status': agent_status } result = CTIMessageFormatter.update_agent_status( agent_id, agent_status) self.assertEqual(result, expected_result)
def notify(self, agent_id): agent_status = dao.agent.agent_status(agent_id) cti_message = CTIMessageFormatter.update_agent_status(agent_id, agent_status) self.cti_server.send_cti_event(cti_message)
def notify(self, agent_id): agent_status = dao.agent.agent_status(agent_id) cti_message = CTIMessageFormatter.update_agent_status( agent_id, agent_status) self.cti_server.send_cti_event(cti_message)