iceAgent.createStreams(jingleStreamManager.getMediaNames());
iceAgent.addAgentStateChangeListener(this);
iceAgent.addLocalCandidateToContents(acceptedContent);
JingleIQ iq = JinglePacketFactory.createSessionAccept(myJid, peerJid, sessionId, acceptedContent);
connection.sendPacket(iq);
state = SessionState.NEGOTIATING_TRANSPORT;
iceAgent.addRemoteCandidates( jiq );
iceAgent.startConnectivityEstablishment();
active = true;
break;
case DONOTANSWER:
System.out.println("Rejecting call (busy).");
closeSession(Reason.BUSY);
break;
}
} catch( IOException ioe ) {
System.out.println("An error occured. Rejecting call!");
JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
connection.sendPacket(iq);
closeSession(Reason.FAILED_APPLICATION);
} catch( IllegalArgumentException iae ) {
System.out.println("An error occured. Rejecting call!");
JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
connection.sendPacket(iq);
closeSession(Reason.FAILED_APPLICATION);
} catch( Exception e ) {
System.out.println("An error occured. Rejecting call!");
JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
connection.sendPacket(iq);
closeSession(Reason.FAILED_APPLICATION);
}
}