*/
public void sessionRequested(final JingleSessionRequest request) {
System.out.println("Session request detected, from " + request.getFrom() + ": accepting.");
// We accept the request
JingleSession session1;
try {
session1 = request.accept();
session1.addListener(new JingleSessionListener() {
public void sessionClosed(String reason, JingleSession jingleSession) {
}
public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {
}
public void sessionDeclined(String reason, JingleSession jingleSession) {
}
public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc,
JingleSession jingleSession) {
incCounter();
System.out.println("Responder: the session is fully established.");
System.out.println("+ Payload Type: " + pt.getId());
System.out.println("+ Local IP/port: " + lc.getIp() + ":" + lc.getPort());
System.out.println("+ Remote IP/port: " + rc.getIp() + ":" + rc.getPort());
}
public void sessionRedirected(String redirection, JingleSession jingleSession) {
}
public void sessionMediaReceived(JingleSession jingleSession, String participant) {
// Do Nothing
}
});
session1.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
}
}
});
// Session 0 starts a request
System.out.println("Starting session request, to " + getFullJID(1) + "...");
JingleSession session0 = man0.createOutgoingJingleSession(getFullJID(1));
session0.addListener(new JingleSessionListener() {
public void sessionClosed(String reason, JingleSession jingleSession) {
}
public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {
}
public void sessionDeclined(String reason, JingleSession jingleSession) {
}
public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc,
JingleSession jingleSession) {
incCounter();
System.out.println("Initiator: the session is fully established.");
System.out.println("+ Payload Type: " + pt.getId());
System.out.println("+ Local IP/port: " + lc.getIp() + ":" + lc.getPort());
System.out.println("+ Remote IP/port: " + rc.getIp() + ":" + rc.getPort());
}
public void sessionMediaReceived(JingleSession jingleSession, String participant) {
// Do Nothing
}
public void sessionRedirected(String redirection, JingleSession jingleSession) {
}
});
session0.startOutgoing();
Thread.sleep(60000);
assertTrue(valCounter() == 2);