Package com.kurento.kmf.jsonrpcconnector

Examples of com.kurento.kmf.jsonrpcconnector.Session


    @Override
    public void handleRequest(final Transaction transaction,
        Request<String> request) throws Exception {

      Session session = transaction.getSession();

      if (session.isNew()) {
        transaction.sendResponse("new");
      } else {
        transaction.sendResponse("old");
      }
    }
View Full Code Here


  public Collection<Session> getSessionsByObjAndType(String objectAndType) {
    return sessionsByObjAndType.get(objectAndType);
  }

  public Collection<Session> getSessionsBySubscription(String subscriptionId) {
    Session session = sessionsBySubsId.get(subscriptionId);
    if (session == null) {
      return Collections.emptyList();
    } else {
      return Arrays.asList(session);
    }
View Full Code Here

  private void call(Transaction transaction, JsonObject params)
      throws IOException {

    String to = params.get("callTo").getAsString();
    Session toSession = registry.get(to).getSession();

    JsonObject icParams = new JsonObject();
    params.addProperty("from", name);
    JsonObject icResponse = (JsonObject) toSession.sendRequest(
        "incommingCall", icParams);

    String callResponse = icResponse.get("callResponse").getAsString();

    if ("Accept".equals(callResponse)) {

      log.info("Accepted call from '{}' to '{}'", name, to);

      call = new Call(mpf);
      call.setOutgoingPeer(name, session);
      call.setIncommingPeer(to, toSession);

      String ipSdpOffer = icResponse.get("sdpOffer").getAsString();

      log.info("SdpOffer: {}", ipSdpOffer);

      String ipSdpAnswer = call.getWebRtcForIncommingPeer().processOffer(
          ipSdpOffer);

      JsonObject scParams = new JsonObject();
      scParams.addProperty("sdpAnswer", ipSdpAnswer);

      log.info("SdpAnswer: {}", ipSdpAnswer);

      // TODO Should we expect something from client?
      toSession.sendRequest("startCommunication", scParams);

      String opSdpOffer = params.getAsJsonPrimitive("sdpOffer")
          .getAsString();

      String opSdpAnswer = call.getWebRtcForOutgoingPeer().processOffer(
View Full Code Here

      log.info("Request method:" + request.getMethod());
      log.info("Request params:" + request.getParams());

      transaction.sendResponse(request.getParams());

      final Session session = transaction.getSession();
      final Object params = request.getParams();

      new Thread() {
        public void run() {
          asyncReverseSend(session, params);
View Full Code Here

    @Override
    public void handleRequest(final Transaction transaction,
        Request<String> request) throws Exception {

      Session session = transaction.getSession();

      if (session.isNew()) {
        transaction.sendResponse("new");
      } else {
        transaction.sendResponse("old");
      }

      if (counter == 2) {
        session.close();
      }
      counter++;
    }
View Full Code Here

      log.info("Request method:" + request.getMethod());
      log.info("Request params:" + request.getParams());

      transaction.sendResponse(request.getParams());

      final Session session = transaction.getSession();
      final Object params = request.getParams();

      new Thread() {
        public void run() {
          asyncReverseSend(session, params);
View Full Code Here

TOP

Related Classes of com.kurento.kmf.jsonrpcconnector.Session

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.