Package org.red5.server.api.service

Examples of org.red5.server.api.service.IServiceCapableConnection


              if (rcl != null) {
                if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                  // continue;
                } else {
                  log.debug("is this users still alive? :" + rcl);
                  IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
                  iStream.invoke(clientFunction, new Object[] { rc }, this);
                }

                log.debug("sending notification to " + conn + " ID: ");

                // if this close stream event then stop the
View Full Code Here


  }
  public void callclient() {
    log.info("callclient called");
    IConnection conn = Red5.getConnectionLocal();
    if (conn instanceof IServiceCapableConnection) {
        IServiceCapableConnection sc = (IServiceCapableConnection) conn;
        log.info("flashmethod called");
        sc.invoke("flashmethod", new Object[]{"One", 1});
    }
  }
View Full Code Here

      IScope scope = (WebScope) conn.getScope();
      IContext context = (Context) scope.getContext();

      IClientRegistry reg = context.getClientRegistry();

      IServiceCapableConnection serviceCapCon = null;

      //start standard process
      assertTrue(conn.connect(scope));

      //go through the client list and send at least one message to everyone
      for (String worker : workerList) {
        //dont send to ourself
        if (name.equals(worker)) {
          log.debug("Dont send to self");
          continue;
        }
        if (reg.hasClient(worker)) {
          IClient recip = reg.lookupClient(worker);
          Set<IConnection> rcons = recip.getConnections(scope);
          //log.debug("Recipient has {} connections", rcons.size());
          Object[] sendobj = new Object[] { client.getId(), "This is a message from " + name };
          for (IConnection rcon : rcons) {
            if (rcon instanceof IServiceCapableConnection) {
              serviceCapCon = (IServiceCapableConnection) rcon;
              serviceCapCon.invoke("privMessage", sendobj);
              break;
            } else {
              log.info("Connection is not service capable");
            }
          }
        } else {
          log.warn("Client not registered {}", worker);
        }
      }

      //number of connections
      int connectionCount = workerList.size();

      //now send N messages to random recipients
      for (int i = 0; i < 4000; i++) {
        String worker = workerList.get(rnd.nextInt(connectionCount));
        //dont send to ourself
        if (name.equals(worker)) {
          //log.debug("Dont send to self");
          continue;
        }
        if (reg.hasClient(worker)) {
          IClient recip = reg.lookupClient(worker);
          Set<IConnection> rcons = recip.getConnections(scope);
          //log.debug("Recipient has {} connections", rcons.size());
          Object[] sendobj = new Object[] { client.getId(), "This is a message from " + name };
          for (IConnection rcon : rcons) {
            if (rcon instanceof IServiceCapableConnection) {
              serviceCapCon = (IServiceCapableConnection) rcon;
              serviceCapCon.invoke("privMessage", sendobj);
              break;
            } else {
              log.info("Connection is not service capable");
            }
          }
View Full Code Here

    // their code
    IScope scope = Red5.getConnectionLocal().getScope();
    for (IConnection tempConn : scope.getClientConnections()) {
      if (tempConn instanceof IServiceCapableConnection) {
        try {
          @SuppressWarnings("unused")
          IServiceCapableConnection sc = (IServiceCapableConnection) tempConn;
          //sc.invoke(methodName, objArrays);
        } catch (NoSuchElementException e) {
          log.warn("Previous scope connection is unavailable", e);
        }
View Full Code Here

        sipManager.destroyAllSessions();
    }

    @Override
    public boolean appConnect(IConnection conn, Object[] params) {
        IServiceCapableConnection service = (IServiceCapableConnection) conn;
        log.debug("VoiceConferenceApplication appConnect[" + conn.getClient().getId() + "," + service + "]");
        return true;
    }
View Full Code Here

  private void login(String obproxy, String uid, String phone, String username,
      String password, String realm, String proxy, int sipport, int rtpport) {
    System.out.println("Red5SIP login " + uid);
    IConnection conn = Red5.getConnectionLocal();
    IServiceCapableConnection service = (IServiceCapableConnection) conn;
   
    ConnectionClientMethodInvoker rtmpConnection = new ConnectionClientMethodInvoker(service, conn.getScope());
    String userid = getSipUserId();
    sipManager.createSipUser(userid, rtmpConnection, sipport, rtpport);
    sipManager.login(userid, obproxy, phone, username, password, realm, proxy);
View Full Code Here

        sipManager.destroyAllSessions();
    }

    @Override
    public boolean appConnect( IConnection conn, Object[] params ) {
        IServiceCapableConnection service = (IServiceCapableConnection) conn;
        loginfo( "Red5SIP Client connected " + conn.getClient().getId() + " service " + service );
        return true;
    }
View Full Code Here

    @Override
    public boolean appJoin( IClient client, IScope scope ) {
        loginfo( "Red5SIP Client joined app " + client.getId() );
        IConnection conn = Red5.getConnectionLocal();
        IServiceCapableConnection service = (IServiceCapableConnection) conn;

        return true;
    }
View Full Code Here

  public boolean roomConnect(IConnection conn, Object[] params) {
    log.debug("roomConnect : ");

    try {

      IServiceCapableConnection service = (IServiceCapableConnection) conn;
      String streamId = conn.getClient().getId();
     
      boolean isAVClient = false;
      if (params.length == 1) {
        isAVClient = Boolean.parseBoolean(params[0].toString());
      }

      log.debug("### Client connected to OpenMeetings, register Client StreamId: "
          + streamId + " scope " + conn.getScope().getName()+ " isAVClient "+isAVClient);
      log.debug("params "+params);

      // Set StreamId in Client
      service.invoke("setId", new Object[] { streamId }, this);

      String swfURL = "";
      if (conn.getConnectParams().get("swfUrl") != null) {
        swfURL = conn.getConnectParams().get("swfUrl").toString();
      }
View Full Code Here

                continue;
              }
             
              log.debug("RCL SEND is equal newStream SEND "+rcl.getPublicSID()+" || "+rcl.getUserport());
               
              IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
              iStream.invoke("newStream",
                  new Object[] { clientObjectSendToSync },
                  this);

            }
          }
View Full Code Here

TOP

Related Classes of org.red5.server.api.service.IServiceCapableConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.