/** * Accepts a <code>JingleSessionRequest</code>. * * @param request the request. */ private void acceptSession(JingleSessionRequest request) { toasterManager.close(); if (ringing != null) { ringing.stop(); } // Start the call session.startIncoming(); if (chatRoom == null) { chatRoom = SparkManager.getChatManager().getChatRoom(StringUtils.parseBareAddress(request.getFrom())); SparkManager.getChatManager().getChatContainer().activateChatRoom(chatRoom); SparkManager.getChatManager().getChatContainer().getChatFrame().toFront(); notifyRoom(); } }
/** * Adds Jingle and ChatRoom listeners. */ private void addListeners() { if (jingleManager == null) { if (readyToConnect) { Log.error("Unable to resolve Jingle Connection (Host: "+stunServer+" Port: "+stunPort+")"); } return; } // Listen in for new incoming Jingle requests. jingleManager.addJingleSessionRequestListener(new JingleSessionRequestListener() { public void sessionRequested(final JingleSessionRequest request) { SwingUtilities.invokeLater(new Runnable() { public void run() { incomingJingleSession(request); } }); } }); }
public void initialize() { ICETransportManager icetm0 = new ICETransportManager(xmppConnection, "10.47.47.53", 3478); List<JingleMediaManager> mediaManagers = new ArrayList<JingleMediaManager>(); //mediaManagers.add(new JmfMediaManager(icetm0)); mediaManagers.add(new SpeexMediaManager(icetm0)); mediaManagers.add(new ScreenShareMediaManager(icetm0)); jm = new JingleManager(xmppConnection, mediaManagers); jm.addCreationListener(icetm0); jm.addJingleSessionRequestListener(new JingleSessionRequestListener() { public void sessionRequested(JingleSessionRequest request) { // if (incoming != null) // return; try { // Accept the call incoming = request.accept(); // Start the call incoming.startIncoming(); } catch (XMPPException e) { e.printStackTrace(); } } }); createGUI(); }
/** * Notify user that a new incoming jingle request has been receieved. * * @param request the <code>JingleSessionRequest</code>. */ private void incomingJingleSession(JingleSessionRequest request) { if (PhoneManager.isUseStaticLocator() && PhoneManager.isUsingMediaLocator()) { request.reject(); } else { PhoneManager.setUsingMediaLocator(true); new IncomingCall(request); } }
/** * A request to start a session has been recieved from another user. * * @param request The request from the other user. */ public void sessionRequested(JingleSessionRequest request);