Ejemplo n.º 1
0
def agent_get_status(agi, cursor, args):
    try:
        agent_id = int(args[0])

        agent.get_agent_status(agi, agent_id)
    except Exception as e:
        logger.exception("Error while logging off agent")
        agi.dp_break(e)
Ejemplo n.º 2
0
    def test_get_agent_status(self, AgentdClient):
        AgentdClient.return_value = self.agentd_client

        agent.get_agent_status(self.agi, self.agent_id)

        AgentdClient.assert_called_once_with(**self.agentd_config)
        self.agentd_client.agents.get_agent_status.assert_called_once_with(self.agent_id)
        self.agi.set_variable.assert_called_once_with('XIVO_AGENT_LOGIN_STATUS', ANY)