ect to a XMPP Server Connection x1 = new XMPPConnection("xmpp.com"); x1.connect(); x1.login("juliet", "juliet");
// Create a JingleManager using a BasicResolver final JingleManager jm1 = new JingleManager( x1, new BasicTransportManager());
// Create a JingleMediaManager. In this case using Jingle Audio Media API JingleMediaManager jingleMediaManager = new AudioMediaManager();
// Set the JingleMediaManager jm1.setMediaManager(jingleMediaManager);
// Listen for incoming calls jm1.addJingleSessionRequestListener(new JingleSessionRequestListener() { public void sessionRequested(JingleSessionRequest request) {
try { // Accept the call IncomingJingleSession session = request.accept();
// Start the call session.start(); } catch (XMPPException e) { e.printStackTrace(); }
} });
Thread.sleep(15000);
} catch (Exception e) { e.printStackTrace(); }
To create an Outgoing Jingle Session:
try {
// Connect to a XMPP Server Connection x0 = new XMPPConnection("xmpp.com"); x0.connect(); x0.login("romeo", "romeo");
// Create a JingleManager using a BasicResolver final JingleManager jm0 = new JingleManager( x0, new BasicTransportManager());
// Create a JingleMediaManager. In this case using Jingle Audio Media API JingleMediaManager jingleMediaManager = new AudioMediaManager(); // Using Jingle Media API
// Set the JingleMediaManager jm0.setMediaManager(jingleMediaManager);
// Create a new Jingle Call with a full JID OutgoingJingleSession js0 = jm0.createOutgoingJingleSession("juliet@xmpp.com/Smack");
// Start the call js0.start();
Thread.sleep(10000); js0.terminate();
Thread.sleep(3000);
} catch (Exception e) { e.printStackTrace(); }
@author Thiago Camargo
@author Alvaro Saurin
@author Jeff Williams
@see JingleListener
@see TransportResolver
@see JingleSession
@see JingleSession
@see JingleMediaManager
@see BasicTransportManager , STUNTransportManager, BridgedTransportManager, TransportResolver, BridgedResolver, ICEResolver, STUNResolver and BasicResolver.