code: private void updateAgentState(AsteriskAgentImpl agent, AgentState newState)
      {
          logger.info("Set state of agent " + agent.getAgentId() + " to " + newState);
          synchronized (agent)
          {
              agent.updateState(newState);
          }
      }
docs: Set state of agent.
  
  @param agent