/**
  * Start or stop sending video with this call.
  *
  * @param videoStatus enable = true.
  * @throws SkypeException when connection is bad.
  */
 public void setSendVideoEnabled(final boolean videoStatus) throws SkypeException {
   String value = videoStatus ? "START_VIDEO_RECEIVE" : "STOP_VIDEO_RECEIVE";
   try {
     String response = Connector.getInstance().execute("ALTER CALL " + getId() + " " + value);
     Utils.checkError(response);
   } catch (ConnectorException e) {
     Utils.convertToSkypeException(e);
   }
 }
 /**
  * Change the status of this CALL object.
  *
  * @param status The new status to set.
  * @throws SkypeException when connection is bad.
  */
 private void setStatus(final String status) throws SkypeException {
   try {
     String response =
         Connector.getInstance()
             .executeWithId(
                 "SET CALL " + getId() + " STATUS " + status, "CALL " + getId() + " STATUS ");
     Utils.checkError(response);
   } catch (ConnectorException e) {
     Utils.convertToSkypeException(e);
   }
 }
 public boolean canTransferTo(String skypeId) throws SkypeException {
   try {
     String command = "GET CALL " + getId() + " CAN_TRANSFER " + skypeId;
     String responseHeader = "CALL " + getId() + " CAN_TRANSFER " + skypeId + " ";
     String response = Connector.getInstance().execute(command, responseHeader);
     Utils.checkError(response);
     return Boolean.parseBoolean(response.substring((responseHeader).length()));
   } catch (ConnectorException e) {
     Utils.convertToSkypeException(e);
     return false;
   }
 }
 public void transferTo(String... skypeIds) throws SkypeException {
   Utils.checkNotNull("skypeIds", skypeIds);
   try {
     String response =
         Connector.getInstance()
             .execute(
                 "ALTER CALL "
                     + getId()
                     + " TRANSFER \""
                     + Utils.convertToCommaSeparatedString(skypeIds)
                     + "\"");
     Utils.checkError(response);
   } catch (ConnectorException e) {
     Utils.convertToSkypeException(e);
   }
 }
 private void setStreams(String type, Map<String, String> streams) throws SkypeException {
   try {
     StringBuilder parameters = new StringBuilder();
     for (String key : streams.keySet()) {
       parameters.append(" ");
       parameters.append(key);
       parameters.append("=\"");
       parameters.append(streams.get(key));
       parameters.append("\"");
     }
     String response =
         Connector.getInstance().execute("ALTER CALL " + getId() + " SET_" + type + parameters);
     Utils.checkError(response);
   } catch (ConnectorException e) {
     Utils.convertToSkypeException(e);
   }
 }
  static boolean isRunning() {
    synchronized (isRunningMethodMutex) {
      String installedPath = Connector.getInstance().getInstalledPath();
      if (installedPath == null) {
        return false;
      }

      String commandPath = "\"" + installedPath + "\"";
      WinProcess.enableDebugPrivilege();
      for (WinProcess process : WinProcess.all()) {
        int pid = process.getPid();
        if (pid != 0 && pid != 4 && process.getCommandLine().startsWith(commandPath)) {
          return true;
        }
      }
      return false;
    }
  }